Skip to content
Snippets Groups Projects
Unverified Commit ad1944a1 authored by Francisco Acosta's avatar Francisco Acosta Committed by GitHub
Browse files

Merge pull request #8635 from aabadie/pr/boards/st-lrwan1-i2c

boards/b-l072z-lrwan1: add I2C configuration
parents 8c632b1b d27de98b
No related branches found
No related tags found
No related merge requests found
# Put defined MCU peripherals here (in alphabetical order) # Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_gpio FEATURES_PROVIDED += periph_gpio
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart FEATURES_PROVIDED += periph_uart
......
...@@ -151,6 +151,32 @@ static const spi_conf_t spi_config[] = { ...@@ -151,6 +151,32 @@ static const spi_conf_t spi_config[] = {
#define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0])) #define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
/** @} */ /** @} */
/**
* @name I2C configuration
* @{
*/
#define I2C_0_EN 1
#define I2C_NUMOF I2C_0_EN
#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_IRQn
#define I2C_0_EVT_ISR isr_i2c1
/* I2C 0 pin configuration */
#define I2C_0_SCL_PORT PORT_B
#define I2C_0_SCL_PIN 8
#define I2C_0_SCL_AF 4
#define I2C_0_SCL_CLKEN() (periph_clk_en(AHB, RCC_IOPENR_GPIOBEN))
#define I2C_0_SDA_PORT PORT_B
#define I2C_0_SDA_PIN 9
#define I2C_0_SDA_AF 4
#define I2C_0_SDA_CLKEN() (periph_clk_en(AHB, RCC_IOPENR_GPIOBEN))
/** @} */
/** /**
* @name ADC configuration * @name ADC configuration
* @{ * @{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment