|
template<size_t I2C_BUFFER_SIZE, size_t STACK_SIZE, size_t QUEUE_BUFFER_SIZE> |
| MyI2CSlave (uint8_t(&buffer)[I2C_BUFFER_SIZE], const uint32_t(&stack)[STACK_SIZE], uint8_t(&queueBuffer)[QUEUE_BUFFER_SIZE]) |
|
void | run () |
| Enter the loop that will watch and operate the bus.
|
|
size_t | available () const |
| Get the amount of bytes in the receive buffer. More...
|
|
int | read () |
| Read the next byte from the receiveBuffer. More...
|
|
void | write (const uint8_t data) |
| Send the given byte of data on the bus during a request from the bus master. More...
|
|
|
template<class T > |
static int8_t | invoke (T &runnable) |
| Start a new cog running the given object. More...
|
|
|
static const int | ADDRESS = 42 |
|
static const int | SHIFTED_ADDRESS = ADDRESS << 1 |
|
static const Pin::Mask | DEFAULT_SCL_MASK = Pin::Mask::P28 |
|
static const Pin::Mask | DEFAULT_SDA_MASK = Pin::Mask::P29 |
|
- Examples
- I2CSlave_Demo.cpp.
Definition at line 36 of file I2CSlave_Demo.cpp.
◆ available()
size_t PropWare::I2CSlave::available |
( |
| ) |
const |
|
inherited |
Get the amount of bytes in the receive buffer.
- Returns
- The amount of bytes in the receive buffer
Definition at line 144 of file i2cslave.h.
◆ invoke()
template<class T >
static int8_t PropWare::Runnable::invoke |
( |
T & |
runnable | ) |
|
|
staticinherited |
Start a new cog running the given object.
- Parameters
-
[in] | runnable | Object that should be invoked in a new cog |
- Returns
- If the cog was successfully started, the new cog ID is returned. Otherwise, -1 is returned
Definition at line 85 of file runnable.h.
◆ read()
int PropWare::I2CSlave::read |
( |
| ) |
|
|
inherited |
Read the next byte from the receiveBuffer.
- Returns
- The next byte from the receiveBuffer,
-1
when none is available.
- Examples
- I2CSlave_Demo.cpp.
Definition at line 153 of file i2cslave.h.
◆ write()
void PropWare::I2CSlave::write |
( |
const uint8_t |
data | ) |
|
|
inherited |
Send the given byte of data on the bus during a request from the bus master.
- Parameters
-
[in] | data | Byte to send to the requesting master. |
- Warning
- Calling this method too late may result in a defective state of the i2c state machine.
- Examples
- I2CSlave_Demo.cpp.
Definition at line 167 of file i2cslave.h.
The documentation for this class was generated from the following file: