47#define I2C_TASK_STARTRX(i2c) MMIO32((i2c) + 0x000)
48#define I2C_TASK_STARTTX(i2c) MMIO32((i2c) + 0x008)
49#define I2C_TASK_STOP(i2c) MMIO32((i2c) + 0x014)
50#define I2C_TASK_SUSPEND(i2c) MMIO32((i2c) + 0x01c)
51#define I2C_TASK_RESUME(i2c) MMIO32((i2c) + 0x020)
54#define I2C_EVENT_STOPPED(i2c) MMIO32((i2c) + 0x104)
55#define I2C_EVENT_RXDREADY(i2c) MMIO32((i2c) + 0x108)
56#define I2C_EVENT_TXDSENT(i2c) MMIO32((i2c) + 0x11c)
57#define I2C_EVENT_ERROR(i2c) MMIO32((i2c) + 0x124)
58#define I2C_EVENT_BB(i2c) MMIO32((i2c) + 0x138)
59#define I2C_EVENT_SUSPENDED(i2c) MMIO32((i2c) + 0x148)
62#define I2C_SHORTS(i2c) MMIO32((i2c) + 0x200)
63#define I2C_INTEN(i2c) MMIO32((i2c) + 0x300)
64#define I2C_INTENSET(i2c) MMIO32((i2c) + 0x304)
65#define I2C_INTENCLR(i2c) MMIO32((i2c) + 0x308)
66#define I2C_ERRORSRC(i2c) MMIO32((i2c) + 0x4c4)
67#define I2C_ENABLE(i2c) MMIO32((i2c) + 0x500)
68#define I2C_PSELSCL(i2c) MMIO32((i2c) + 0x508)
69#define I2C_PSELSDA(i2c) MMIO32((i2c) + 0x50c)
70#define I2C_RXD(i2c) MMIO32((i2c) + 0x518)
71#define I2C_TXD(i2c) MMIO32((i2c) + 0x51c)
72#define I2C_FREQUENCY(i2c) MMIO32((i2c) + 0x524)
73#define I2C_ADDRESS(i2c) MMIO32((i2c) + 0x588)
85#define I2C_SHORTS_BB_SUSPEND (1 << 0)
88#define I2C_SHORTS_BB_STOP (1 << 1)
95#define I2C_INTEN_STOPPED (1 << 1)
96#define I2C_INTEN_RXDREADY (1 << 2)
97#define I2C_INTEN_TXDSENT (1 << 7)
98#define I2C_INTEN_ERROR (1 << 9)
99#define I2C_INTEN_BB (1 << 14)
103#define I2C_ERRORSRC_OVERRUN (1 << 0)
104#define I2C_ERRORSRC_ANACK (1 << 1)
105#define I2C_ERRORSRC_DNACK (1 << 2)
114#define I2C_MODE_LEGACY (5)
122#define I2C_FREQUENCY_100K (0x01980000)
124#define I2C_FREQUENCY_250K (0x04000000)
129#define I2C_FREQUENCY_390K (0x06200000)
136#define I2C_FREQUENCY_400K (0x06680000)
139#define I2C_PSEL_OFF (0xffffffff)
void i2c_start_rx(uint32_t i2c)
Start I2C reception.
void i2c_resume(uint32_t i2c)
Resume I2C transaction.
void i2c_disable(uint32_t i2c)
Disable I2C peripheral.
void i2c_select_pins(uint32_t i2c, uint32_t scl_pin, uint32_t sda_pin)
Select GPIO pins to be used by this peripheral.
void i2c_set_fast_mode(uint32_t i2c)
Select Fast (400kHz) mode.
void i2c_enable(uint32_t i2c, uint32_t mode)
Enable I2C peripheral.
void i2c_set_frequency(uint32_t i2c, uint32_t freq)
Set I2C frequency.
void i2c_start_tx(uint32_t i2c)
Start I2C transmission.
void i2c_set_standard_mode(uint32_t i2c)
Select Standard (100kHz) mode.
void i2c_send_stop(uint32_t i2c)
Signal stop on I2C line.
void i2c_set_shorts(uint32_t i2c, uint32_t shorts)
Configure event -> task shortcuts.
void i2c_send_data(uint32_t i2c, uint8_t data)
Write Data to TXD register to be sent.
uint8_t i2c_get_data(uint32_t i2c)
Read Data from RXD register.
void i2c_set_address(uint32_t i2c, uint8_t addr)
Set 7bit I2C address of the device you wish to communicate with.