The I2C data reading function has ACK. I don't want to have ACK just like writing function.

chencang
Posts: 4
Joined: Fri Feb 22, 2019 2:54 pm

The I2C data reading function has ACK. I don't want to have ACK just like writing function.

Postby chencang » Thu Feb 28, 2019 4:27 pm

The I2C data reading function has ACK. I don't want to have ACK just like writing function. How to do it, thank you!

esp_err_t i2c_master_read_byte(i2c_cmd_handle_t cmd_handle, uint8_t* data, i2c_ack_type_t ack);

esp_err_t i2c_master_write(i2c_cmd_handle_t cmd_handle, uint8_t* data, size_t data_len, bool ack_en);

ESP_houwenxiang
Posts: 118
Joined: Tue Jun 26, 2018 3:09 am

Re: The I2C data reading function has ACK. I don't want to have ACK just like writing function.

Postby ESP_houwenxiang » Mon Mar 04, 2019 1:17 pm

chencang wrote:
Thu Feb 28, 2019 4:27 pm
The I2C data reading function has ACK. I don't want to have ACK just like writing function. How to do it, thank you!

esp_err_t i2c_master_read_byte(i2c_cmd_handle_t cmd_handle, uint8_t* data, i2c_ack_type_t ack);

esp_err_t i2c_master_write(i2c_cmd_handle_t cmd_handle, uint8_t* data, size_t data_len, bool ack_en);
Hi, chencang

The ack type you can use "I2C_MASTER_NACK"
wookooho

Who is online

Users browsing this forum: No registered users and 3 guests