diff --git a/boards/cc2538dk/include/periph_conf.h b/boards/cc2538dk/include/periph_conf.h index a0a744fe2768889ecc9ec16c2be168753f393bdd..4f020a128f81cab8b2c4957574edbefe834ac100 100644 --- a/boards/cc2538dk/include/periph_conf.h +++ b/boards/cc2538dk/include/periph_conf.h @@ -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])) /** @} */ /** diff --git a/boards/openmote-cc2538/include/periph_conf.h b/boards/openmote-cc2538/include/periph_conf.h index c63c52c1223fec3cda76f934427b9c1af527fb48..912c8bbf5a7d686fcfcc3c7961a692b327633f08 100644 --- a/boards/openmote-cc2538/include/periph_conf.h +++ b/boards/openmote-cc2538/include/periph_conf.h @@ -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])) /** @} */ /** diff --git a/boards/remote-pa/include/periph_conf.h b/boards/remote-pa/include/periph_conf.h index e3a15a19ec9c536e18d1b7390235372ec805a2b0..c5fe4f3db732a70106371f8779eeeac18176cf26 100644 --- a/boards/remote-pa/include/periph_conf.h +++ b/boards/remote-pa/include/periph_conf.h @@ -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])) /** @} */ /** diff --git a/boards/remote-reva/include/periph_conf.h b/boards/remote-reva/include/periph_conf.h index cd1b6e0245f68ad48015728d8e2e13138b59ea97..ebec0f3207a7e31d637276023bf6732609b08031 100644 --- a/boards/remote-reva/include/periph_conf.h +++ b/boards/remote-reva/include/periph_conf.h @@ -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])) /** @} */ /** diff --git a/boards/remote-revb/include/periph_conf.h b/boards/remote-revb/include/periph_conf.h index b5eb53a387287af0b52d4e9fed2fe28dc1433de1..07e6a15479b8610934c48a008fc4d9b3b2351bf8 100644 --- a/boards/remote-revb/include/periph_conf.h +++ b/boards/remote-revb/include/periph_conf.h @@ -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])) /** @} */ /**