1 #ifndef RUUVI_INTERFACE_I2C_H
2 #define RUUVI_INTERFACE_I2C_H
26 # define RUUVI_NRF5_SDK15_I2C_ENABLED RUUVI_NRF5_SDK15_ENABLED
84 uint8_t *
const p_rx,
const size_t rx_len);
97 uint8_t *
const p_tx,
const size_t tx_len,
const bool stop);
uint32_t rd_status_t
bitfield for representing errors
Header to enable and disable module compilation.
Ruuvi error codes and error check function.
uint16_t ri_gpio_id_t
port<<8 + pin
rd_status_t ri_i2c_init(const ri_i2c_init_config_t *const config)
Initialize I2C driver with given settings.
rd_status_t ri_i2c_write_blocking(const uint8_t address, uint8_t *const p_tx, const size_t tx_len, const bool stop)
I2C read function.
bool ri_i2c_is_init()
Check if i2c driver is initialized.
rd_status_t ri_i2c_uninit(void)
Uninitialize I2C.
@ RI_I2C_FREQUENCY_250k
250 kbps.
@ RI_I2C_FREQUENCY_400k
400 kbps.
@ RI_I2C_FREQUENCY_100k
100 kbps.
rd_status_t ri_i2c_read_blocking(const uint8_t address, uint8_t *const p_rx, const size_t rx_len)
I2C read function.
ri_gpio_id_t bus_pwr
Power to pull-ups, UNUSED if fixed.
ri_gpio_id_t sda
pin number of SDA
ri_i2c_frequency_t frequency
Frequency of I2C Bus, see ri_i2c_frequency_t.
ri_gpio_id_t scl
pin number of SCL