Pico_I2C_Lib/slave/src/include/i2c_buffer.h

20 lines
569 B
C

#ifndef I2C_BUFFER_H
#define I2C_BUFFER_H
#include <stdint.h>
#include "i2c_slave.h"
typedef struct i2c_buffer_t {
uint8_t buffer[256];
uint8_t buffer_reg;
bool buffer_reg_written;
} i2c_buffer_t;
// I2c slave buffer handler for writing and reading data to the buffer
void __not_in_flash_func(i2c_slave_buffer_handler)(i2c_slave_event_t event);
// Update motors from the data in the i2c buffer
void update_motors_from_buffer(void);
// Update servo motors from the data in the i2c buffer
void update_servo_motors_from_buffer(void);
#endif // I2C_BUFFER_H