Skip to content

Commit

Permalink
boards: fix config of cc2538 boards for new I2C API
Browse files Browse the repository at this point in the history
  • Loading branch information
smlng committed Jun 14, 2018
1 parent 65cd4e1 commit d3e0f91
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 60 deletions.
18 changes: 6 additions & 12 deletions boards/cc2538dk/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,17 @@ static const uart_conf_t uart_config[] = {
* @name I2C configuration
* @{
*/
#define I2C_NUMOF 1
#define I2C_0_EN 1
#define I2C_IRQ_PRIO 1

/* I2C 0 device configuration */
#define I2C_0_DEV 0
#define I2C_0_IRQ I2C_IRQn
#define I2C_0_IRQ_HANDLER isr_i2c
#define I2C_0_SCL_PIN GPIO_PA2 /* SPI_SCK on the SmartRF06 baseboard */
#define I2C_0_SDA_PIN GPIO_PA4 /* SPI_MOSI on the SmartRF06 baseboard */

static const i2c_conf_t i2c_config[I2C_NUMOF] = {
static const i2c_conf_t i2c_config[] = {
{
.scl_pin = GPIO_PA2, /* SPI_SCK on the SmartRF06 baseboard */
.sda_pin = GPIO_PA4, /* SPI_MOSI on the SmartRF06 baseboard */
.speed = I2C_SPEED_FAST, /**< bus speed */
.scl_pin = GPIO_PIN(0, 2), /**< GPIO_PA2, SPI_SCK on SmartRF06 */
.sda_pin = GPIO_PIN(0, 4) /**< GPIO_PA4, SPI_MOSI on SmartRF06 */
},
};

#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
/** @} */

/**
Expand Down
18 changes: 6 additions & 12 deletions boards/openmote-cc2538/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,17 @@ static const uart_conf_t uart_config[] = {
* @name I2C configuration
* @{
*/
#define I2C_NUMOF 1
#define I2C_0_EN 1
#define I2C_IRQ_PRIO 1

/* I2C 0 device configuration */
#define I2C_0_DEV 0
#define I2C_0_IRQ I2C_IRQn
#define I2C_0_IRQ_HANDLER isr_i2c
#define I2C_0_SCL_PIN GPIO_PB3 /* OpenBattery */
#define I2C_0_SDA_PIN GPIO_PB4 /* OpenBattery */

static const i2c_conf_t i2c_config[I2C_NUMOF] = {
static const i2c_conf_t i2c_config[] = {
{
.scl_pin = GPIO_PB3, /* OpenBattery */
.sda_pin = GPIO_PB4, /* OpenBattery */
.speed = I2C_SPEED_FAST, /**< bus speed */
.scl_pin = GPIO_PIN(1, 3), /**< GPIO_PB3, OpenBattery */
.sda_pin = GPIO_PIN(1, 4) /**< GPIO_PB4, OpenBattery */
},
};

#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
/** @} */

/**
Expand Down
18 changes: 6 additions & 12 deletions boards/remote-pa/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,17 @@
* @name I2C configuration
* @{
*/
#define I2C_NUMOF 1
#define I2C_0_EN 1
#define I2C_IRQ_PRIO 1

/* I2C 0 device configuration */
#define I2C_0_DEV 0
#define I2C_0_IRQ I2C_IRQn
#define I2C_0_IRQ_HANDLER isr_i2c
#define I2C_0_SCL_PIN GPIO_PB1
#define I2C_0_SDA_PIN GPIO_PB0

static const i2c_conf_t i2c_config[I2C_NUMOF] = {
static const i2c_conf_t i2c_config[] = {
{
.scl_pin = I2C_0_SCL_PIN,
.sda_pin = I2C_0_SDA_PIN,
.speed = I2C_SPEED_FAST, /**< bus speed */
.scl_pin = GPIO_PIN(1, 1), /**< GPIO_PB1 */
.sda_pin = GPIO_PIN(1, 0) /**< GPIO_PB0 */
},
};

#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
/** @} */

/**
Expand Down
18 changes: 6 additions & 12 deletions boards/remote-reva/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,17 @@
* @name I2C configuration
* @{
*/
#define I2C_NUMOF 1
#define I2C_0_EN 1
#define I2C_IRQ_PRIO 1

/* I2C 0 device configuration */
#define I2C_0_DEV 0
#define I2C_0_IRQ I2C_IRQn
#define I2C_0_IRQ_HANDLER isr_i2c
#define I2C_0_SCL_PIN GPIO_PC3
#define I2C_0_SDA_PIN GPIO_PC2

static const i2c_conf_t i2c_config[I2C_NUMOF] = {
static const i2c_conf_t i2c_config[] = {
{
.scl_pin = I2C_0_SCL_PIN,
.sda_pin = I2C_0_SDA_PIN,
.speed = I2C_SPEED_FAST, /**< bus speed */
.scl_pin = GPIO_PIN(2, 3), /**< GPIO_PC3 */
.sda_pin = GPIO_PIN(2, 2) /**< GPIO_PC2 */
},
};

#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
/** @} */

/**
Expand Down
18 changes: 6 additions & 12 deletions boards/remote-revb/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,17 @@
* @name I2C configuration
* @{
*/
#define I2C_NUMOF 1
#define I2C_0_EN 1
#define I2C_IRQ_PRIO 1

/* I2C 0 device configuration */
#define I2C_0_DEV 0
#define I2C_0_IRQ I2C_IRQn
#define I2C_0_IRQ_HANDLER isr_i2c
#define I2C_0_SCL_PIN GPIO_PC3
#define I2C_0_SDA_PIN GPIO_PC2

static const i2c_conf_t i2c_config[I2C_NUMOF] = {
static const i2c_conf_t i2c_config[] = {
{
.scl_pin = I2C_0_SCL_PIN,
.sda_pin = I2C_0_SDA_PIN,
.speed = I2C_SPEED_FAST, /**< bus speed */
.scl_pin = GPIO_PIN(2, 3), /**< GPIO_PC3 */
.sda_pin = GPIO_PIN(2, 2) /**< GPIO_PC2 */
},
};

#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
/** @} */

/**
Expand Down

0 comments on commit d3e0f91

Please sign in to comment.