Chapter 2. API Reference
to perform a read on an I2C device register, TRANSACTIONS must be at least 2, because the commands
required are the following:
• write device register
• read register content
Signals such as "(repeated) start", "stop", "nack", "ack"shall not be counted.
Type Definitions
typedef void *i2c_cmd_handle_t
I2C command handle
Header File
•
components/hal/include/hal/i2c_types.h
Macros
I2C_CLK_FREQ_MAX
Use the highest speed that is available for the clock source picked by clk_flags.
Type Definitions
typedef int i2c_port_t
I2C port number, can be I2C_NUM_0 ~ (I2C_NUM_MAX-1).
Enumerations
enum i2c_mode_t
Values:
I2C_MODE_SLAVE = 0
I2C slave mode
I2C_MODE_MASTER
I2C master mode
I2C_MODE_MAX
enum i2c_rw_t
Values:
I2C_MASTER_WRITE = 0
I2C write data
I2C_MASTER_READ
I2C read data
enum i2c_trans_mode_t
Values:
I2C_DATA_MODE_MSB_FIRST = 0
I2C data msb first
I2C_DATA_MODE_LSB_FIRST = 1
I2C data lsb first
I2C_DATA_MODE_MAX
enum i2c_addr_mode_t
Values:
I2C_ADDR_BIT_7 = 0
I2C 7bit address for slave mode
Espressif Systems
295
Submit Document Feedback
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?