libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
i2c_common_v1.c File Reference
Include dependency graph for i2c_common_v1.c:

Go to the source code of this file.

Functions

void i2c_peripheral_enable (uint32_t i2c)
 I2C Peripheral Enable. More...
 
void i2c_peripheral_disable (uint32_t i2c)
 I2C Peripheral Disable. More...
 
void i2c_send_start (uint32_t i2c)
 I2C Send Start Condition. More...
 
void i2c_send_stop (uint32_t i2c)
 I2C Send Stop Condition. More...
 
void i2c_clear_stop (uint32_t i2c)
 I2C Clear Stop Flag. More...
 
void i2c_set_own_7bit_slave_address (uint32_t i2c, uint8_t slave)
 I2C Set the 7 bit Slave Address for the Peripheral. More...
 
void i2c_set_own_10bit_slave_address (uint32_t i2c, uint16_t slave)
 I2C Set the 10 bit Slave Address for the Peripheral. More...
 
void i2c_set_own_7bit_slave_address_two (uint32_t i2c, uint8_t slave)
 I2C Set the secondary 7 bit Slave Address for the Peripheral. More...
 
void i2c_enable_dual_addressing_mode (uint32_t i2c)
 I2C Enable dual addressing mode for the Peripheral. More...
 
void i2c_disable_dual_addressing_mode (uint32_t i2c)
 I2C Disable dual addressing mode for the Peripheral. More...
 
void i2c_set_clock_frequency (uint32_t i2c, uint8_t freq)
 I2C Set Peripheral Clock Frequency. More...
 
void i2c_send_data (uint32_t i2c, uint8_t data)
 I2C Send Data. More...
 
void i2c_set_fast_mode (uint32_t i2c)
 I2C Set Fast Mode. More...
 
void i2c_set_standard_mode (uint32_t i2c)
 I2C Set Standard Mode. More...
 
void i2c_set_ccr (uint32_t i2c, uint16_t freq)
 I2C Set Bus Clock Frequency. More...
 
void i2c_set_trise (uint32_t i2c, uint16_t trise)
 I2C Set the Rise Time. More...
 
void i2c_send_7bit_address (uint32_t i2c, uint8_t slave, uint8_t readwrite)
 I2C Send the 7-bit Slave Address. More...
 
uint8_t i2c_get_data (uint32_t i2c)
 I2C Get Data. More...
 
void i2c_enable_interrupt (uint32_t i2c, uint32_t interrupt)
 I2C Enable Interrupt. More...
 
void i2c_disable_interrupt (uint32_t i2c, uint32_t interrupt)
 I2C Disable Interrupt. More...
 
void i2c_enable_ack (uint32_t i2c)
 I2C Enable ACK. More...
 
void i2c_disable_ack (uint32_t i2c)
 I2C Disable ACK. More...
 
void i2c_nack_next (uint32_t i2c)
 I2C NACK Next Byte. More...
 
void i2c_nack_current (uint32_t i2c)
 I2C NACK Next Byte. More...
 
void i2c_set_dutycycle (uint32_t i2c, uint32_t dutycycle)
 I2C Set clock duty cycle. More...
 
void i2c_enable_dma (uint32_t i2c)
 I2C Enable DMA. More...
 
void i2c_disable_dma (uint32_t i2c)
 I2C Disable DMA. More...
 
void i2c_set_dma_last_transfer (uint32_t i2c)
 I2C Set DMA last transfer. More...
 
void i2c_clear_dma_last_transfer (uint32_t i2c)
 I2C Clear DMA last transfer. More...
 
static void i2c_write7_v1 (uint32_t i2c, int addr, const uint8_t *data, size_t n)
 
static void i2c_read7_v1 (uint32_t i2c, int addr, uint8_t *res, size_t n)
 
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, the read will use repeated start. More...
 
void i2c_set_speed (uint32_t i2c, enum i2c_speeds speed, uint32_t clock_megahz)
 Set the i2c communication speed. More...