mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
fix(i2c): read write FIFO memory by volatile
This commit is contained in:
@@ -1,16 +1,8 @@
|
||||
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _SOC_I2C_STRUCT_H_
|
||||
#define _SOC_I2C_STRUCT_H_
|
||||
|
||||
@@ -363,39 +355,8 @@ typedef volatile struct i2c_dev_s {
|
||||
uint32_t reserved_f4;
|
||||
uint32_t date;
|
||||
uint32_t reserved_fc;
|
||||
uint32_t txfifo_start_addr;
|
||||
uint32_t reserved_104;
|
||||
uint32_t reserved_108;
|
||||
uint32_t reserved_10c;
|
||||
uint32_t reserved_110;
|
||||
uint32_t reserved_114;
|
||||
uint32_t reserved_118;
|
||||
uint32_t reserved_11c;
|
||||
uint32_t reserved_120;
|
||||
uint32_t reserved_124;
|
||||
uint32_t reserved_128;
|
||||
uint32_t reserved_12c;
|
||||
uint32_t reserved_130;
|
||||
uint32_t reserved_134;
|
||||
uint32_t reserved_138;
|
||||
uint32_t reserved_13c;
|
||||
uint32_t reserved_140;
|
||||
uint32_t reserved_144;
|
||||
uint32_t reserved_148;
|
||||
uint32_t reserved_14c;
|
||||
uint32_t reserved_150;
|
||||
uint32_t reserved_154;
|
||||
uint32_t reserved_158;
|
||||
uint32_t reserved_15c;
|
||||
uint32_t reserved_160;
|
||||
uint32_t reserved_164;
|
||||
uint32_t reserved_168;
|
||||
uint32_t reserved_16c;
|
||||
uint32_t reserved_170;
|
||||
uint32_t reserved_174;
|
||||
uint32_t reserved_178;
|
||||
uint32_t reserved_17c;
|
||||
uint32_t rxfifo_start_addr;
|
||||
uint32_t txfifo_mem[32];
|
||||
uint32_t rxfifo_mem[32];
|
||||
} i2c_dev_t;
|
||||
extern i2c_dev_t I2C0;
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -948,34 +948,6 @@ typedef union {
|
||||
} i2c_date_reg_t;
|
||||
|
||||
|
||||
/** Group: Address register */
|
||||
/** Type of txfifo_start_addr register
|
||||
* I2C TXFIFO base address register
|
||||
*/
|
||||
typedef union {
|
||||
struct {
|
||||
/** txfifo_start_addr : HRO; bitpos: [31:0]; default: 0;
|
||||
* This is the I2C txfifo first address.
|
||||
*/
|
||||
uint32_t txfifo_start_addr:32;
|
||||
};
|
||||
uint32_t val;
|
||||
} i2c_txfifo_start_addr_reg_t;
|
||||
|
||||
/** Type of rxfifo_start_addr register
|
||||
* I2C RXFIFO base address register
|
||||
*/
|
||||
typedef union {
|
||||
struct {
|
||||
/** rxfifo_start_addr : HRO; bitpos: [31:0]; default: 0;
|
||||
* This is the I2C rxfifo first address.
|
||||
*/
|
||||
uint32_t rxfifo_start_addr:32;
|
||||
};
|
||||
uint32_t val;
|
||||
} i2c_rxfifo_start_addr_reg_t;
|
||||
|
||||
|
||||
typedef struct i2c_dev_t {
|
||||
volatile i2c_scl_low_period_reg_t scl_low_period;
|
||||
volatile i2c_ctr_reg_t ctr;
|
||||
@@ -1007,16 +979,15 @@ typedef struct i2c_dev_t {
|
||||
uint32_t reserved_088[28];
|
||||
volatile i2c_date_reg_t date;
|
||||
uint32_t reserved_0fc;
|
||||
volatile i2c_txfifo_start_addr_reg_t txfifo_start_addr;
|
||||
uint32_t reserved_104[31];
|
||||
volatile i2c_rxfifo_start_addr_reg_t rxfifo_start_addr;
|
||||
volatile uint32_t txfifo_mem[32];
|
||||
volatile uint32_t rxfifo_mem[32];
|
||||
} i2c_dev_t;
|
||||
|
||||
extern i2c_dev_t I2C0;
|
||||
extern i2c_dev_t LP_I2C;
|
||||
|
||||
#ifndef __cplusplus
|
||||
_Static_assert(sizeof(i2c_dev_t) == 0x184, "Invalid size of i2c_dev_t structure");
|
||||
_Static_assert(sizeof(i2c_dev_t) == 0x200, "Invalid size of i2c_dev_t structure");
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -948,34 +948,6 @@ typedef union {
|
||||
} i2c_date_reg_t;
|
||||
|
||||
|
||||
/** Group: Address register */
|
||||
/** Type of txfifo_start_addr register
|
||||
* I2C TXFIFO base address register
|
||||
*/
|
||||
typedef union {
|
||||
struct {
|
||||
/** txfifo_start_addr : HRO; bitpos: [31:0]; default: 0;
|
||||
* This is the I2C txfifo first address.
|
||||
*/
|
||||
uint32_t txfifo_start_addr:32;
|
||||
};
|
||||
uint32_t val;
|
||||
} i2c_txfifo_start_addr_reg_t;
|
||||
|
||||
/** Type of rxfifo_start_addr register
|
||||
* I2C RXFIFO base address register
|
||||
*/
|
||||
typedef union {
|
||||
struct {
|
||||
/** rxfifo_start_addr : HRO; bitpos: [31:0]; default: 0;
|
||||
* This is the I2C rxfifo first address.
|
||||
*/
|
||||
uint32_t rxfifo_start_addr:32;
|
||||
};
|
||||
uint32_t val;
|
||||
} i2c_rxfifo_start_addr_reg_t;
|
||||
|
||||
|
||||
typedef struct i2c_dev_t {
|
||||
volatile i2c_scl_low_period_reg_t scl_low_period;
|
||||
volatile i2c_ctr_reg_t ctr;
|
||||
@@ -1007,16 +979,15 @@ typedef struct i2c_dev_t {
|
||||
uint32_t reserved_088[28];
|
||||
volatile i2c_date_reg_t date;
|
||||
uint32_t reserved_0fc;
|
||||
volatile i2c_txfifo_start_addr_reg_t txfifo_start_addr;
|
||||
uint32_t reserved_104[31];
|
||||
volatile i2c_rxfifo_start_addr_reg_t rxfifo_start_addr;
|
||||
volatile uint32_t txfifo_mem[32];
|
||||
volatile uint32_t rxfifo_mem[32];
|
||||
} i2c_dev_t;
|
||||
|
||||
extern i2c_dev_t I2C0;
|
||||
extern i2c_dev_t I2C1;
|
||||
|
||||
#ifndef __cplusplus
|
||||
_Static_assert(sizeof(i2c_dev_t) == 0x184, "Invalid size of i2c_dev_t structure");
|
||||
_Static_assert(sizeof(i2c_dev_t) == 0x200, "Invalid size of i2c_dev_t structure");
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -1047,34 +1047,6 @@ typedef union {
|
||||
} i2c_date_reg_t;
|
||||
|
||||
|
||||
/** Group: Address register */
|
||||
/** Type of txfifo_start_addr register
|
||||
* I2C TXFIFO base address register
|
||||
*/
|
||||
typedef union {
|
||||
struct {
|
||||
/** txfifo_start_addr : HRO; bitpos: [31:0]; default: 0;
|
||||
* Represents the I2C txfifo first address.
|
||||
*/
|
||||
uint32_t txfifo_start_addr:32;
|
||||
};
|
||||
uint32_t val;
|
||||
} i2c_txfifo_start_addr_reg_t;
|
||||
|
||||
/** Type of rxfifo_start_addr register
|
||||
* I2C RXFIFO base address register
|
||||
*/
|
||||
typedef union {
|
||||
struct {
|
||||
/** rxfifo_start_addr : HRO; bitpos: [31:0]; default: 0;
|
||||
* Represents the I2C rxfifo first address.
|
||||
*/
|
||||
uint32_t rxfifo_start_addr:32;
|
||||
};
|
||||
uint32_t val;
|
||||
} i2c_rxfifo_start_addr_reg_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
volatile i2c_scl_low_period_reg_t scl_low_period;
|
||||
volatile i2c_ctr_reg_t ctr;
|
||||
@@ -1106,9 +1078,8 @@ typedef struct {
|
||||
uint32_t reserved_088[28];
|
||||
volatile i2c_date_reg_t date;
|
||||
uint32_t reserved_0fc;
|
||||
volatile i2c_txfifo_start_addr_reg_t txfifo_start_addr;
|
||||
uint32_t reserved_104[31];
|
||||
volatile i2c_rxfifo_start_addr_reg_t rxfifo_start_addr;
|
||||
volatile uint32_t txfifo_mem[32];
|
||||
volatile uint32_t rxfifo_mem[32];
|
||||
} i2c_dev_t;
|
||||
|
||||
extern i2c_dev_t I2C0;
|
||||
@@ -1116,7 +1087,7 @@ extern i2c_dev_t I2C1;
|
||||
extern i2c_dev_t LP_I2C;
|
||||
|
||||
#ifndef __cplusplus
|
||||
_Static_assert(sizeof(i2c_dev_t) == 0x184, "Invalid size of i2c_dev_t structure");
|
||||
_Static_assert(sizeof(i2c_dev_t) == 0x200, "Invalid size of i2c_dev_t structure");
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -941,35 +941,6 @@ typedef union {
|
||||
uint32_t val;
|
||||
} i2c_date_reg_t;
|
||||
|
||||
|
||||
/** Group: Address register */
|
||||
/** Type of txfifo_start_addr register
|
||||
* I2C TXFIFO base address register
|
||||
*/
|
||||
typedef union {
|
||||
struct {
|
||||
/** txfifo_start_addr : RO; bitpos: [31:0]; default: 0;
|
||||
* This is the I2C txfifo first address.
|
||||
*/
|
||||
uint32_t txfifo_start_addr:32;
|
||||
};
|
||||
uint32_t val;
|
||||
} i2c_txfifo_start_addr_reg_t;
|
||||
|
||||
/** Type of rxfifo_start_addr register
|
||||
* I2C RXFIFO base address register
|
||||
*/
|
||||
typedef union {
|
||||
struct {
|
||||
/** rxfifo_start_addr : RO; bitpos: [31:0]; default: 0;
|
||||
* This is the I2C rxfifo first address.
|
||||
*/
|
||||
uint32_t rxfifo_start_addr:32;
|
||||
};
|
||||
uint32_t val;
|
||||
} i2c_rxfifo_start_addr_reg_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
volatile i2c_scl_low_period_reg_t scl_low_period;
|
||||
volatile i2c_ctr_reg_t ctr;
|
||||
@@ -1001,16 +972,15 @@ typedef struct {
|
||||
uint32_t reserved_088[28];
|
||||
volatile i2c_date_reg_t date;
|
||||
uint32_t reserved_0fc;
|
||||
volatile i2c_txfifo_start_addr_reg_t txfifo_start_addr;
|
||||
uint32_t reserved_104[31];
|
||||
volatile i2c_rxfifo_start_addr_reg_t rxfifo_start_addr;
|
||||
volatile uint32_t txfifo_mem[32];
|
||||
volatile uint32_t rxfifo_mem[32];
|
||||
} i2c_dev_t;
|
||||
|
||||
extern i2c_dev_t I2C0;
|
||||
extern i2c_dev_t I2C1;
|
||||
|
||||
#ifndef __cplusplus
|
||||
_Static_assert(sizeof(i2c_dev_t) == 0x184, "Invalid size of i2c_dev_t structure");
|
||||
_Static_assert(sizeof(i2c_dev_t) == 0x200, "Invalid size of i2c_dev_t structure");
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user