From 0d0e2851f3f287ed178a908a33eb873161317770 Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Wed, 12 May 2021 20:12:23 +0300 Subject: [PATCH] Access ESP32-S3 I2C FIFO using 32bits I2C FIFO on ESP32-S3 (and others) MUST be read/written 32bits at a time. --- components/hal/esp32s3/include/hal/i2c_ll.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/hal/esp32s3/include/hal/i2c_ll.h b/components/hal/esp32s3/include/hal/i2c_ll.h index 877a916130..999dd6d308 100644 --- a/components/hal/esp32s3/include/hal/i2c_ll.h +++ b/components/hal/esp32s3/include/hal/i2c_ll.h @@ -571,7 +571,7 @@ static inline void i2c_ll_get_scl_timing(i2c_dev_t *hw, int *high_period, int *l static inline void i2c_ll_write_txfifo(i2c_dev_t *hw, uint8_t *ptr, uint8_t len) { for (int i = 0; i< len; i++) { - hw->fifo_data.data = ptr[i]; + hw->fifo_data.val = ptr[i]; } } @@ -587,7 +587,7 @@ static inline void i2c_ll_write_txfifo(i2c_dev_t *hw, uint8_t *ptr, uint8_t len) static inline void i2c_ll_read_rxfifo(i2c_dev_t *hw, uint8_t *ptr, uint8_t len) { for(int i = 0; i < len; i++) { - ptr[i] = hw->fifo_data.data; + ptr[i] = hw->fifo_data.val; } }