39 #define I2C_BUFFER_SIZE 128 295 #ifdef RC_AUTOPILOT_EXT 309 int rc_i2c_read_data(
int bus, uint8_t regAddr,
size_t length, uint8_t *data);
310 #endif // RC_AUTOPILOT_EXT int rc_i2c_write_word(int bus, uint8_t regAddr, uint16_t data)
Writes a single word (16 bits) to a specified register address.
int rc_i2c_read_byte(int bus, uint8_t regAddr, uint8_t *data)
Reads a single byte from a device register.
int rc_i2c_send_byte(int bus, uint8_t data)
Sends exactly user-defined data without prepending a register address.
int rc_i2c_close(int bus)
Closes an I2C bus.
int rc_i2c_set_device_address(int bus, uint8_t devAddr)
Changes the device address the bus is configured to talk to.
int rc_i2c_get_fd(int bus)
Gets file descriptor.
int rc_i2c_unlock_bus(int bus)
Unlocks a bus to indicate to other threads in the process that the bus is now free.
int rc_i2c_init(int bus, uint8_t devAddr)
Initializes a bus and sets it to talk to a particular device address.
int rc_i2c_lock_bus(int bus)
Locks the bus so other threads in the process know the bus is in use.
int rc_i2c_write_byte(int bus, uint8_t regAddr, uint8_t data)
Writes a single byte to a specified register address.
int rc_i2c_write_words(int bus, uint8_t regAddr, size_t count, uint16_t *data)
Writes multiple words (16 bits each) to a specified register address.
int rc_i2c_read_bytes(int bus, uint8_t regAddr, size_t count, uint8_t *data)
Reads multiple bytes from a device register.
int rc_i2c_read_words(int bus, uint8_t regAddr, size_t count, uint16_t *data)
Reads multiple words (16 bytes each) from a device register.
int rc_i2c_write_bytes(int bus, uint8_t regAddr, size_t count, uint8_t *data)
Writes multiple bytes to a specified register address.
int rc_i2c_read_word(int bus, uint8_t regAddr, uint16_t *data)
Reads a single word (16 bits) from a device register.
int rc_i2c_get_lock(int bus)
Fetches the current lock state of the bus.
int rc_i2c_send_bytes(int bus, size_t count, uint8_t *data)
Sends exactly user-defined data without prepending a register address.