Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grove Buttons with inverted input support and more Grove I/O Modules #278

Merged
merged 7 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion boards/shields/grove_btn/Kconfig.shield
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,66 @@

config SHIELD_GROVE_BTN
def_bool $(shields_list_contains,grove_btn_d0) || \
$(shields_list_contains,grove_btn_d0_inv) || \
$(shields_list_contains,grove_btn_d1) || \
$(shields_list_contains,grove_btn_d1_inv) || \
$(shields_list_contains,grove_btn_d2) || \
$(shields_list_contains,grove_btn_d2_inv) || \
$(shields_list_contains,grove_btn_d3) || \
$(shields_list_contains,grove_btn_d3_inv) || \
$(shields_list_contains,grove_btn_d4) || \
$(shields_list_contains,grove_btn_d4_inv) || \
$(shields_list_contains,grove_btn_d5) || \
$(shields_list_contains,grove_btn_d5_inv) || \
$(shields_list_contains,grove_btn_d6) || \
$(shields_list_contains,grove_btn_d6_inv) || \
$(shields_list_contains,grove_btn_d7) || \
$(shields_list_contains,grove_btn_d7_inv) || \
$(shields_list_contains,grove_btn_d8) || \
$(shields_list_contains,grove_btn_d8_inv) || \
$(shields_list_contains,grove_btn_d9) || \
$(shields_list_contains,grove_btn_d9_inv) || \
$(shields_list_contains,grove_btn_d10) || \
$(shields_list_contains,grove_btn_d10_inv) || \
$(shields_list_contains,grove_btn_d11) || \
$(shields_list_contains,grove_btn_d11_inv) || \
$(shields_list_contains,grove_btn_d12) || \
$(shields_list_contains,grove_btn_d12_inv) || \
$(shields_list_contains,grove_btn_d13) || \
$(shields_list_contains,grove_btn_d13_inv) || \
$(shields_list_contains,grove_btn_d14) || \
$(shields_list_contains,grove_btn_d14_inv) || \
$(shields_list_contains,grove_btn_d15) || \
$(shields_list_contains,grove_btn_d15_inv) || \
$(shields_list_contains,grove_btn_d16) || \
$(shields_list_contains,grove_btn_d16_inv) || \
$(shields_list_contains,grove_btn_d17) || \
$(shields_list_contains,grove_btn_d17_inv) || \
$(shields_list_contains,grove_btn_d18) || \
$(shields_list_contains,grove_btn_d18_inv) || \
$(shields_list_contains,grove_btn_d19) || \
$(shields_list_contains,grove_btn_d19_inv) || \
$(shields_list_contains,grove_btn_d20) || \
$(shields_list_contains,grove_btn_d20_inv) || \
$(shields_list_contains,grove_btn_d21) || \
$(shields_list_contains,grove_btn_d21_inv) || \
$(shields_list_contains,grove_btn_d22) || \
$(shields_list_contains,grove_btn_d22_inv) || \
$(shields_list_contains,grove_btn_d23) || \
$(shields_list_contains,grove_btn_d23_inv) || \
$(shields_list_contains,grove_btn_d24) || \
$(shields_list_contains,grove_btn_d24_inv) || \
$(shields_list_contains,grove_btn_d25) || \
$(shields_list_contains,grove_btn_d25_inv) || \
$(shields_list_contains,grove_btn_d26) || \
$(shields_list_contains,grove_btn_d26_inv) || \
$(shields_list_contains,grove_btn_d27) || \
$(shields_list_contains,grove_btn_d27_inv) || \
$(shields_list_contains,grove_btn_d28) || \
$(shields_list_contains,grove_btn_d28_inv) || \
$(shields_list_contains,grove_btn_d29) || \
$(shields_list_contains,grove_btn_d29_inv) || \
$(shields_list_contains,grove_btn_d30) || \
$(shields_list_contains,grove_btn_d31)
$(shields_list_contains,grove_btn_d30_inv) || \
$(shields_list_contains,grove_btn_d31) || \
$(shields_list_contains,grove_btn_d31_inv)
156 changes: 135 additions & 21 deletions boards/shields/grove_btn/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,111 @@ Variants and Versions
Here find the comparison between various variants and versions of Seeed Studio
Button Shields:

