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

Add TiaC SC18IS604 Arduino as shield #262

Merged
merged 5 commits into from
Sep 12, 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
2 changes: 1 addition & 1 deletion boards/shields/grove_btn/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ The pinout of Grove Button following the `Grove Digital Layout`_.
+-----+----------+----------------+--------+--------+
| 2 | – | | | |
+-----+----------+----------------+--------+--------+
| 3 | VCC | 3.3V or 5V | Output | Input |
| 3 | VCC | 3.3V or 5V | Input | Output |
+-----+----------+----------------+--------+--------+
| 4 | GND | Ground | | |
+-----+----------+----------------+--------+--------+
Expand Down
18 changes: 18 additions & 0 deletions boards/shields/grove_sens/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2024 TiaC Systems
# SPDX-License-Identifier: Apache-2.0

if SHIELD_GROVE_SENS

config I2C
default y

config SHIELD_GROVE_SENS_BME280
def_bool $(dt_nodelabel_enabled,grove_sens_bme280)

config SHIELD_GROVE_SENS_BMP280
def_bool $(dt_nodelabel_enabled,grove_sens_bmp280)

config SHIELD_GROVE_SENS_DPS310
def_bool $(dt_nodelabel_enabled,grove_sens_dps310)

endif # SHIELD_GROVE_SENS
7 changes: 7 additions & 0 deletions boards/shields/grove_sens/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) 2024 TiaC Systems
# SPDX-License-Identifier: Apache-2.0

config SHIELD_GROVE_SENS
def_bool $(shields_list_contains,grove_sens_bme280) || \
$(shields_list_contains,grove_sens_bmp280) || \
$(shields_list_contains,grove_sens_dps310)
217 changes: 217 additions & 0 deletions boards/shields/grove_sens/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
.. image:: /images/seeed_grove.png
:align: right

.. _grove_sensor_shield:

Grove Sensor Shields
####################

Bridle supports a couple of different Sensor shields carrying Seeed Studio
`Grove System`_ connectors. Please download and read through the
`Preface - Getting Started`_ and `Introduction to Grove`_ before
use the product. Also have a look on the SiPEED Wiki page about the
`Grove standard interfaces`_.

Seeed Studio Sensor Shields
***************************

Variants and Versions
=====================

Here find the comparison between various variants and versions of Seeed Studio
Sensor Shields:

+--------------------------+----------------+----------------+----------------------+
| Parameter | BME280 V1.0 | BMP280 V1.0 | DPS310 V1.0 |
+==========================+================+================+======================+
| Release Date | Mar 2016 | Mar 2016 | Aug 2019 |
+--------------------------+----------------+----------------+----------------------+
| Operation Voltage | 3.3V or 5V | 3.3V or 5V | 3.3V or 5V |
+--------------------------+----------------+----------------+----------------------+
| Temperature Range | -40℃ to +85℃ | -40℃ to +85℃ | -40℃ to +85℃ |
+--------------------------+----------------+----------------+----------------------+
| Humidity Range | 0 to 100% | –––––––––––––– | –––––––––––––––––––– |
+--------------------------+----------------+----------------+----------------------+
| Pressure Range | 300 to 1100 ㍱ | 300 to 1100 ㍱ | 300 to 1200 ㍱ |
+--------------------------+----------------+----------------+----------------------+
| Pressure Precision | –––––––––––––– | –––––––––––––– | ± 0.002 ㍱ / ±0.02 m |
+--------------------------+----------------+----------------+----------------------+
| Pressure Accuracy (abs.) | ± 1 ㍱ / ±8 m | ± 1 ㍱ / ±8 m | ± 1 ㍱ / ±8 m |
+--------------------------+----------------+----------------+----------------------+
| Pressure Accuracy (rel.) | ± 0.12 ㍱ | ± 0.12 ㍱ | ± 0.06 ㍱ / ±0.5 m |
+--------------------------+----------------+----------------+----------------------+
| Pressure Resolution | 0.18 ㎩ | 0.18 ㎩ | 0.06 ㎩ |
+--------------------------+----------------+----------------+----------------------+
| Grove Connectors | 1 | 1 | 1 |
+--------------------------+----------------+----------------+----------------------+
| Digital Ports | | | |
+--------------------------+----------------+----------------+----------------------+
| Analog Ports | | | |
+--------------------------+----------------+----------------+----------------------+
| UART Ports | | | |
+--------------------------+----------------+----------------+----------------------+
| I2C Ports | 1 (Grove) | 1 (Grove) | 1 (Grove) |
+--------------------------+----------------+----------------+----------------------+
| SPI Ports | 1 | 1 | 1 |
+--------------------------+----------------+----------------+----------------------+

Grove Temperature, Humidity and Barometer Sensor V1.0 (BME280)
==============================================================

Overview
--------

**Model:** 101020193

The |Grove BME280 Sensor|_ is a breakout module for Bosch BME280_
high-precision, low-power combined humidity, pressure, and temperature
sensor in Grove form factor.

.. figure:: seeed_grove_bme280.jpg
:align: center
:alt: SEEED_GROVE_BME280

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

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

+-----+----------+------------------+--------+--------+
| Pin | Function | Meaning | Shield | Board |
+=====+==========+==================+========+========+
| 1 | SCL | I2C Serial Clock | Input | Output |
+-----+----------+------------------+--------+--------+
| 2 | SDA | I2C Serial Data | IN/OUT | OUT/IN |
+-----+----------+------------------+--------+--------+
| 3 | VCC | 3.3V or 5V | Input | Output |
+-----+----------+------------------+--------+--------+
| 4 | GND | Ground | | |
+-----+----------+------------------+--------+--------+

Hardware
--------

- `Grove BME280 Sensor V1.0 Eagle Files, Schematic and Layout`_

Grove Temperature and Barometer Sensor V1.0 (BMP280)
====================================================

Overview
--------

**Model:** 101020192

The |Grove BMP280 Sensor|_ is a breakout module for Bosch BMP280_
high-precision and low-power digital barometer (atmospheric pressure)
and temperature sensor in Grove form factor.

.. figure:: seeed_grove_bmp280.jpg
:align: center
:alt: SEEED_GROVE_BMP280

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

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

+-----+----------+------------------+--------+--------+
| Pin | Function | Meaning | Shield | Board |
+=====+==========+==================+========+========+
| 1 | SCL | I2C Serial Clock | Input | Output |
+-----+----------+------------------+--------+--------+
| 2 | SDA | I2C Serial Data | IN/OUT | OUT/IN |
+-----+----------+------------------+--------+--------+
| 3 | VCC | 3.3V or 5V | Input | Output |
+-----+----------+------------------+--------+--------+
| 4 | GND | Ground | | |
+-----+----------+------------------+--------+--------+

Hardware
--------

- `Grove BMP280 Sensor V1.0 Eagle Files, Schematic and Layout`_

Grove High Precision Enviromental Sensor V1.0 (DPS310)
======================================================

Overview
--------

**Model:** 101020812

The |Grove DPS310 Sensor|_ is a breakout module for Infineon DPS310_,
a miniaturized digital barometer air pressure and temperature sensor
with high accuracy, in Grove form factor.

.. figure:: seeed_grove_dps310.jpg
:align: center
:alt: SEEED_GROVE_DPS310

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

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

+-----+----------+------------------+--------+--------+
| Pin | Function | Meaning | Shield | Board |
+=====+==========+==================+========+========+
| 1 | SCL | I2C Serial Clock | Input | Output |
+-----+----------+------------------+--------+--------+
| 2 | SDA | I2C Serial Data | IN/OUT | OUT/IN |
+-----+----------+------------------+--------+--------+
| 3 | VCC | 3.3V or 5V | Input | Output |
+-----+----------+------------------+--------+--------+
| 4 | GND | Ground | | |
+-----+----------+------------------+--------+--------+

Hardware
--------

- `Grove DPS310 Sensor V1.0 Eagle Files, Schematic and Layout`_

Utilization
***********

Requirements
============

This shield can only be used with a development board or shield that provides
a configuration for `Grove System`_ connectors with `Grove I2C Layout`_
and defines a device tree phandle ``grove_i2c``.

Programming
===========

Set ``-DSHIELD=grove_sens_X`` when you invoke ``west build``, wherein ``X``
corresponds to the exact sensor type. For example:

#. :ref:`grove_base_shield_v2` on :ref:`zephyr:mimxrt1060_evk`
for **Grove BME280 Sensor**:

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

#. :ref:`grove_base_shield_v13` or :ref:`grove_base_shield_v12` on
:ref:`zephyr:mimxrt1060_evk` for **Grove BMP280 Sensor**:

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

References
**********

.. target-notes::
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions boards/shields/grove_sens/grove_sens_bme280.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

/*
* Device address 0x76 is assumed per default. Your device may have
* a different address; check solder bridge on your device if unsure.
*/

&grove_i2c {
bme280@76 {
compatible = "bosch,bme280";
status = "okay";
reg = <0x76>;
};
};
17 changes: 17 additions & 0 deletions boards/shields/grove_sens/grove_sens_bmp280.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

/*
* Device address 0x77 is assumed per default. Your device may have
* a different address; check solder bridge on your device if unsure.
*/

&grove_i2c {
bmp280@77 {
compatible = "bosch,bme280";
status = "okay";
reg = <0x77>;
};
};
17 changes: 17 additions & 0 deletions boards/shields/grove_sens/grove_sens_dps310.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

/*
* Device address 0x77 is assumed per default. Your device may have
* a different address; check solder bridge on your device if unsure.
*/

&grove_i2c {
dps310@77 {
compatible = "infineon,dps310";
status = "okay";
reg = <0x77>;
};
};
22 changes: 22 additions & 0 deletions boards/shields/tcs-604/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (c) 2024 TiaC Systems
# SPDX-License-Identifier: Apache-2.0

config MFD
default y
depends on SHIELD_TCS_604_ARD

config SPI
default y
depends on SHIELD_TCS_604_ARD

config I2C
default y if DT_HAS_NXP_SC18IS604_I2C_ENABLED
depends on SHIELD_TCS_604_ARD

config GPIO
default y if DT_HAS_NXP_SC18IS604_GPIO_ENABLED
depends on SHIELD_TCS_604_ARD

config DYNAMIC_THREAD_POOL_SIZE
default 1 if MFD_SC18IS604_ASYNC && !DYNAMIC_THREAD_ALLOC
depends on SHIELD_TCS_604_ARD && MFD_SC18IS604
5 changes: 5 additions & 0 deletions boards/shields/tcs-604/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2024 TiaC Systems
# SPDX-License-Identifier: Apache-2.0

config SHIELD_TCS_604_ARD
def_bool $(shields_list_contains,tcs_604_ard)
11 changes: 11 additions & 0 deletions boards/shields/tcs-604/doc/grove_blinky.rsti
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
This is based on the Zephyr sample :zephyr:code-sample:`zephyr:blinky`.

.. zephyr-app-commands::
:app: zephyr/samples/basic/blinky
:build-dir: tcs_604_ard
:board: nucleo_f746zg
:shield: "tcs_604_ard;grove_btn_d4;grove_led_d3;grove_sens_bmp280;tcs_604_x_grove_testbed"
:west-args: -p always
:goals: flash
:host-os: unix
:compact:
23 changes: 23 additions & 0 deletions boards/shields/tcs-604/doc/grove_bmp280.rsti
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
This is based on the Zephyr sample :ref:`zephyr:bme280`.

.. zephyr-app-commands::
:app: zephyr/samples/sensor/bme280
:build-dir: tcs_604_ard
:board: nucleo_f746zg
:shield: "tcs_604_ard;grove_btn_d4;grove_led_d3;grove_sens_bmp280;tcs_604_x_grove_testbed"
:west-args: -p always
:goals: flash
:host-os: unix
:compact:

.. parsed-literal::
:class: highlight-console notranslate

[00:00:00.005,000] <inf> mfd_sc18is604: sc18is604@0: found "SC18IS604 1.0.3"
[00:00:00.011,000] <dbg> BME280: bme280_chip_init: ID OK (BMP280)
[00:00:00.040,000] <dbg> BME280: bme280_chip_init: "bme280\ @\ 77" OK
\*\*\* Booting Zephyr OS build v3.7.0-116-g98e7aa72eb04 \*\*\*
Found device "bme280\ @\ 77", getting sensor data
temp: 26.671875; press: 98.640625; humidity: 1064960.0
temp: 26.671875; press: 98.640625; humidity: 1064960.0
… … …
12 changes: 12 additions & 0 deletions boards/shields/tcs-604/doc/grove_button.rsti
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
This is based on the Bridle sample :ref:`button-sample` in polling mode.

.. zephyr-app-commands::
:app: bridle/samples/button
:build-dir: tcs_604_ard
:board: nucleo_f746zg
:shield: "tcs_604_ard;grove_btn_d4;grove_led_d3;grove_sens_bmp280;tcs_604_x_grove_testbed"
:conf: prj-poll.conf
:west-args: -p always
:goals: flash
:host-os: unix
:compact:
Loading