50#define TR_HAL_MAX_I2C_CONTROLLER_ID 1
51#define NUM_I2C_CONTROLLER 2
57#define DEFAULT_I2C_SCL0_PIN 22
58#define DEFAULT_I2C_SDA0_PIN 23
60#define DEFAULT_I2C_SCL1_PIN 20
61#define DEFAULT_I2C_SDA1_PIN 21
65#define I2C_TX_FIFO_BYTES 18
68#define I2C_RX_FIFO_BYTES 16
79#ifdef I2C_MASTER0_SECURE_EN
80 #define CHIP_MEMORY_MAP_I2C_CONTROLLER0_BASE (0x5002B000UL)
82 #define CHIP_MEMORY_MAP_I2C_CONTROLLER0_BASE (0x4002B000UL)
85#ifdef I2C_MASTER1_SECURE_EN
86 #define CHIP_MEMORY_MAP_I2C_CONTROLLER1_BASE (0x5002C000UL)
88 #define CHIP_MEMORY_MAP_I2C_CONTROLLER1_BASE (0x4002C000UL)
100 __IO uint32_t control;
124#define I2C_CONTROL_ENABLE_CONTROLLER 0x01
125#define I2C_CONTROL_DISABLE_CONTROLLER 0x00
127#define I2C_CONTROL_ENABLE_RESTART 0x02
129#define I2C_CONTROL_STOP_TRANSACTION 0x04
131#define I2C_CONTROL_BUS_CLEAR 0x08
133#define I2C_CONTROL_FIFO_CLEAR 0x10
140#define I2C_BUFFER_SET_FOR_READ 0x100
142#define I2C_BUFFER_SET_FOR_WRITE 0x000
147#define I2C_INTERRUPT_RX_UNDER 0x01
148#define I2C_INTERRUPT_RX_OVER 0x02
149#define I2C_INTERRUPT_RX_FULL 0x04
150#define I2C_INTERRUPT_RX_FINISH 0x08
151#define I2C_INTERRUPT_TX_OVER 0x10
152#define I2C_INTERRUPT_TX_EMPTY 0x20
153#define I2C_INTERRUPT_ABORT_A_NACK 0x40
154#define I2C_INTERRUPT_ABORT_W_NACK 0x80
155#define I2C_INTERRUPT_ABORT_LOST_ARB 0x100
156#define I2C_INTERRUPT_IDLE_STATE 0x200
158#define I2C_INTERRUPT_ALL 0x1FF
196#define I2C0_CHIP_REGISTERS ((I2C_REGISTERS_T *) CHIP_MEMORY_MAP_I2C_CONTROLLER0_BASE)
197#define I2C1_CHIP_REGISTERS ((I2C_REGISTERS_T *) CHIP_MEMORY_MAP_I2C_CONTROLLER1_BASE)
217#define I2C_EVENT_RX_UNDER 0x01
218#define I2C_EVENT_RX_OVER 0x02
219#define I2C_EVENT_RX_FULL 0x04
220#define I2C_EVENT_RX_FINISH 0x08
221#define I2C_EVENT_TX_OVER 0x10
222#define I2C_EVENT_TX_EMPTY 0x20
223#define I2C_EVENT_ABORT_A_NACK 0x40
224#define I2C_EVENT_ABORT_W_NACK 0x80
225#define I2C_EVENT_ABORT_LOST_ARB 0x100
252 bool enable_chip_interrupts;
261 bool wake_on_interrupt;
270#define I2C_CONFIG_CONTROLLER0 \
272 .sda_pin = (tr_hal_gpio_pin_t) { DEFAULT_I2C_SDA0_PIN },\
273 .scl_pin = (tr_hal_gpio_pin_t) { DEFAULT_I2C_SCL0_PIN },\
274 .clock_setting = I2C_CLOCK_100_KHZ, \
275 .rx_handler_function = NULL, \
276 .event_handler_fx = NULL, \
277 .enable_chip_interrupts = true, \
278 .interrupt_priority = TR_HAL_INTERRUPT_PRIORITY_5, \
279 .wake_on_interrupt = false, \
282#define I2C_CONFIG_CONTROLLER1 \
284 .sda_pin = (tr_hal_gpio_pin_t) { DEFAULT_I2C_SDA1_PIN },\
285 .scl_pin = (tr_hal_gpio_pin_t) { DEFAULT_I2C_SCL1_PIN },\
286 .clock_setting = I2C_CLOCK_100_KHZ, \
287 .rx_handler_function = NULL, \
288 .event_handler_fx = NULL, \
289 .enable_chip_interrupts = true, \
290 .interrupt_priority = TR_HAL_INTERRUPT_PRIORITY_5, \
291 .wake_on_interrupt = false, \
void(* tr_hal_i2c_event_callback_t)(tr_hal_i2c_id_t i2c_id, uint32_t event_bitmask)
Definition T32CM11_i2c.h:232
tr_hal_i2c_clock_rate_t
Definition T32CM11_i2c.h:201
@ I2C_CLOCK_1_MHZ
Definition T32CM11_i2c.h:202
@ I2C_CLOCK_200_KHZ
Definition T32CM11_i2c.h:205
@ I2C_CLOCK_400_KHZ
Definition T32CM11_i2c.h:204
@ I2C_CLOCK_100_KHZ
Definition T32CM11_i2c.h:206
void(* tr_hal_i2c_receive_callback_t)(uint8_t received_byte)
Definition T32CM11_i2c.h:229
tr_hal_i2c_id_t
On the T32CM11 there is just 1 I2C available to act as a Controller.
Definition T32CM11_i2c.h:43
@ I2C_CTRL_0_ID
Definition T32CM11_i2c.h:44
I2C_REGISTERS_T * tr_hal_i2c_get_controller_register_address(tr_hal_i2c_id_t i2c_id)
@ I2C_CLOCK_10_KHZ
Definition T32CZ20_i2c.h:186
@ I2C_CLOCK_50_KHZ
Definition T32CZ20_i2c.h:185
@ I2C_CTRL_1_ID
Definition T32CZ20_i2c.h:46
Definition T32CM11_i2c.h:87
__IO uint32_t buffer
Definition T32CZ20_i2c.h:106
__IO uint32_t interrupt_raw_status
Definition T32CZ20_i2c.h:111
__IO uint32_t target
Definition T32CZ20_i2c.h:103
__IO uint32_t interrupt_status
Definition T32CM11_i2c.h:101
__IO uint32_t interrupt_clear
Definition T32CZ20_i2c.h:112
__IO uint32_t clock_divider
Definition T32CZ20_i2c.h:115
__IO uint32_t interrupt_enable
Definition T32CM11_i2c.h:98
pin type
Definition tr_hal_platform.h:23
Definition T32CM11_i2c.h:304
uint32_t write_exit_on_flag
Definition T32CZ20_i2c.h:313
uint32_t count_idle
Definition T32CZ20_i2c.h:309
uint32_t write_exit_on_crazy
Definition T32CZ20_i2c.h:314
uint32_t count_abort_a_nack
Definition T32CZ20_i2c.h:306
uint32_t read_exit_on_crazy
Definition T32CZ20_i2c.h:317
uint32_t count_tx_empty
Definition T32CM11_i2c.h:307
uint32_t count_abort_lost_arb
Definition T32CM11_i2c.h:308
uint32_t count_rx_over
Definition T32CZ20_i2c.h:301
uint32_t count_abort_w_nack
Definition T32CZ20_i2c.h:307
uint32_t read_exit_on_int_status
Definition T32CZ20_i2c.h:315
uint32_t count_tx_over
Definition T32CZ20_i2c.h:304
uint32_t count_rx_full
Definition T32CZ20_i2c.h:302
uint32_t read_exit_on_flag
Definition T32CZ20_i2c.h:316
uint32_t count_rx_under
Definition T32CZ20_i2c.h:300
uint32_t write_exit_on_int_status
Definition T32CZ20_i2c.h:312
uint32_t count_rx_finish
Definition T32CM11_i2c.h:306
Definition T32CM11_i2c.h:250
This is the common include file for the Trident HAL GPIO Driver.