-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
boards: shields: Add Seeed Grove Accelerometer
Add Seed Grove 3-Axis Digital Accelerometer This shield can take option to select connecting bus, so such like following example. ``` west build -p -b m5stack_atoms3/esp32s3/procpu samples/sensor/lis2dh/ --shield=seeed_grove_digital_accelerometer_lis3dhtr@grove_i2c1 ``` Signed-off-by: TOKITA Hiroshi <[email protected]>
- Loading branch information
Showing
5 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
boards/shields/seeed_grove_3axis_digital_accelerometer/Kconfig.shield
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (c) 2024 TOKITA Hiroshi | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SHIELD_SEEED_GROVE_LIS3DHTR | ||
def_bool $(shields_list_contains,seeed_grove_lis3dhtr) |
Binary file added
BIN
+32.5 KB
...grove_3axis_digital_accelerometer/doc/img/grove_3axis_digital_accelerometer_lis3dhtr.webp
Binary file not shown.
59 changes: 59 additions & 0 deletions
59
boards/shields/seeed_grove_3axis_digital_accelerometer/doc/index.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
.. _seeed_grove_3axis_digital_accelerometer: | ||
|
||
Seeed Studio Grove 3-Axis Digital Accelerometer | ||
############################################### | ||
|
||
Overview | ||
******** | ||
|
||
The Seeed Studio Grove 3-Axis Digital Accelerometer is a compact sensor module | ||
that provides digital output of 3-axis acceleration. | ||
There are several variations by the measurement range and chip. | ||
|
||
.. figure:: img/grove_3axis_digital_accelerometer_lis3dhtr.webp | ||
:align: center | ||
:alt: Grove - 3-Axis Digital Accelerometer (LIS3DHTR) | ||
|
||
Grove - 3-Axis Digital Accelerometer (LIS3DHTR) (Credit: Seeed Studio) | ||
|
||
These allows for easy integration with Grove connector system. | ||
More information about the Grove connector system can be found at the | ||
`Grove Ecosystem Introduction`_. | ||
|
||
Hardware | ||
******** | ||
|
||
Currently the following models are supported: | ||
|
||
- seeed_grove_lis3dhtr: see `Grove - 3-Axis Digital Accelerometer (LIS3DHTR)`_ | ||
|
||
Programming | ||
*********** | ||
|
||
Set ``--shield seeed_grove_[sensor_model]`` when you invoke ``west build``. | ||
For example: | ||
|
||
.. zephyr-app-commands:: | ||
:zephyr-app: samples/sensor/sensor_shell | ||
:board: wio_terminal/samd51p19a | ||
:shield: seeed_grove_adxl345 | ||
:goals: build | ||
|
||
This shield can take a option to select grove bus. | ||
|
||
.. zephyr-app-commands:: | ||
:zephyr-app: samples/sensor/sensor_shell | ||
:board: wio_terminal/samd51p19a | ||
:shield: seeed_grove_adxl345@grove_i2c1 | ||
:goals: build | ||
|
||
References | ||
********** | ||
|
||
.. target-notes:: | ||
|
||
.. _Grove Ecosystem Introduction: | ||
https://wiki.seeedstudio.com/Grove_System/ | ||
|
||
.. _Grove - 3-Axis Digital Accelerometer (LIS3DHTR): | ||
https://wiki.seeedstudio.com/Grove-3-Axis-Digital-Accelerometer-LIS3DHTR/ |
20 changes: 20 additions & 0 deletions
20
boards/shields/seeed_grove_3axis_digital_accelerometer/seeed_grove_lis3dhtr.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright (c) 2024 TOKITA Hiroshi <[email protected]> | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <zephyr/dt-bindings/gpio/gpio.h> | ||
#include <zephyr/dt-bindings/sensor/lis2dh.h> | ||
|
||
&SHIELD_CONN { | ||
SHIELD_CONVENTIONAL_LABEL(lis3dh): lis3dh@SHIELD_ADDR_HEX { | ||
compatible = "st,lis3dh", "st,lis2dh"; | ||
reg = <SHIELD_0X_ADDR>; | ||
|
||
#if SHIELD_OPTION_DEFINED(IRQ_GPIO_PIN) || SHIELD_OPTION_DEFINED(IRQ_GPIO_PORT) | ||
irq-gpios = <&SHIELD_OPTION(IRQ_GPIO_PORT) | ||
SHIELD_OPTION(IRQ_GPIO_PIN) | ||
SHIELD_OPTION(IRQ_GPIO_FLAG)>; | ||
#endif | ||
}; | ||
}; |
22 changes: 22 additions & 0 deletions
22
boards/shields/seeed_grove_3axis_digital_accelerometer/shield.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
shield: | ||
name: seeed_grove_accel | ||
full_name: Seeed Studio Grove 3-Axis Digital Accelerometer | ||
vendor: seeed | ||
variants: | ||
- name: lis3dhtr | ||
options: | ||
conn: | ||
type: string | ||
default: "grove_i2c" | ||
addr: | ||
type: int | ||
default: 0x19 | ||
irq-gpio-pin: | ||
type: int | ||
default: 0 | ||
irq-gpio-port: | ||
type: string | ||
default: "gpio0" | ||
irq-gpio-flag: | ||
type: string | ||
default: "GPIO_ACTIVE_HIGH" |