Common enums and signal definitions for TWI classes.
More...
|
| class | Client |
| | Base abstract definition for a TWI client. This class implements the basic state machine to interface a TWI bus as a client. It is design to be controlled by a upper layer object (a controller). The interface notifies the controller of bus events (start, address, etc) via the signals and the controller shall use the API of this class to react accordingly. More...
|
| |
| class | EndPoint |
| | An endpoint connected to a TWI bus. Represents a device connected to a TWI bus model and implements the basic level logic common to a host and a client. More...
|
| |
| class | Host |
| | Base abstract definition for a TWI host. This class implements the basic state machine to interface a TWI bus as a host. It is design to be controlled by a upper layer object (a controller). The interface notifies the controller of bus events (start, address, etc) via the signals and the controller shall use the API of this class to react accordingly. More...
|
| |
|
| enum | Line { Line_Clock = 0
, Line_Data
} |
| |
| enum | BusState { Bus_Idle = 0
, Bus_Busy
, Bus_Owned
} |
| |
| enum | SignalId {
Signal_StateChanged = 0
, Signal_BusStateChanged
, Signal_Start
, Signal_AddressStandby
,
Signal_AddressSent
, Signal_AddressReceived
, Signal_DataStandby
, Signal_DataSent
,
Signal_DataAckReceived
, Signal_DataReceived
, Signal_DataAckSent
, Signal_ArbitrationLost
,
Signal_BusCollision
, Signal_Stop
} |
| |
Common enums and signal definitions for TWI classes.
- See also
- EndPoint, Client, Host
◆ BusState
Bus state values
| Enumerator |
|---|
| Bus_Idle | The bus is not in use.
|
| Bus_Busy | The bus is busy and owned by a host different from the current interface.
|
| Bus_Owned | The current interface (host only) owns the bus.
|
◆ Line
Index definition for the lines used in a TWI bus
| Enumerator |
|---|
| Line_Clock | Index for the SCL line.
|
| Line_Data | Index for the SDA line.
|
◆ SignalId
SignalIds common to both Client (C) and Host (H).
| Enumerator |
|---|
| Signal_StateChanged | H+C : raised at every change of state of the interface. For debug purpose. data is the State enum value of the respective interface.
|
| Signal_BusStateChanged | H: raised when a change of bus state (busy/owned/idle) is detected. C: raised when selected/deselected by the host. data is the BusState enum value
|
| Signal_Start | C only : raised when a Start or Repeated Start condition is detected. data is 1 if the client was active prior to the Start condition, or 0 if it was idle.
|
| Signal_AddressStandby | H only : raised after a Start or Repeated Start condition, the host is ready to transmit an address byte.
|
| Signal_AddressSent | H only : raised after transmitting an address byte and ACK bit has been received. data is the ack value: 1 for ACK, 0 for NACK.
|
| Signal_AddressReceived | C only : raised after receiving an address byte. data is the byte value.
|
| Signal_DataStandby | H+C : raised when ready to transmit/receive data.
|
| Signal_DataSent | H+C : raised when data has been sent.
|
| Signal_DataAckReceived | H+C : raised when the ACK bit after transmitting data has been received. data is the ack value: 1 for ACK, 0 for NACK.
|
| Signal_DataReceived | H+C : raised when data has been received. data is the byte value.
|
| Signal_DataAckSent | H+C : raised when the ACK bit after receiving data has been sent.
|
| Signal_ArbitrationLost | H only : raised when arbitration loss has been detected. data is the enum value of the state where the arbitration loss occurred.
|
| Signal_BusCollision | C only : raised when a bus collision has been detected.
|
| Signal_Stop | H : raised when the transmission of a Stop condition is complete. C : raised when a Stop condition has been detected. data is 1 if the client was active on the bus until the stop condition and 0 if it was idle.
|