Slave Device
Overview of basic functions for I2C communication with Feelix.
#define SLAVE_0_ADDRESS 0x70
#define SLAVE_INDEX 0Initialization
/* initialize Feelix as slave device*/
feelix.init_I2C_Slave(
SLAVE_0_ADDRESS, //address of slave device
SLAVE_INDEX, //index of slave defined in initializer master device (uint8_t slaves[])
&callback_I2C_Request, //callback that fires when master requests data
DEBUG, //(optional)
// bool debug (set to false before production)
callbackArr, //(optional)
// array with callback functions (functionPtr)
callbackLength); //(optional)
// size of array/* initialize Feelix as slave device*/
feelix.init_I2C_Master(
slaves[], //index of slave defined in initializer master device (uint8_t slaves[])
CLOCK_SPEED::SLOW_MODE, //Clock frequency
&callback_I2C_Request, //callback that fires when master requests data
DEBUG, //(optional)
// bool debug (set to false before production)
callbackArr, //(optional)
// array with callback functions (functionPtr)
callbackLength); //(optional)
// size of arrayReply to master
Receive data from master
Last updated
Was this helpful?
