|
| 1 | +.. _adafruit_lis3mdl: |
| 2 | + |
| 3 | +Adafruit LIS3MDL Shield |
| 4 | +####################### |
| 5 | + |
| 6 | +Overview |
| 7 | +******** |
| 8 | + |
| 9 | +The `Adafruit LIS3MDL Triple-Axis Magnetometer Sensor Shield`_ features |
| 10 | +a `ST LIS3MDL 3-axis magnetometer`_ and two STEMMA QT connectors. |
| 11 | + |
| 12 | +.. figure:: adafruit_lis3mdl.webp |
| 13 | + :align: center |
| 14 | + :alt: Adafruit LIS3MDL Shield |
| 15 | + |
| 16 | + Adafruit LIS3MDL Shield (Credit: Adafruit) |
| 17 | + |
| 18 | + |
| 19 | +Requirements |
| 20 | +************ |
| 21 | + |
| 22 | +This shield can be used with boards which provide an I2C connector, for |
| 23 | +example STEMMA QT or Qwiic connectors. |
| 24 | +The target board must define a ``zephyr_i2c`` node label. |
| 25 | +See :ref:`shields` for more details. |
| 26 | + |
| 27 | + |
| 28 | +Pin Assignments |
| 29 | +=============== |
| 30 | + |
| 31 | ++--------------+------------------------------------------------------+ |
| 32 | +| Shield Pin | Function | |
| 33 | ++==============+======================================================+ |
| 34 | +| SDA | LIS3MDL I2C SDA | |
| 35 | ++--------------+------------------------------------------------------+ |
| 36 | +| SCL | LIS3MDL I2C SCL | |
| 37 | ++--------------+------------------------------------------------------+ |
| 38 | +| INT | LIS3MDL Interrupt out | |
| 39 | ++--------------+------------------------------------------------------+ |
| 40 | +| DO/AD1 | LIS3MDL I2C address select pin | |
| 41 | ++--------------+------------------------------------------------------+ |
| 42 | +| CS | LIS3MDL Force I2C mode by setting it to high level. | |
| 43 | ++--------------+------------------------------------------------------+ |
| 44 | +| DRDY | LIS3MDL Data ready out | |
| 45 | ++--------------+------------------------------------------------------+ |
| 46 | + |
| 47 | +In order to use the DRDY output you need to connect a separate wire from the |
| 48 | +shield to a GPIO pin on your microcontroller board. See |
| 49 | +:dtcompatible:`st,lis3mdl-magn` for documentation on how to adjust the |
| 50 | +devicetree file. |
| 51 | + |
| 52 | + |
| 53 | +Programming |
| 54 | +*********** |
| 55 | + |
| 56 | +Set ``--shield adafruit_lis3mdl`` when you invoke ``west build``. For example |
| 57 | +when running the :zephyr:code-sample:`magn_polling` sample: |
| 58 | + |
| 59 | +.. zephyr-app-commands:: |
| 60 | + :zephyr-app: samples/sensor/magn_polling |
| 61 | + :board: adafruit_feather_rp2040 |
| 62 | + :shield: adafruit_lis3mdl |
| 63 | + :goals: build flash |
| 64 | + |
| 65 | +.. _Adafruit LIS3MDL Triple-Axis Magnetometer Sensor Shield: |
| 66 | + https://learn.adafruit.com/lis3mdl-triple-axis-magnetometer |
| 67 | + |
| 68 | +.. _ST LIS3MDL 3-axis magnetometer: |
| 69 | + https://www.st.com/en/mems-and-sensors/lis3mdl.html |
0 commit comments