An endpoint connected to a SPI bus. Represents a device connected to a SPI bus model and acting as a host or client. This is primarily intended to help simulate peripherals connected to the MCU model. Note that this class only implements the logic require to shift bytes across the SPI bus in all modes or bit orders.
More...
#include <sim_spi.h>
An endpoint connected to a SPI bus. Represents a device connected to a SPI bus model and acting as a host or client. This is primarily intended to help simulate peripherals connected to the MCU model. Note that this class only implements the logic require to shift bytes across the SPI bus in all modes or bit orders.
◆ EndPoint()
◆ ~EndPoint()
| virtual SPI::EndPoint::~EndPoint |
( |
| ) |
|
|
virtualdefault |
◆ active()
| bool SPI::EndPoint::active |
( |
| ) |
const |
|
inlineprotected |
◆ bit_order()
| BitOrder SPI::EndPoint::bit_order |
( |
| ) |
const |
|
inline |
◆ complete_frame()
| bool SPI::EndPoint::complete_frame |
( |
| ) |
const |
|
inline |
Returns true when a complete byte has been transferred/received.
◆ frame_completed()
| void EndPoint::frame_completed |
( |
| ) |
|
|
protectedvirtual |
Virtual callback function called on the last clock edge of a byte shift. Can be overriden by upper layers to signal when the transmission/reception of a byte has been completed. The base function does nothing.
Reimplemented in ArchAVR_SPI::_Controller, and ArchXT_SPI::_Controller.
◆ read_data_input()
| virtual bool SPI::EndPoint::read_data_input |
( |
| ) |
|
|
protectedpure virtual |
◆ serial_mode()
◆ set_active()
| void EndPoint::set_active |
( |
bool |
active | ) |
|
|
protected |
Enable/disable the endpoint A disabled endpoint will ignore any clock change but still keeps track of them.
◆ set_bit_order()
| void EndPoint::set_bit_order |
( |
BitOrder |
order | ) |
|
◆ set_serial_mode()
◆ set_shift_clock()
| void EndPoint::set_shift_clock |
( |
bool |
state | ) |
|
|
protected |
Upper layers should call this function to flip the clock line state. The logic will shift bit values to the Data IN/Out wires as appropriate according to the mode and bitorder selected. Does nothing if the clock state is unchanged or the endpoint is inactive.
- Parameters
-
| state | new clock line state true=clock rise, false=clock fall |
◆ set_shift_data()
| void EndPoint::set_shift_data |
( |
uint8_t |
frame | ) |
|
Set the byte to be transmitted in the next transfer.
◆ shift_clock()
| bool SPI::EndPoint::shift_clock |
( |
| ) |
const |
|
inlineprotected |
◆ shift_data()
| uint8_t SPI::EndPoint::shift_data |
( |
| ) |
const |
|
inline |
Return the content of the shift register. When called after a transfer, it contains the received byte.
◆ write_data_output()
| virtual void SPI::EndPoint::write_data_output |
( |
bool |
level | ) |
|
|
protectedpure virtual |
The documentation for this class was generated from the following files: