mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
board/nucleo-l031k6: Add i2c to periph_conf
This commit is contained in:
parent
a10c3f09a4
commit
d6b6b7a529
@ -3,6 +3,7 @@ CPU_MODEL = stm32l031k6
|
||||
|
||||
# Put defined MCU peripherals here (in alphabetical order)
|
||||
FEATURES_PROVIDED += periph_adc
|
||||
FEATURES_PROVIDED += periph_i2c
|
||||
FEATURES_PROVIDED += periph_pwm
|
||||
FEATURES_PROVIDED += periph_rtc
|
||||
FEATURES_PROVIDED += periph_rtt
|
||||
|
@ -127,6 +127,29 @@ static const spi_conf_t spi_config[] = {
|
||||
#define ADC_NUMOF (7U)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name I2C configuration
|
||||
* @{
|
||||
*/
|
||||
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_AF1,
|
||||
.sda_af = GPIO_AF1,
|
||||
.bus = APB1,
|
||||
.rcc_mask = RCC_APB1ENR_I2C1EN,
|
||||
.irqn = I2C1_IRQn
|
||||
}
|
||||
};
|
||||
|
||||
#define I2C_0_ISR isr_i2c1
|
||||
|
||||
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user