105 I2C_OAR1(i2c) = (uint16_t)(slave << 1);
147 I2C_CR1(i2c) &= ~I2C_CR1_ANFOFF;
202 I2C_CR1(i2c) &= ~I2C_CR1_NOSTRETCH;
212 I2C_CR2(i2c) &= ~I2C_CR2_ADD10;
234 I2C_CR2(i2c) &= ~I2C_CR2_RD_WRN;
260 I2C_CR2(i2c) &= ~I2C_CR2_AUTOEND;
328 I2C_CR1(i2c) &= ~I2C_CR1_RXDMAEN;
348 I2C_CR1(i2c) &= ~I2C_CR1_TXDMAEN;
362void i2c_transfer7(uint32_t i2c, uint8_t addr,
const uint8_t *w,
size_t wn, uint8_t *r,
size_t rn)
404 for (
size_t i = 0; i < rn; i++) {
429 prescaler = clock_megahz / 8 - 1;
440 prescaler = (clock_megahz / 4) - 1;
#define I2C_CR1_DNF_MASK
DNF[3:0]: Digital noise filter.
#define I2C_ISR(i2c_base)
#define I2C_CR1_NOSTRETCH
#define I2C_TIMINGR_SCLL_SHIFT
#define I2C_CR1(i2c_base)
#define I2C_TIMINGR_SDADEL_SHIFT
#define I2C_RXDR(i2c_base)
#define I2C_TIMINGR_PRESC_SHIFT
#define I2C_CR1_DNF_SHIFT
#define I2C_CR2_NBYTES_SHIFT
#define I2C_ICR(i2c_base)
#define I2C_CR2_SADD_10BIT_SHIFT
i2c_speeds
I2C speed modes.
#define I2C_OAR1(i2c_base)
#define I2C_CR2_SADD_7BIT_SHIFT
#define I2C_TIMINGR_SCLH_SHIFT
#define I2C_TIMINGR(i2c_base)
#define I2C_TIMINGR_SCLDEL_SHIFT
#define I2C_CR2(i2c_base)
#define I2C_TXDR(i2c_base)
void i2c_disable_interrupt(uint32_t i2c, uint32_t interrupt)
I2C Disable Interrupt.
void i2c_set_7bit_address(uint32_t i2c, uint8_t addr)
void i2c_enable_analog_filter(uint32_t i2c)
void i2c_enable_interrupt(uint32_t i2c, uint32_t interrupt)
I2C Enable Interrupt.
void i2c_set_digital_filter(uint32_t i2c, uint8_t dnf_setting)
Set the I2C digital filter.
void i2c_set_10bit_addr_mode(uint32_t i2c)
void i2c_set_7bit_addr_mode(uint32_t i2c)
void i2c_disable_analog_filter(uint32_t i2c)
void i2c_set_10bit_address(uint32_t i2c, uint16_t addr)
void i2c_set_prescaler(uint32_t i2c, uint8_t presc)
void i2c_set_data_setup_time(uint32_t i2c, uint8_t s_time)
void i2c_disable_stretching(uint32_t i2c)
void i2c_send_start(uint32_t i2c)
I2C Send Start Condition.
void i2c_peripheral_disable(uint32_t i2c)
I2C Peripheral Disable.
void i2c_set_bytes_to_transfer(uint32_t i2c, uint32_t n_bytes)
bool i2c_is_start(uint32_t i2c)
void i2c_set_write_transfer_dir(uint32_t i2c)
bool i2c_received_data(uint32_t i2c)
void i2c_set_own_7bit_slave_address(uint32_t i2c, uint8_t slave)
I2C Set the 7 bit Slave Address for the Peripheral.
void i2c_set_scl_high_period(uint32_t i2c, uint8_t period)
void i2c_disable_autoend(uint32_t i2c)
void i2c_send_stop(uint32_t i2c)
I2C Send Stop Condition.
void i2c_peripheral_enable(uint32_t i2c)
I2C Peripheral Enable.
void i2c_enable_rxdma(uint32_t i2c)
I2C Enable reception DMA.
void i2c_set_data_hold_time(uint32_t i2c, uint8_t h_time)
void i2c_set_own_10bit_slave_address(uint32_t i2c, uint16_t slave)
I2C Set the 10 bit Slave Address for the Peripheral.
bool i2c_transmit_int_status(uint32_t i2c)
void i2c_disable_rxdma(uint32_t i2c)
I2C Disable reception DMA.
void i2c_enable_autoend(uint32_t i2c)
void i2c_enable_stretching(uint32_t i2c)
void i2c_set_read_transfer_dir(uint32_t i2c)
void i2c_send_data(uint32_t i2c, uint8_t data)
I2C Send Data.
uint8_t i2c_get_data(uint32_t i2c)
I2C Get Data.
void i2c_clear_stop(uint32_t i2c)
I2C Clear Stop Flag.
bool i2c_busy(uint32_t i2c)
void i2c_set_scl_low_period(uint32_t i2c, uint8_t period)
void i2c_disable_txdma(uint32_t i2c)
I2C Disable transmission DMA.
void i2c_enable_txdma(uint32_t i2c)
I2C Enable transmission DMA.
bool i2c_transfer_complete(uint32_t i2c)
void i2c_transfer7(uint32_t i2c, uint8_t addr, const uint8_t *w, size_t wn, uint8_t *r, size_t rn)
Run a write/read transaction to a given 7bit i2c address If both write & read are provided,...
bool i2c_nack(uint32_t i2c)
void i2c_set_speed(uint32_t i2c, enum i2c_speeds speed, uint32_t clock_megahz)
Set the i2c communication speed.