mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-09-01 20:33:30 +00:00
Added support to LIS2MDL Magnetometer sensor provided with following features: - I2C interface - Mag data - Temperature data - ODR configurable by config or at runtime - Trigger mode selectable by menuconfig - IRQ pin configurable (by dts or Kconfig) - Hard Iron offset setting at runtime - Include yaml file Tested on ST MEMS IKS01A2 + NUCLEO STM32F411RE board. LIS2MDL connected to I2C master interface (SPI 3 wire not supported yet). Test run with all ODR {10, 20, 50, 100} Hz in poll and trigger mode. GPIO IRQ dts configuration has been tested by adding to boards/arm/nucleo_f411re/nucleo_f411re.dts file this patch: &i2c1 { status = "ok"; clock-frequency = <I2C_BITRATE_FAST>; + + /* ST Microelectronics LIS2MDL mag sensor */ + lis2mdl-magn@1e { + compatible = "st,lis2mdl-magn"; + reg = <0x1e>; + irq-gpios = <&gpioa 4 0>; + label = "LIS2MDL"; + status = "ok"; + }; }; and adding boards/arm/nucleo_f411re/dts.fixup with following content: ST_STM32_I2C_V1_40005400_ST_LIS2MDL_MAGN_1E_LABEL ST_STM32_I2C_V1_40005400_ST_LIS2MDL_MAGN_1E_BASE_ADDRESS ST_STM32_I2C_V1_40005400_ST_LIS2MDL_MAGN_1E_BUS_NAME ST_STM32_I2C_V1_40005400_ST_LIS2MDL_MAGN_1E_IRQ_GPIOS_CONTROLLER ST_STM32_I2C_V1_40005400_ST_LIS2MDL_MAGN_1E_IRQ_GPIOS_PIN For more info on this LIS2MDL please follow this link: http://www.st.com/en/mems-and-sensors/lis2mdl.html Signed-off-by: Mario Tesi <mario.tesi@st.com> |
||
---|---|---|
.. | ||
adc | ||
aio | ||
audio | ||
bluetooth | ||
can | ||
clock_control | ||
console | ||
counter | ||
crypto | ||
display | ||
dma | ||
entropy | ||
ethernet | ||
flash | ||
gpio | ||
grove | ||
i2c | ||
i2s | ||
ieee802154 | ||
interrupt_controller | ||
ipm | ||
led | ||
led_strip | ||
modem | ||
net | ||
pci | ||
pinmux | ||
ptp_clock | ||
pwm | ||
rtc | ||
sensor | ||
serial | ||
spi | ||
timer | ||
usb | ||
watchdog | ||
wifi | ||
CMakeLists.txt | ||
Kconfig |