i2c_slave.h File Reference
#include "hardware/i2c.h"
Include dependency graph for i2c_slave.h:

Go to the source code of this file.

Typedefs

typedef enum i2c_slave_event_t i2c_slave_event_t
 I2C slave event types.
 
typedef void(* i2c_slave_handler_t) (i2c_inst_t *i2c, i2c_slave_event_t event)
 I2C slave event handlerThe event handler will run from the I2C ISR, so it should return quickly (under 25 us at 400 kb/s). Avoid blocking inside the handler and split large data transfers across multiple calls for best results. When sending data to master, up to i2c_get_write_available() bytes can be written without blocking. When receiving data from master, up to 2c_get_read_available() bytes can be read without blocking. More...
 

Enumerations

enum  i2c_slave_event_t { I2C_SLAVE_RECEIVE, I2C_SLAVE_REQUEST, I2C_SLAVE_FINISH }
 I2C slave event types. More...
 

Functions

void i2c_slave_init (i2c_inst_t *i2c, uint8_t address, i2c_slave_handler_t handler)
 Configure an I2C instance for slave mode. More...
 
void i2c_slave_deinit (i2c_inst_t *i2c)
 Restore an I2C instance to master mode. More...