boards/nucleo-f070: add i2c configuration for i2c
This commit is contained in:
parent
634d9f6d68
commit
22ff7d7af2
@ -1,6 +1,7 @@
|
||||
# Put defined MCU peripherals here (in alphabetical order)
|
||||
FEATURES_PROVIDED += periph_adc
|
||||
FEATURES_PROVIDED += periph_gpio
|
||||
FEATURES_PROVIDED += periph_i2c
|
||||
FEATURES_PROVIDED += periph_pwm
|
||||
FEATURES_PROVIDED += periph_rtc
|
||||
FEATURES_PROVIDED += periph_timer
|
||||
|
||||
@ -151,6 +151,30 @@ static const pwm_conf_t pwm_config[] = {
|
||||
#define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name I2C configuration
|
||||
* @{
|
||||
*/
|
||||
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_AF1,
|
||||
.sda_af = GPIO_AF1,
|
||||
.bus = APB1,
|
||||
.rcc_mask = RCC_APB1ENR_I2C1EN,
|
||||
.rcc_sw_mask = RCC_CFGR3_I2C1SW,
|
||||
.irqn = I2C1_IRQn,
|
||||
}
|
||||
};
|
||||
|
||||
#define I2C_0_ISR isr_i2c1
|
||||
|
||||
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name ADC configuration
|
||||
* @{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user