Espressif ESP32-S2 Programming Manual page 294

Table of Contents

Advertisement

Chapter 2. API Reference
a) Start bit -
i2c_master_start()
b) Slave address - i2c_master_write_byte(). The single byte address is provided as an argument
of this function call.
c) Data - One or more bytes as an argument of
d) Stop bit -
i2c_master_stop()
Both functions
tional argument specifying whether the master should ensure that it has received the ACK bit.
2. Trigger the execution of the command link by I2C controller by calling i2c_master_cmd_begin().
Once the execution is triggered, the command link cannot be modified.
3. After the commands are transmitted, release the resources used by the command link by calling
i2c_cmd_link_delete().
Master Read
The example below shows how to build a command link for an I2C master to read n bytes from a
slave.
Compared to writing data, the command link is populated in Step 4 not with i2c_master_write... func-
tions but with
i2c_master_read_byte()
configured so that the master does not provide the ACK bit.
Espressif Systems
Fig. 5: I2C command link - master write example
i2c_master_write_byte()
Fig. 6: I2C command link - master read example
and / or i2c_master_read(). Also, the last read in Step 5 is
Submit Document Feedback
i2c_master_write()
and
i2c_master_write()
283
have an addi-
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32-S2 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents

Save PDF