CuVoodoo STM32F1 firmware template
|
library to communicate using I2C as master (API) More...
Go to the source code of this file.
Functions | |
void | i2c_master_setup (bool fast) |
setup I2C peripheral More... | |
bool | i2c_master_read (uint8_t slave, const uint8_t *address, size_t address_size, uint8_t *data, size_t data_size) |
read from I2C slave More... | |
bool | i2c_master_write (uint8_t slave, const uint8_t *address, size_t address_size, const uint8_t *data, size_t data_size) |
write to I2C slave More... | |
library to communicate using I2C as master (API)
Definition in file i2c_master.h.
bool i2c_master_read | ( | uint8_t | slave, |
const uint8_t * | address, | ||
size_t | address_size, | ||
uint8_t * | data, | ||
size_t | data_size | ||
) |
read from I2C slave
[in] | slave | 7-bit I2C salve device address to read from |
[in] | address | memory address of slave to read from |
[in] | address_size | address size in bytes |
[out] | data | array to store bytes read |
[in] | data_size | number of bytes to read |
Definition at line 97 of file i2c_master.c.
void i2c_master_setup | ( | bool | fast | ) |
setup I2C peripheral
[in] | fast | use standard (100 kHz) or fast (400 kHz) mode |
Definition at line 50 of file i2c_master.c.
bool i2c_master_write | ( | uint8_t | slave, |
const uint8_t * | address, | ||
size_t | address_size, | ||
const uint8_t * | data, | ||
size_t | data_size | ||
) |
write to I2C slave
[in] | slave | 7-bit I2C salve device address to write to |
[in] | address | memory address of slave to write to |
[in] | address_size | address size in bytes |
[in] | data | array of byte to write to slave |
[in] | data_size | number of bytes to write |
Definition at line 216 of file i2c_master.c.