+-----------------------+--------------+--------------+
| Parameter | Button V1.2 | Button V1.0 |
+=======================+==============+==============+
| Release Date | Dec 2016 | Apr 2011 |
+-----------------------+--------------+--------------+
| Operation Voltage | 3.3V or 5V | 3.3V or 5V |
+-----------------------+--------------+--------------+
| Operation Temperature | -25℃ to +70℃ | |
+-----------------------+--------------+--------------+
| Grove Connectors | 1 | 1 |
+-----------------------+--------------+--------------+
| Digital Ports | 1 | 1 |
+-----------------------+--------------+--------------+
| Analog Ports | | |
+-----------------------+--------------+--------------+
| UART Ports | | |
+-----------------------+--------------+--------------+
| I2C Ports | | |
+-----------------------+--------------+--------------+
| SPI Ports | | |
+-----------------------+--------------+--------------+
+-----------------------+------------------+-----------------+--------------+--------------+
| Parameter | Dual Button V1.0 | LED Button V1.0 | Button V1.2 | Button V1.0 |
+=======================+==================+=================+==============+==============+
| Release Date | Sep 2019 | Jun 2018 | Dec 2016 | Apr 2011 |
+-----------------------+------------------+-----------------+--------------+--------------+
| Operation Voltage | 3.3V or 5V | 3.3V or 5V | 3.3V or 5V | 3.3V or 5V |
+-----------------------+------------------+-----------------+--------------+--------------+
| Operation Temperature | | | -25℃ to +70℃ | -25℃ to +70℃ |
+-----------------------+------------------+-----------------+--------------+--------------+
| Grove Connectors | 1 | 1 | 1 | 1 |
+-----------------------+------------------+-----------------+--------------+--------------+
| Digital Ports | 1 | 1 | 1 | 1 |
+-----------------------+------------------+-----------------+--------------+--------------+
| Analog Ports | | | | |
+-----------------------+------------------+-----------------+--------------+--------------+
| UART Ports | | | | |
+-----------------------+------------------+-----------------+--------------+--------------+
| I2C Ports | | | | |
+-----------------------+------------------+-----------------+--------------+--------------+
| SPI Ports | | | | |
+-----------------------+------------------+-----------------+--------------+--------------+

Grove Dual Button V1.0
======================

Overview
--------

**Model:** 111020103 (r/g/b/w)

The `Grove Dual Button V1.0`_ includes 2 buttons, controls two signal channel
with one module. Both buttons are low active and drives high in dormant state
by an pull up resistance.

.. figure:: seeed_grove_dual_button.jpg
:align: center
:alt: SEEED_GROVE_DUAL_BUTTON

Pinout Diagram
--------------

The pinout of Grove Button following the `Grove Digital Layout`_.

+-----+----------+----------------+--------+--------+
| Pin | Function | Meaning | Shield | Board |
+=====+==========+================+========+========+
| 1 | Dn | Digital Signal | Output | Input |
+-----+----------+----------------+--------+--------+
| 2 | Dn+1 | Digital Signal | Output | Input |
+-----+----------+----------------+--------+--------+
| 3 | VCC | 3.3V or 5V | Input | Output |
+-----+----------+----------------+--------+--------+
| 4 | GND | Ground | | |
+-----+----------+----------------+--------+--------+

Hardware
--------

The button outputs (Dn or Dn+1) a LOW signal when pressed,
and HIGH when released.

- `Grove Dual Button V1.0 Eagle Files, Schematic and Layout`_
- `Grove Dual Button V1.0 Schematic`_

Grove LED Button V1.0
=====================

Overview
--------

**Model:** 111020044 (r), 111020045 (y), 111020046 (b)

The `Grove LED Button V1.0`_ is a combined module of either yellow, blue
or red LED with a momentary and tactile push button in Grove form factor.
It uses a N-Channel MOSFET to control the LED to ensure the high switching
speed and a low current consumption. The button is low active and drives
high in dormant state by an pull up resistance.

.. figure:: seeed_grove_led_button.jpg
:align: center
:alt: SEEED_GROVE_LED_BUTTON

Pinout Diagram
--------------

The pinout of Grove Button following the `Grove Digital Layout`_.

+-----+----------+----------------+--------+--------+
| Pin | Function | Meaning | Shield | Board |
+=====+==========+================+========+========+
| 1 | Dn | Digital Signal | Input | Output |
+-----+----------+----------------+--------+--------+
| 2 | Dn+1 | Digital Signal | Output | Input |
+-----+----------+----------------+--------+--------+
| 3 | VCC | 3.3V or 5V | Input | Output |
+-----+----------+----------------+--------+--------+
| 4 | GND | Ground | | |
+-----+----------+----------------+--------+--------+

Hardware
--------

The button outputs (Dn+1) a LOW signal when pressed, and HIGH when released.

- `Grove LED Button V1.0 Eagle Files, Schematic and Layout`_

Grove Button V1.2 and V1.0
==========================
Expand Down Expand Up @@ -102,6 +186,36 @@ Set ``-DSHIELD=grove_btn_dX`` when you invoke ``west build``, wherein ``X``
corresponds to the ordinal number of a signal from the
|Laced Grove Signal Interface|. For example:

.. rubric:: Grove LED Button V1.0

#. :ref:`grove_base_shield_v2` on |zephyr:board:mimxrt1060_evk|
for **GPIO driven Button** on Grove ``D4``:

.. zephyr-app-commands::
:app: bridle/samples/helloshell
:build-dir: helloshell-seeed_grove_base_v2-grove_btn_d4_inv
:board: mimxrt1060_evkb
:shield: "seeed_grove_base_v2 grove_btn_d4_inv"
:goals: flash
:west-args: -p
:host-os: unix
:tool: all

#. :ref:`grove_base_shield_v13` or :ref:`grove_base_shield_v12` on
|zephyr:board:mimxrt1060_evk| for **GPIO driven Button** on Grove ``D4``:

.. zephyr-app-commands::
:app: bridle/samples/helloshell
:build-dir: helloshell-seeed_grove_base_v1-grove_btn_d4_inv
:board: mimxrt1060_evkb
:shield: "seeed_grove_base_v1 grove_btn_d4_inv"
:goals: flash
:west-args: -p
:host-os: unix
:tool: all

.. rubric:: Grove Button V1.2 and V1.0

#. :ref:`grove_base_shield_v2` on |zephyr:board:mimxrt1060_evk|
for **GPIO driven Button** on Grove ``D4``:

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions boards/shields/grove_btn/grove_btn_d0_inv.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/gpio/gpio.h>

/ {
grove_btns {
status = "okay";

compatible = "gpio-keys";

grove_btn_d0: grove-btn-d0-inv {
label = "Grove Button D0 (inverted)";
gpios = <&grove_gpios 0 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>;
};
};
};
19 changes: 19 additions & 0 deletions boards/shields/grove_btn/grove_btn_d10_inv.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/gpio/gpio.h>

/ {
grove_btns {
status = "okay";

compatible = "gpio-keys";

grove_btn_d10: grove-btn-d10-inv {
label = "Grove Button D10 (inverted)";
gpios = <&grove_gpios 10 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>;
};
};
};
19 changes: 19 additions & 0 deletions boards/shields/grove_btn/grove_btn_d11_inv.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/gpio/gpio.h>

/ {
grove_btns {
status = "okay";

compatible = "gpio-keys";

grove_btn_d11: grove-btn-d11-inv {
label = "Grove Button D11 (inverted)";
gpios = <&grove_gpios 11 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>;
};
};
};
19 changes: 19 additions & 0 deletions boards/shields/grove_btn/grove_btn_d12_inv.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/gpio/gpio.h>

/ {
grove_btns {
status = "okay";

compatible = "gpio-keys";

grove_btn_d12: grove-btn-d12-inv {
label = "Grove Button D12 (inverted)";
gpios = <&grove_gpios 12 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>;
};
};
};
19 changes: 19 additions & 0 deletions boards/shields/grove_btn/grove_btn_d13_inv.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/gpio/gpio.h>

/ {
grove_btns {
status = "okay";

compatible = "gpio-keys";

grove_btn_d13: grove-btn-d13-inv {
label = "Grove Button D13 (inverted)";
gpios = <&grove_gpios 13 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>;
};
};
};
19 changes: 19 additions & 0 deletions boards/shields/grove_btn/grove_btn_d14_inv.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/gpio/gpio.h>

/ {
grove_btns {
status = "okay";

compatible = "gpio-keys";

grove_btn_d14: grove-btn-d14-inv {
label = "Grove Button D14 (inverted)";
gpios = <&grove_gpios 14 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>;
};
};
};
19 changes: 19 additions & 0 deletions boards/shields/grove_btn/grove_btn_d15_inv.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/gpio/gpio.h>

/ {
grove_btns {
status = "okay";

compatible = "gpio-keys";

grove_btn_d15: grove-btn-d15-inv {
label = "Grove Button D15 (inverted)";
gpios = <&grove_gpios 15 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>;
};
};
};
19 changes: 19 additions & 0 deletions boards/shields/grove_btn/grove_btn_d16_inv.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/gpio/gpio.h>

/ {
grove_btns {
status = "okay";

compatible = "gpio-keys";

grove_btn_d16: grove-btn-d16-inv {
label = "Grove Button D16 (inverted)";
gpios = <&grove_gpios 16 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>;
};
};
};
Loading
Loading