1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

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)
This commit is contained in:
Vincent Dupont 2018-08-08 12:13:00 +02:00 committed by GitHub
commit 0e48bd0d93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 1 deletions

View File

@ -1,3 +1,6 @@
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
USEMODULE += hts221
USEMODULE += lis3mdl
USEMODULE += lsm6dsl
endif

View File

@ -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
*/

View File

@ -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]))
/** @} */