diff --git a/boards/msbiot/include/periph_conf.h b/boards/msbiot/include/periph_conf.h index fc93e33f6e8fd6fd7dcaae9be899ca6dd062a52d..b083dbc0bb8b58c60e83e294b31bb33979ca862c 100644 --- a/boards/msbiot/include/periph_conf.h +++ b/boards/msbiot/include/periph_conf.h @@ -186,28 +186,25 @@ static const spi_conf_t spi_config[] = { * @name I2C configuration * @{ */ -#define I2C_NUMOF (1U) -#define I2C_0_EN 1 -#define I2C_IRQ_PRIO 1 -#define I2C_APBCLK (CLOCK_APB1) - -/* I2C 0 device configuration */ -#define I2C_0_DEV I2C1 -#define I2C_0_CLKEN() (periph_clk_en(APB1, RCC_APB1ENR_I2C1EN)) -#define I2C_0_CLKDIS() (periph_clk_dis(APB1, RCC_APB1ENR_I2C1EN)) -#define I2C_0_EVT_IRQ I2C1_EV_IRQn -#define I2C_0_EVT_ISR isr_i2c1_ev -#define I2C_0_ERR_IRQ I2C1_ER_IRQn -#define I2C_0_ERR_ISR isr_i2c1_er -/* I2C 0 pin configuration */ -#define I2C_0_SCL_PORT GPIOB -#define I2C_0_SCL_PIN 6 -#define I2C_0_SCL_AF 4 -#define I2C_0_SCL_CLKEN() (periph_clk_en(AHB1, RCC_AHB1ENR_GPIOBEN)) -#define I2C_0_SDA_PORT GPIOB -#define I2C_0_SDA_PIN 7 -#define I2C_0_SDA_AF 4 -#define I2C_0_SDA_CLKEN() (periph_clk_en(AHB1, RCC_AHB1ENR_GPIOBEN)) +static const i2c_conf_t i2c_config[] = { + { + .dev = I2C1, + .speed = I2C_SPEED_NORMAL, + .scl_pin = GPIO_PIN(PORT_B, 6), + .sda_pin = GPIO_PIN(PORT_B, 7), + .scl_af = GPIO_AF4, + .sda_af = GPIO_AF4, + .bus = APB1, + .rcc_mask = RCC_APB1ENR_I2C1EN, + .clk = CLOCK_APB1, + .irqn = I2C1_EV_IRQn + } +}; + +#define I2C_0_ISR isr_i2c1_ev + +#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0])) +/** @} */ #ifdef __cplusplus } diff --git a/boards/nucleo-f401re/include/periph_conf.h b/boards/nucleo-f401re/include/periph_conf.h index 3069ee9e33e3b4777bf4151a40c47dad208386e5..322a6c753f3ee4b26ef23fa94fe39fb662629f42 100644 --- a/boards/nucleo-f401re/include/periph_conf.h +++ b/boards/nucleo-f401re/include/periph_conf.h @@ -254,28 +254,24 @@ static const spi_conf_t spi_config[] = { * @name I2C configuration * @{ */ -#define I2C_NUMOF (1U) -#define I2C_0_EN 1 -#define I2C_IRQ_PRIO 1 -#define I2C_APBCLK (CLOCK_APB1) +static const i2c_conf_t i2c_config[] = { + { + .dev = I2C1, + .speed = I2C_SPEED_NORMAL, + .scl_pin = GPIO_PIN(PORT_B, 8), + .sda_pin = GPIO_PIN(PORT_B, 9), + .scl_af = GPIO_AF4, + .sda_af = GPIO_AF4, + .bus = APB1, + .rcc_mask = RCC_APB1ENR_I2C1EN, + .clk = CLOCK_APB1, + .irqn = I2C1_EV_IRQn + } +}; + +#define I2C_0_ISR isr_i2c1_ev -/* I2C 0 device configuration */ -#define I2C_0_DEV I2C1 -#define I2C_0_CLKEN() (periph_clk_en(APB1, RCC_APB1ENR_I2C1EN)) -#define I2C_0_CLKDIS() (periph_clk_dis(APB1, RCC_APB1ENR_I2C1EN)) -#define I2C_0_EVT_IRQ I2C1_EV_IRQn -#define I2C_0_EVT_ISR isr_i2c1_ev -#define I2C_0_ERR_IRQ I2C1_ER_IRQn -#define I2C_0_ERR_ISR isr_i2c1_er -/* I2C 0 pin configuration */ -#define I2C_0_SCL_PORT GPIOB -#define I2C_0_SCL_PIN 8 -#define I2C_0_SCL_AF 4 -#define I2C_0_SCL_CLKEN() (periph_clk_en(AHB1, RCC_AHB1ENR_GPIOBEN)) -#define I2C_0_SDA_PORT GPIOB -#define I2C_0_SDA_PIN 9 -#define I2C_0_SDA_AF 4 -#define I2C_0_SDA_CLKEN() (periph_clk_en(AHB1, RCC_AHB1ENR_GPIOBEN)) +#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0])) /** @} */ /** diff --git a/boards/nucleo-f410rb/include/periph_conf.h b/boards/nucleo-f410rb/include/periph_conf.h index bc67feb4c00bfb8ceec4e5d3ce4e409a23ebf424..605212d4c313dd14dae65756ed9dd133ba01e2ba 100644 --- a/boards/nucleo-f410rb/include/periph_conf.h +++ b/boards/nucleo-f410rb/include/periph_conf.h @@ -166,28 +166,24 @@ static const spi_conf_t spi_config[] = { * @name I2C configuration * @{ */ -#define I2C_NUMOF (1U) -#define I2C_0_EN 1 -#define I2C_IRQ_PRIO 1 -#define I2C_APBCLK (CLOCK_APB1) - -/* I2C 0 device configuration */ -#define I2C_0_DEV I2C1 -#define I2C_0_CLKEN() (RCC->APB1ENR |= RCC_APB1ENR_I2C1EN) -#define I2C_0_CLKDIS() (RCC->APB1ENR &= ~(RCC_APB1ENR_I2C1EN)) -#define I2C_0_EVT_IRQ I2C1_EV_IRQn -#define I2C_0_EVT_ISR isr_i2c1_ev -#define I2C_0_ERR_IRQ I2C1_ER_IRQn -#define I2C_0_ERR_ISR isr_i2c1_er -/* I2C 0 pin configuration */ -#define I2C_0_SCL_PORT GPIOB -#define I2C_0_SCL_PIN 8 -#define I2C_0_SCL_AF 4 -#define I2C_0_SCL_CLKEN() (RCC->AHB1ENR |= RCC_AHB1ENR_GPIOBEN) -#define I2C_0_SDA_PORT GPIOB -#define I2C_0_SDA_PIN 9 -#define I2C_0_SDA_AF 4 -#define I2C_0_SDA_CLKEN() (RCC->AHB1ENR |= RCC_AHB1ENR_GPIOBEN) +static const i2c_conf_t i2c_config[] = { + { + .dev = I2C1, + .speed = I2C_SPEED_NORMAL, + .scl_pin = GPIO_PIN(PORT_B, 8), + .sda_pin = GPIO_PIN(PORT_B, 9), + .scl_af = GPIO_AF4, + .sda_af = GPIO_AF4, + .bus = APB1, + .rcc_mask = RCC_APB1ENR_I2C1EN, + .clk = CLOCK_APB1, + .irqn = I2C1_EV_IRQn + } +}; + +#define I2C_0_ISR isr_i2c1_ev + +#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0])) /** @} */ /** diff --git a/boards/nucleo-f411re/include/periph_conf.h b/boards/nucleo-f411re/include/periph_conf.h index 60e7fa08a8c42c5d3c65f67b0ac7c30223b1190a..49c0283071bf80de8f034b689cd21e19e4b2f814 100644 --- a/boards/nucleo-f411re/include/periph_conf.h +++ b/boards/nucleo-f411re/include/periph_conf.h @@ -212,28 +212,24 @@ static const spi_conf_t spi_config[] = { * @name I2C configuration * @{ */ -#define I2C_NUMOF (1U) -#define I2C_0_EN 1 -#define I2C_IRQ_PRIO 1 -#define I2C_APBCLK (CLOCK_APB1) +static const i2c_conf_t i2c_config[] = { + { + .dev = I2C1, + .speed = I2C_SPEED_NORMAL, + .scl_pin = GPIO_PIN(PORT_B, 8), + .sda_pin = GPIO_PIN(PORT_B, 9), + .scl_af = GPIO_AF4, + .sda_af = GPIO_AF4, + .bus = APB1, + .rcc_mask = RCC_APB1ENR_I2C1EN, + .clk = CLOCK_APB1, + .irqn = I2C1_EV_IRQn + } +}; + +#define I2C_0_ISR isr_i2c1_ev -/* I2C 0 device configuration */ -#define I2C_0_DEV I2C1 -#define I2C_0_CLKEN() (RCC->APB1ENR |= RCC_APB1ENR_I2C1EN) -#define I2C_0_CLKDIS() (RCC->APB1ENR &= ~(RCC_APB1ENR_I2C1EN)) -#define I2C_0_EVT_IRQ I2C1_EV_IRQn -#define I2C_0_EVT_ISR isr_i2c1_ev -#define I2C_0_ERR_IRQ I2C1_ER_IRQn -#define I2C_0_ERR_ISR isr_i2c1_er -/* I2C 0 pin configuration */ -#define I2C_0_SCL_PORT GPIOB -#define I2C_0_SCL_PIN 8 -#define I2C_0_SCL_AF 4 -#define I2C_0_SCL_CLKEN() (RCC->AHB1ENR |= RCC_AHB1ENR_GPIOBEN) -#define I2C_0_SDA_PORT GPIOB -#define I2C_0_SDA_PIN 9 -#define I2C_0_SDA_AF 4 -#define I2C_0_SDA_CLKEN() (RCC->AHB1ENR |= RCC_AHB1ENR_GPIOBEN) +#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0])) /** @} */ /** diff --git a/boards/nucleo-f412zg/include/periph_conf.h b/boards/nucleo-f412zg/include/periph_conf.h index 631b18c7d10b5ab2947f5051aa481710a5137d14..968d472b5d4e00a87697aa499a156130bd51faa0 100644 --- a/boards/nucleo-f412zg/include/periph_conf.h +++ b/boards/nucleo-f412zg/include/periph_conf.h @@ -223,28 +223,24 @@ static const spi_conf_t spi_config[] = { * @name I2C configuration * @{ */ -#define I2C_NUMOF (1U) -#define I2C_0_EN 1 -#define I2C_IRQ_PRIO 1 -#define I2C_APBCLK (42000000U) +static const i2c_conf_t i2c_config[] = { + { + .dev = I2C1, + .speed = I2C_SPEED_NORMAL, + .scl_pin = GPIO_PIN(PORT_B, 8), + .sda_pin = GPIO_PIN(PORT_B, 9), + .scl_af = GPIO_AF4, + .sda_af = GPIO_AF4, + .bus = APB1, + .rcc_mask = RCC_APB1ENR_I2C1EN, + .clk = CLOCK_APB1, + .irqn = I2C1_EV_IRQn + } +}; + +#define I2C_0_ISR isr_i2c1_ev -/* I2C 0 device configuration */ -#define I2C_0_DEV I2C1 -#define I2C_0_CLKEN() (periph_clk_en(APB1, RCC_APB1ENR_I2C1EN)) -#define I2C_0_CLKDIS() (periph_clk_dis(APB1, RCC_APB1ENR_I2C1EN)) -#define I2C_0_EVT_IRQ I2C1_EV_IRQn -#define I2C_0_EVT_ISR isr_i2c1_ev -#define I2C_0_ERR_IRQ I2C1_ER_IRQn -#define I2C_0_ERR_ISR isr_i2c1_er -/* I2C 0 pin configuration */ -#define I2C_0_SCL_PORT GPIOB -#define I2C_0_SCL_PIN 8 -#define I2C_0_SCL_AF 4 -#define I2C_0_SCL_CLKEN() (periph_clk_en(AHB1, RCC_AHB1ENR_GPIOBEN)) -#define I2C_0_SDA_PORT GPIOB -#define I2C_0_SDA_PIN 9 -#define I2C_0_SDA_AF 4 -#define I2C_0_SDA_CLKEN() (periph_clk_en(AHB1, RCC_AHB1ENR_GPIOBEN)) +#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0])) /** @} */ /** diff --git a/boards/nucleo-f413zh/include/periph_conf.h b/boards/nucleo-f413zh/include/periph_conf.h index 1f34609f19358b59aacc37a5b2ebcd2948234c13..5a88440574f2a30931fef72b70f7c25d13450b69 100644 --- a/boards/nucleo-f413zh/include/periph_conf.h +++ b/boards/nucleo-f413zh/include/periph_conf.h @@ -252,28 +252,24 @@ static const spi_conf_t spi_config[] = { * @name I2C configuration * @{ */ -#define I2C_NUMOF (1U) -#define I2C_0_EN 1 -#define I2C_IRQ_PRIO 1 -#define I2C_APBCLK (CLOCK_APB1) +static const i2c_conf_t i2c_config[] = { + { + .dev = I2C1, + .speed = I2C_SPEED_NORMAL, + .scl_pin = GPIO_PIN(PORT_B, 8), + .sda_pin = GPIO_PIN(PORT_B, 9), + .scl_af = GPIO_AF4, + .sda_af = GPIO_AF4, + .bus = APB1, + .rcc_mask = RCC_APB1ENR_I2C1EN, + .clk = CLOCK_APB1, + .irqn = I2C1_EV_IRQn + } +}; + +#define I2C_0_ISR isr_i2c1_ev -/* I2C 0 device configuration */ -#define I2C_0_DEV I2C1 -#define I2C_0_CLKEN() (periph_clk_en(APB1, RCC_APB1ENR_I2C1EN)) -#define I2C_0_CLKDIS() (periph_clk_dis(APB1, RCC_APB1ENR_I2C1EN)) -#define I2C_0_EVT_IRQ I2C1_EV_IRQn -#define I2C_0_EVT_ISR isr_i2c1_ev -#define I2C_0_ERR_IRQ I2C1_ER_IRQn -#define I2C_0_ERR_ISR isr_i2c1_er -/* I2C 0 pin configuration */ -#define I2C_0_SCL_PORT GPIOB -#define I2C_0_SCL_PIN 8 -#define I2C_0_SCL_AF 4 -#define I2C_0_SCL_CLKEN() (periph_clk_en(AHB1, RCC_AHB1ENR_GPIOBEN)) -#define I2C_0_SDA_PORT GPIOB -#define I2C_0_SDA_PIN 9 -#define I2C_0_SDA_AF 4 -#define I2C_0_SDA_CLKEN() (periph_clk_en(AHB1, RCC_AHB1ENR_GPIOBEN)) +#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0])) /** @} */ /** diff --git a/boards/nucleo-f429zi/include/periph_conf.h b/boards/nucleo-f429zi/include/periph_conf.h index 281a3b543415032dfe6750a334aed1fa71b9b4ce..9c5387b5155c881f07d2493e3890e2e0544eafdf 100644 --- a/boards/nucleo-f429zi/include/periph_conf.h +++ b/boards/nucleo-f429zi/include/periph_conf.h @@ -161,28 +161,24 @@ static const spi_conf_t spi_config[] = { * @name I2C configuration * @{ */ -#define I2C_NUMOF (1U) -#define I2C_0_EN 1 -#define I2C_IRQ_PRIO 1 -#define I2C_APBCLK (42000000U) - -/* I2C 0 device configuration */ -#define I2C_0_DEV I2C1 -#define I2C_0_CLKEN() (periph_clk_en(APB1, RCC_APB1ENR_I2C1EN)) -#define I2C_0_CLKDIS() (periph_clk_dis(APB1, RCC_APB1ENR_I2C1EN)) -#define I2C_0_EVT_IRQ I2C1_EV_IRQn -#define I2C_0_EVT_ISR isr_i2c1_ev -#define I2C_0_ERR_IRQ I2C1_ER_IRQn -#define I2C_0_ERR_ISR isr_i2c1_er -/* I2C 0 pin configuration */ -#define I2C_0_SCL_PORT GPIOB -#define I2C_0_SCL_PIN 8 -#define I2C_0_SCL_AF 4 -#define I2C_0_SCL_CLKEN() (periph_clk_en(AHB1, RCC_AHB1ENR_GPIOBEN)) -#define I2C_0_SDA_PORT GPIOB -#define I2C_0_SDA_PIN 9 -#define I2C_0_SDA_AF 4 -#define I2C_0_SDA_CLKEN() (periph_clk_en(AHB1, RCC_AHB1ENR_GPIOBEN)) +static const i2c_conf_t i2c_config[] = { + { + .dev = I2C1, + .speed = I2C_SPEED_NORMAL, + .scl_pin = GPIO_PIN(PORT_B, 8), + .sda_pin = GPIO_PIN(PORT_B, 9), + .scl_af = GPIO_AF4, + .sda_af = GPIO_AF4, + .bus = APB1, + .rcc_mask = RCC_APB1ENR_I2C1EN, + .clk = CLOCK_APB1, + .irqn = I2C1_EV_IRQn + } +}; + +#define I2C_0_ISR isr_i2c1_ev + +#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0])) /** @} */ /** diff --git a/boards/nucleo-f446re/include/periph_conf.h b/boards/nucleo-f446re/include/periph_conf.h index 4bd67dc00924a437932dac74ed3e3a80042e7fd4..ca1f2b9e72d92132844074c4fdee6086d8e437e7 100644 --- a/boards/nucleo-f446re/include/periph_conf.h +++ b/boards/nucleo-f446re/include/periph_conf.h @@ -218,28 +218,24 @@ static const spi_conf_t spi_config[] = { * @name I2C configuration * @{ */ -#define I2C_NUMOF (1U) -#define I2C_0_EN 1 -#define I2C_IRQ_PRIO 1 -#define I2C_APBCLK (CLOCK_APB1) +static const i2c_conf_t i2c_config[] = { + { + .dev = I2C1, + .speed = I2C_SPEED_NORMAL, + .scl_pin = GPIO_PIN(PORT_B, 8), + .sda_pin = GPIO_PIN(PORT_B, 9), + .scl_af = GPIO_AF4, + .sda_af = GPIO_AF4, + .bus = APB1, + .rcc_mask = RCC_APB1ENR_I2C1EN, + .clk = CLOCK_APB1, + .irqn = I2C1_EV_IRQn + } +}; + +#define I2C_0_ISR isr_i2c1_ev -/* I2C 0 device configuration */ -#define I2C_0_DEV I2C1 -#define I2C_0_CLKEN() (periph_clk_en(APB1, RCC_APB1ENR_I2C1EN)) -#define I2C_0_CLKDIS() (periph_clk_dis(APB1, RCC_APB1ENR_I2C1EN)) -#define I2C_0_EVT_IRQ I2C1_EV_IRQn -#define I2C_0_EVT_ISR isr_i2c1_ev -#define I2C_0_ERR_IRQ I2C1_ER_IRQn -#define I2C_0_ERR_ISR isr_i2c1_er -/* I2C 0 pin configuration */ -#define I2C_0_SCL_PORT GPIOB -#define I2C_0_SCL_PIN 8 -#define I2C_0_SCL_AF 4 -#define I2C_0_SCL_CLKEN() (periph_clk_en(AHB1, RCC_AHB1ENR_GPIOBEN)) -#define I2C_0_SDA_PORT GPIOB -#define I2C_0_SDA_PIN 9 -#define I2C_0_SDA_AF 4 -#define I2C_0_SDA_CLKEN() (periph_clk_en(AHB1, RCC_AHB1ENR_GPIOBEN)) +#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0])) /** @} */ /** diff --git a/boards/nucleo-f446ze/include/periph_conf.h b/boards/nucleo-f446ze/include/periph_conf.h index 9735453e8aaa3dde270cd0d1662cda5507eea179..ff88e4573df5cbb9931073dda839f64b4285b4fc 100644 --- a/boards/nucleo-f446ze/include/periph_conf.h +++ b/boards/nucleo-f446ze/include/periph_conf.h @@ -161,28 +161,24 @@ static const spi_conf_t spi_config[] = { * @name I2C configuration * @{ */ -#define I2C_NUMOF (1U) -#define I2C_0_EN 1 -#define I2C_IRQ_PRIO 1 -#define I2C_APBCLK (42000000U) - -/* I2C 0 device configuration */ -#define I2C_0_DEV I2C1 -#define I2C_0_CLKEN() (periph_clk_en(APB1, RCC_APB1ENR_I2C1EN)) -#define I2C_0_CLKDIS() (periph_clk_dis(APB1, RCC_APB1ENR_I2C1EN)) -#define I2C_0_EVT_IRQ I2C1_EV_IRQn -#define I2C_0_EVT_ISR isr_i2c1_ev -#define I2C_0_ERR_IRQ I2C1_ER_IRQn -#define I2C_0_ERR_ISR isr_i2c1_er -/* I2C 0 pin configuration */ -#define I2C_0_SCL_PORT GPIOB -#define I2C_0_SCL_PIN 8 -#define I2C_0_SCL_AF 4 -#define I2C_0_SCL_CLKEN() (periph_clk_en(AHB1, RCC_AHB1ENR_GPIOBEN)) -#define I2C_0_SDA_PORT GPIOB -#define I2C_0_SDA_PIN 9 -#define I2C_0_SDA_AF 4 -#define I2C_0_SDA_CLKEN() (periph_clk_en(AHB1, RCC_AHB1ENR_GPIOBEN)) +static const i2c_conf_t i2c_config[] = { + { + .dev = I2C1, + .speed = I2C_SPEED_NORMAL, + .scl_pin = GPIO_PIN(PORT_B, 8), + .sda_pin = GPIO_PIN(PORT_B, 9), + .scl_af = GPIO_AF4, + .sda_af = GPIO_AF4, + .bus = APB1, + .rcc_mask = RCC_APB1ENR_I2C1EN, + .clk = CLOCK_APB1, + .irqn = I2C1_EV_IRQn + } +}; + +#define I2C_0_ISR isr_i2c1_ev + +#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0])) /** @} */ /** diff --git a/boards/stm32f4discovery/include/periph_conf.h b/boards/stm32f4discovery/include/periph_conf.h index 984295c4cb59f73e7ff28eae659a5a231334a688..755e5dc4e4d75c95d5251e7bc0c88e2f5b597315 100644 --- a/boards/stm32f4discovery/include/periph_conf.h +++ b/boards/stm32f4discovery/include/periph_conf.h @@ -191,28 +191,24 @@ static const spi_conf_t spi_config[] = { * @name I2C configuration * @{ */ -#define I2C_NUMOF (1U) -#define I2C_0_EN 1 -#define I2C_IRQ_PRIO 1 -#define I2C_APBCLK (CLOCK_APB1) - -/* I2C 0 device configuration */ -#define I2C_0_DEV I2C1 -#define I2C_0_CLKEN() (periph_clk_en(APB1, RCC_APB1ENR_I2C1EN)) -#define I2C_0_CLKDIS() (periph_clk_dis(APB1, RCC_APB1ENR_I2C1EN)) -#define I2C_0_EVT_IRQ I2C1_EV_IRQn -#define I2C_0_EVT_ISR isr_i2c1_ev -#define I2C_0_ERR_IRQ I2C1_ER_IRQn -#define I2C_0_ERR_ISR isr_i2c1_er -/* I2C 0 pin configuration */ -#define I2C_0_SCL_PORT GPIOB -#define I2C_0_SCL_PIN 6 -#define I2C_0_SCL_AF 4 -#define I2C_0_SCL_CLKEN() (periph_clk_en(AHB1, RCC_AHB1ENR_GPIOBEN)) -#define I2C_0_SDA_PORT GPIOB -#define I2C_0_SDA_PIN 7 -#define I2C_0_SDA_AF 4 -#define I2C_0_SDA_CLKEN() (periph_clk_en(AHB1, RCC_AHB1ENR_GPIOBEN)) +static const i2c_conf_t i2c_config[] = { + { + .dev = I2C1, + .speed = I2C_SPEED_NORMAL, + .scl_pin = GPIO_PIN(PORT_B, 6), + .sda_pin = GPIO_PIN(PORT_B, 7), + .scl_af = GPIO_AF4, + .sda_af = GPIO_AF4, + .bus = APB1, + .rcc_mask = RCC_APB1ENR_I2C1EN, + .clk = CLOCK_APB1, + .irqn = I2C1_EV_IRQn + } +}; + +#define I2C_0_ISR isr_i2c1_ev + +#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0])) /** @} */ #ifdef __cplusplus