#include "SFBTypes.h"


Go to the source code of this file.
Data Structures | |
| class | SFBHWI2C |
| Provide access to the I2C bus hardware on the IXM. More... | |
Typedefs | |
| typedef u32(* | I2CByteSource )(int offset) |
| A function pointer type that can be called to obtain the next byte to send on an I2C bus when in 'streaming transmit' mode (see SFBHWI2C::setByteSource()). | |
| typedef bool(* | I2CByteSink )(u8 byte) |
| A function pointer type that can be called to handle the next byte received from an I2C bus when in 'streaming receive' mode (see SFBHWI2C::setByteSink()). | |
Enumerations | |
| enum | I2CStatusCodes { I2C_MODE_UNINITIALIZED = -4, I2C_MODE_ARBITRATION_ERROR = -3, I2C_MODE_NO_ACK = -2, I2C_MODE_ERROR = -1, I2C_MODE_DONE = 0, I2C_MODE_RECEIVE = 1, I2C_MODE_TRANSMIT = 2, I2C_MODE_TRANSCEIVE = 3 } |
| States of an I2C engine. More... | |
| enum | I2CInterfaceCodes { I2C_1 = 1, I2C_2 = 2 } |
| I2C interface codes. More... | |
| enum | I2CPinSelectCode { I2C1_PINS_WEST_TX_RX = 0, I2C1_PINS_SOUTH_D3_D2 = 1, I2C2_PINS_EAST_TX_RX = 0 } |
| I2C pin selection codes, passed to SFBHWI2C::init() to select which pins will be used for I2C. More... | |
WARNING! This code has been tested on only a few I2C devices! Your Mileage May Vary!
| typedef bool(* I2CByteSink)(u8 byte) |
A function pointer type that can be called to handle the next byte received from an I2C bus when in 'streaming receive' mode (see SFBHWI2C::setByteSink()).
When called, a function of this type is passed the next byte received, and it returns true to continue receiving and false to end the command.
| typedef u32(* I2CByteSource)(int offset) |
A function pointer type that can be called to obtain the next byte to send on an I2C bus when in 'streaming transmit' mode (see SFBHWI2C::setByteSource()).
When called, a function of this type is passed the current 'data count' (see SFBHWI2C::count()), indicating what byte is about to be sent, and it is expected to return 0..255 to provide the next byte to send, or return 256 to end the transmission.
| enum I2CInterfaceCodes |
I2C interface codes.
These are the possible values to pass to SFBHWI2C::SFBHWI2C.
| enum I2CPinSelectCode |
I2C pin selection codes, passed to SFBHWI2C::init() to select which pins will be used for I2C.
Note the each of the following codes is limited to one specific I2CInterfaceCodes value -- the value passed to SFBHWI2C::init() must be properly coordinated with the value passed to SFBHWI2C!
| I2C1_PINS_WEST_TX_RX | Use WEST_TX_PIN for SDA1 and WEST_RX_PIN for SCL1. |
| I2C1_PINS_SOUTH_D3_D2 | Use SOUTH_D3_PIN for SDA1 and SOUTH_D2_PIN for SCL1. |
| I2C2_PINS_EAST_TX_RX | Use EAST_TX_PIN for SDA2 and EAST_RX_PIN for SCL2. |
| enum I2CStatusCodes |
States of an I2C engine.
These are the possible return values from SFBHWI2C::status.