From b3658ad95e893c739abb31b295c7addd8ef39a7b Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Sun, 8 Dec 2019 12:15:06 +0100 Subject: [PATCH] boards/hifive1b: provide i2c configuration --- boards/hifive1b/Makefile.features | 2 +- boards/hifive1b/include/periph_conf.h | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/boards/hifive1b/Makefile.features b/boards/hifive1b/Makefile.features index 9ab282f177..69b658fd31 100644 --- a/boards/hifive1b/Makefile.features +++ b/boards/hifive1b/Makefile.features @@ -2,7 +2,7 @@ CPU = fe310 CPU_MODEL = fe310_g002 # Put defined MCU peripherals here (in alphabetical order) -#FEATURES_PROVIDED += periph_i2c +FEATURES_PROVIDED += periph_i2c #FEATURES_PROVIDED += periph_pwm FEATURES_PROVIDED += periph_rtc FEATURES_PROVIDED += periph_rtt diff --git a/boards/hifive1b/include/periph_conf.h b/boards/hifive1b/include/periph_conf.h index dd5679a514..7217102fef 100644 --- a/boards/hifive1b/include/periph_conf.h +++ b/boards/hifive1b/include/periph_conf.h @@ -129,6 +129,22 @@ static const uart_conf_t uart_config[] = { #define PWM_NUMOF (3) /** @} */ +/** + * @name I2C configuration + * @{ + */ +static const i2c_conf_t i2c_config[] = { + { + .addr = I2C0_CTRL_ADDR, + .scl = GPIO_PIN(0, 13), + .sda = GPIO_PIN(0, 12), + .speed = I2C_SPEED_NORMAL, + }, +}; + +#define I2C_NUMOF ARRAY_SIZE(i2c_config) +/** @} */ + #ifdef __cplusplus } #endif