27
27
#define I2C_SCL_IDX (p ) ((p==0)?I2CEXT0_SCL_OUT_IDX:((p==1)?I2CEXT1_SCL_OUT_IDX:0))
28
28
#define I2C_SDA_IDX (p ) ((p==0)?I2CEXT0_SDA_OUT_IDX:((p==1)?I2CEXT1_SDA_OUT_IDX:0))
29
29
30
+ #define DR_REG_I2C_EXT_BASE_FIXED 0x60013000
31
+ #define DR_REG_I2C1_EXT_BASE_FIXED 0x60027000
30
32
31
33
struct i2c_struct_t {
32
34
i2c_dev_t * dev ;
@@ -49,16 +51,16 @@ enum {
49
51
#define I2C_MUTEX_UNLOCK ()
50
52
51
53
static i2c_t _i2c_bus_array [2 ] = {
52
- {(volatile i2c_dev_t * )(DR_REG_I2C_EXT_BASE ), 0 },
53
- {(volatile i2c_dev_t * )(DR_REG_I2C1_EXT_BASE ), 1 }
54
+ {(volatile i2c_dev_t * )(DR_REG_I2C_EXT_BASE_FIXED ), 0 },
55
+ {(volatile i2c_dev_t * )(DR_REG_I2C1_EXT_BASE_FIXED ), 1 }
54
56
};
55
57
#else
56
58
#define I2C_MUTEX_LOCK () do {} while (xSemaphoreTake(i2c->lock, portMAX_DELAY) != pdPASS)
57
59
#define I2C_MUTEX_UNLOCK () xSemaphoreGive(i2c->lock)
58
60
59
61
static i2c_t _i2c_bus_array [2 ] = {
60
- {(volatile i2c_dev_t * )(DR_REG_I2C_EXT_BASE ), NULL , 0 },
61
- {(volatile i2c_dev_t * )(DR_REG_I2C1_EXT_BASE ), NULL , 1 }
62
+ {(volatile i2c_dev_t * )(DR_REG_I2C_EXT_BASE_FIXED ), NULL , 0 },
63
+ {(volatile i2c_dev_t * )(DR_REG_I2C1_EXT_BASE_FIXED ), NULL , 1 }
62
64
};
63
65
#endif
64
66
0 commit comments