Skip to content
Snippets Groups Projects
Unverified Commit 0e48bd0d authored by Vincent Dupont's avatar Vincent Dupont Committed by GitHub
Browse files

Merge pull request #9716 from aabadie/b-l475e-iot01-sensors

boards/b-l475e-iot01a: configure second I2C and on-board sensors (lis3mdl, lsm6dsl and hts221)
parents 9bb33b92 ad34cb31
No related branches found
No related tags found
No related merge requests found
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
USEMODULE += hts221
USEMODULE += lis3mdl
USEMODULE += lsm6dsl
endif
......@@ -51,6 +51,28 @@ extern "C" {
*/
#define BTN_B1_PIN GPIO_PIN(PORT_C, 13)
/**
* @name HTS221 temperature/humidity sensor configuration
* @{
*/
#define HTS221_PARAM_I2C I2C_DEV(1)
/** @} */
/**
* @name LIS3MDL 3-axis magnetometer configuration
* @{
*/
#define LIS3MDL_PARAM_I2C I2C_DEV(1)
/** @} */
/**
* @name LSM6DSL accelerometer sensor configuration
* @{
*/
#define LSM6DSL_PARAM_I2C I2C_DEV(1)
#define LSM6DSL_PARAM_ADDR (0x6A)
/** @} */
/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
*/
......
......@@ -204,10 +204,22 @@ static const i2c_conf_t i2c_config[] = {
.bus = APB1,
.rcc_mask = RCC_APB1ENR1_I2C1EN,
.irqn = I2C1_ER_IRQn,
}
},
{
.dev = I2C2,
.speed = I2C_SPEED_NORMAL,
.scl_pin = GPIO_PIN(PORT_B, 10),
.sda_pin = GPIO_PIN(PORT_B, 11),
.scl_af = GPIO_AF4,
.sda_af = GPIO_AF4,
.bus = APB1,
.rcc_mask = RCC_APB1ENR1_I2C2EN,
.irqn = I2C2_ER_IRQn,
},
};
#define I2C_0_ISR isr_i2c1_er
#define I2C_1_ISR isr_i2c2_er
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
/** @} */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment