This commit is contained in:
2024-07-10 10:26:02 -04:00
parent 4989f13a31
commit 7aaccd79af

View File

@@ -33,7 +33,7 @@ static const char *TAG = "i2c-simple-example";
#define I2C_MASTER_SCL_IO CONFIG_I2C_MASTER_SCL /*!< GPIO number used for I2C master clock */ #define I2C_MASTER_SCL_IO CONFIG_I2C_MASTER_SCL /*!< GPIO number used for I2C master clock */
#define I2C_MASTER_SDA_IO CONFIG_I2C_MASTER_SDA /*!< GPIO number used for I2C master data */ #define I2C_MASTER_SDA_IO CONFIG_I2C_MASTER_SDA /*!< GPIO number used for I2C master data */
#define I2C_MASTER_NUM 0 /*!< I2C master i2c port number, the number of i2c peripheral interfaces available will depend on the chip */ #define I2C_MASTER_NUM I2C_NUM_0 /*!< I2C master i2c port number, the number of i2c peripheral interfaces available will depend on the chip */
#define I2C_MASTER_FREQ_HZ 400000 /*!< I2C master clock frequency */ #define I2C_MASTER_FREQ_HZ 400000 /*!< I2C master clock frequency */
#define I2C_MASTER_TX_BUF_DISABLE 0 /*!< I2C master doesn't need buffer */ #define I2C_MASTER_TX_BUF_DISABLE 0 /*!< I2C master doesn't need buffer */
#define I2C_MASTER_RX_BUF_DISABLE 0 /*!< I2C master doesn't need buffer */ #define I2C_MASTER_RX_BUF_DISABLE 0 /*!< I2C master doesn't need buffer */
@@ -41,6 +41,8 @@ static const char *TAG = "i2c-simple-example";
#define I2C_ACKS 0x1 #define I2C_ACKS 0x1
#define I2C_ACKM 0x0 #define I2C_ACKM 0x0
#define I2C_NOACKM 0x1 // I2C NACK value #define I2C_NOACKM 0x1 // I2C NACK value
#define I2C_WRITE_BIT I2C_MASTER_WRITE
#define I2C_RED_BIT I2C_MASTER_READ
#define MPU9250_SENSOR_ADDR 0x76 /*!< Slave address of the MPU9250 sensor */ #define MPU9250_SENSOR_ADDR 0x76 /*!< Slave address of the MPU9250 sensor */
#define MPU9250_WHO_AM_I_REG_ADDR 0xD0 /*!< Register addresses of the "who am I" register */ #define MPU9250_WHO_AM_I_REG_ADDR 0xD0 /*!< Register addresses of the "who am I" register */