diff --git a/boards/shields/tcs-604/Kconfig.defconfig b/boards/shields/tcs-604/Kconfig.defconfig new file mode 100644 index 0000000000..df83504dc4 --- /dev/null +++ b/boards/shields/tcs-604/Kconfig.defconfig @@ -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 diff --git a/boards/shields/tcs-604/Kconfig.shield b/boards/shields/tcs-604/Kconfig.shield new file mode 100644 index 0000000000..5353ec3e47 --- /dev/null +++ b/boards/shields/tcs-604/Kconfig.shield @@ -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) diff --git a/boards/shields/tcs-604/doc/grove_blinky.rsti b/boards/shields/tcs-604/doc/grove_blinky.rsti new file mode 100644 index 0000000000..c5859edbbc --- /dev/null +++ b/boards/shields/tcs-604/doc/grove_blinky.rsti @@ -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: diff --git a/boards/shields/tcs-604/doc/grove_bmp280.rsti b/boards/shields/tcs-604/doc/grove_bmp280.rsti new file mode 100644 index 0000000000..0e73246e47 --- /dev/null +++ b/boards/shields/tcs-604/doc/grove_bmp280.rsti @@ -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] mfd_sc18is604: sc18is604@0: found "SC18IS604 1.0.3" + [00:00:00.011,000] BME280: bme280_chip_init: ID OK (BMP280) + [00:00:00.040,000] 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 + … … … diff --git a/boards/shields/tcs-604/doc/grove_button.rsti b/boards/shields/tcs-604/doc/grove_button.rsti new file mode 100644 index 0000000000..11bef16529 --- /dev/null +++ b/boards/shields/tcs-604/doc/grove_button.rsti @@ -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: diff --git a/boards/shields/tcs-604/doc/helloshell.rsti b/boards/shields/tcs-604/doc/helloshell.rsti new file mode 100644 index 0000000000..8faca822a0 --- /dev/null +++ b/boards/shields/tcs-604/doc/helloshell.rsti @@ -0,0 +1,19 @@ +.. image:: img/TCS-604-ARD-Grove-wiring.jpg + :scale: 85% + :align: center + :alt: TiaC SC18IS604 Arduino Wiring + +Set ``--shield tcs_604_ard`` when you invoke ``west build`` +or ``-DSHIELD=tcs_604_ard`` for ``cmake``. For example: + + .. zephyr-app-commands:: + :app: bridle/samples/helloshell + :build-dir: tcs_604_ard + :board: nucleo_f746zg + :shield: "tcs_604_ard" + :west-args: -p always + :goals: flash + :host-os: unix + :tool: all + +.. include:: helloshell_console.rsti diff --git a/boards/shields/tcs-604/doc/helloshell_console.rsti b/boards/shields/tcs-604/doc/helloshell_console.rsti new file mode 100644 index 0000000000..7695772b93 --- /dev/null +++ b/boards/shields/tcs-604/doc/helloshell_console.rsti @@ -0,0 +1,175 @@ +.. rubric:: Simple test execution on target + +(text in bold is a command input) + +.. tabs:: + + .. group-tab:: Basics + + .. parsed-literal:: + :class: highlight-console notranslate + + :bgn:`uart:~$` **hello -h** + hello - say hello + :bgn:`uart:~$` **hello** + Hello from shell. + + :bgn:`uart:~$` **hwinfo devid** + Length: 8 + ID: 0x8c998be1de969148 + + :bgn:`uart:~$` **kernel version** + Zephyr version |zephyr_version_number_em| + + :bgn:`uart:~$` **bridle version** + Bridle version |version_number_em| + + :bgn:`uart:~$` **bridle version long** + Bridle version |longversion_number_em| + + :bgn:`uart:~$` **bridle info** + Zephyr: |zephyr_release_number_em| + Bridle: |release_number_em| + + :bgn:`uart:~$` **device list** + devices: + - rcc\ @\ 40023800 (READY) + DT node labels: rcc + - reset-controller (READY) + DT node labels: rctl + - interrupt-controller\ @\ 40013c00 (READY) + DT node labels: exti + - gpio\ @\ 40022800 (READY) + DT node labels: gpiok + - gpio\ @\ 40022400 (READY) + DT node labels: gpioj + - gpio\ @\ 40022000 (READY) + DT node labels: gpioi + - gpio\ @\ 40021C00 (READY) + DT node labels: gpioh + - gpio\ @\ 40021800 (READY) + DT node labels: gpiog + - gpio\ @\ 40021400 (READY) + DT node labels: gpiof + - gpio\ @\ 40021000 (READY) + DT node labels: gpioe + - gpio\ @\ 40020C00 (READY) + DT node labels: gpiod + - gpio\ @\ 40020800 (READY) + DT node labels: gpioc + - gpio\ @\ 40020400 (READY) + DT node labels: gpiob + - gpio\ @\ 40020000 (READY) + DT node labels: gpioa + - serial\ @\ 40011400 (READY) + DT node labels: usart6 arduino_serial + - serial\ @\ 40004800 (READY) + DT node labels: usart3 + - adc\ @\ 40012000 (READY) + DT node labels: adc1 + - dac\ @\ 40007400 (READY) + DT node labels: dac1 + - flash-controller\ @\ 40023c00 (READY) + DT node labels: flash + - i2c\ @\ 40005800 (READY) + DT node labels: i2c2 + - i2c\ @\ 40005400 (READY) + DT node labels: i2c1 arduino_i2c + - pwm (READY) + DT node labels: pwm1 + - spi\ @\ 40013000 (READY) + DT node labels: spi1 arduino_spi + - sc18is604\ @\ 0 (READY) + DT node labels: sc18is604_0 + - sc18is604-0-i2c (READY) + DT node labels: sc18is604_0_i2c tcs_604_i2c grove_i2c + - sc18is604-0-gpio (READY) + DT node labels: sc18is604_0_gpio + - leds (READY) + DT node labels: leds + - dietemp (READY) + DT node labels: die_temp + - vbat (READY) + DT node labels: vbat + - vref (READY) + DT node labels: vref + + :bgn:`uart:~$` **history** + [ 0] history + [ 1] device list + [ 2] bridle info + [ 3] bridle version long + [ 4] bridle version + [ 5] kernel version + [ 6] hwinfo devid + [ 7] hello + [ 8] hello -h + + .. group-tab:: GPIO + + :hwftlbl-led:`LED`: operate with one of extra connected |LED Shields| + by :rpi-pico-pio:`IO3` at :hwftlbl-con:`D3` (see wiring above): + + .. parsed-literal:: + :class: highlight-console notranslate + + :bgn:`uart:~$` **gpio get sc18is604-0-gpio 3** + 0 + + :bgn:`uart:~$` **gpio conf sc18is604-0-gpio 3 oh0** + :bgn:`uart:~$` **gpio set sc18is604-0-gpio 3 1** + :bgn:`uart:~$` **gpio set sc18is604-0-gpio 3 0** + + :bgn:`uart:~$` **gpio blink sc18is604-0-gpio 3** + Hit any key to exit + + :hwftlbl-btn:`BTN`: operate with one of extra connected |Button Shields| + by :rpi-pico-pio:`IO4` at :hwftlbl-con:`D4` (see wiring above): + + .. parsed-literal:: + :class: highlight-console notranslate + + :bgn:`uart:~$` **gpio get sc18is604-0-gpio 4** + 0 + + :bgn:`uart:~$` **gpio conf sc18is604-0-gpio 4 iuh** + :bgn:`uart:~$` **gpio get sc18is604-0-gpio 4** + 0 + :bgn:`uart:~$` **gpio get sc18is604-0-gpio 4** + 1 + :bgn:`uart:~$` **gpio get sc18is604-0-gpio 4** + 0 + + .. group-tab:: I2C + + There are no on-shield I2C devices. For this example the + |Grove BMP280 Sensor|_ was connected (see wiring above and + |Sensor Shields|). Scan the I2C devices: + + .. parsed-literal:: + :class: highlight-console notranslate + + :bgn:`uart:~$` **i2c scan sc18is604-0-i2c** + 0 1 2 3 4 5 6 7 8 9 a b c d e f + 00: -- -- -- -- -- -- -- -- -- -- -- -- + 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + 70: -- -- -- -- -- -- -- 77 + 1 devices found on sc18is604-0-i2c + + The I2C address ``0x77`` is a Bosch BMP280 Air Pressure Sensor and their + Chip-ID can read from register ``0xd0``. The Chip-ID must be ``0x58``: + + .. parsed-literal:: + :class: highlight-console notranslate + + :bgn:`uart:~$` **i2c read_byte sc18is604-0-i2c 77 d0** + Output: 0x58 + +.. |LED Shields| replace:: :ref:`grove_led_shield` +.. |Button Shields| replace:: :ref:`grove_button_shield` +.. |Sensor Shields| replace:: :ref:`grove_sensor_shield` diff --git a/boards/shields/tcs-604/doc/img/TCS-604-ARD-Grove-wiring.jpg b/boards/shields/tcs-604/doc/img/TCS-604-ARD-Grove-wiring.jpg new file mode 100644 index 0000000000..61bfccb9c0 Binary files /dev/null and b/boards/shields/tcs-604/doc/img/TCS-604-ARD-Grove-wiring.jpg differ diff --git a/boards/shields/tcs-604/doc/img/TCS-604-ARD.jpg b/boards/shields/tcs-604/doc/img/TCS-604-ARD.jpg new file mode 100644 index 0000000000..0e2194cc4b Binary files /dev/null and b/boards/shields/tcs-604/doc/img/TCS-604-ARD.jpg differ diff --git a/boards/shields/tcs-604/doc/index.rst b/boards/shields/tcs-604/doc/index.rst new file mode 100644 index 0000000000..3b71ae7f0d --- /dev/null +++ b/boards/shields/tcs-604/doc/index.rst @@ -0,0 +1,154 @@ +.. _tcs_604_ard_shield: + +TiaC SC18IS604 Arduino +###################### + +.. toctree:: + +.. image:: ./img/TCS-604-ARD.jpg + :align: center + :alt: TiaC SC18IS604 Arduino PCBA (top) + +:hwftlbl-spi:`1` +:hwftlbl-i2c:`1` +:hwftlbl-pio:`5` +:hwftlbl-con:`4 Grove I2C` +:hwftlbl-con:`5 Grove Digital` + +Overview +******** + +The TiaC SC18IS604 Arduino is an evaluation shield for the SC18IS604_ chip, an +:ref:`SPI ` to :ref:`I2C ` bus bridge with an +integrated :ref:`GPIO ` controller. This shield requires a +board which provides the standard |Arduino UNO R3| connector. + +Apart from the bridge it features 3 Sparkfun `Qwiic System`_ and +9 Seeed Studio `Grove System`_ connectors: + +- 4 ports with `Grove I2C Layout`_ +- 5 ports with `Grove Digital Layout`_ + +Hardware +******** + +.. rubric:: Design Data +.. rst-class:: rst-columns + +- `TCS-604-ARD Schematic`_ +- `TCS-604-ARD PCBA`_ + +.. rubric:: Data Sheets +.. rst-class:: rst-columns + +- .. rubric:: SC18IS604_ +- `SC18IS604 Datasheet`_ + +Supported Features +================== + +The :code:`tcs_604_ard` shield configuration supports the following +hardware features: + ++-----------+------------+------------------------------------------+ +| Interface | Controller | Driver/Component | ++===========+============+==========================================+ +| GPIO | on-chip | I/O ports | ++-----------+------------+------------------------------------------+ +| I2C | on-chip | Inter-Integrated Circuit | ++-----------+------------+------------------------------------------+ + +The default configuration can be found in the Kconfig file +:bridle_file:`boards/shields/tcs-604/Kconfig.defconfig`. + +.. _tcs_604_ard_grove_if: + +Laced Grove Signal Interface +---------------------------- + +In addition to the GPIO pin header, there are also 5 |Grove connectors| for the +digital I/O signals of the bridge. These are provided by a specific interface +for general signal mapping, the |Laced Grove Signal Interface|. + +Following mappings are well known: + +* ``grove_gpios``: GPIO mapping + +.. tabs:: + + .. group-tab:: GPIO mapping ``grove_gpios`` + + This is the **GPIO signal line mapping** from the SC18IS604_ + chip bindet with to the set of |Grove connectors| provided as + |Laced Grove Signal Interface|. + + +-----------------------------+-------------------------+----------------------------------+ + | phandle index to shield --> | **Signal** : *Meaning* | ``tcs_604_ard`` | + +=============================+=========================+==================================+ + | ``<&grove_gpios 0 …>`` | **D0** | | ``<&grove_d0_header 0 …>`` | + | | | | ``<&grove_d1_header 1 …>`` | + | | | | ↳ ``<&sc18is604_0_gpio 0 …>`` | + +-----------------------------+-------------------------+----------------------------------+ + | ``<&grove_gpios 1 …>`` | **D1** | | ``<&grove_d1_header 0 …>`` | + | | | | ``<&grove_d2_header 1 …>`` | + | | | | ↳ ``<&sc18is604_0_gpio 1 …>`` | + +-----------------------------+-------------------------+----------------------------------+ + | ``<&grove_gpios 2 …>`` | **D2** | | ``<&grove_d2_header 0 …>`` | + | | | | ``<&grove_d1_header 1 …>`` | + | | | | ↳ ``<&sc18is604_0_gpio 2 …>`` | + +-----------------------------+-------------------------+----------------------------------+ + | ``<&grove_gpios 3 …>`` | **D3** | | ``<&grove_d3_header 0 …>`` | + | | | | ``<&grove_d4_header 1 …>`` | + | | | | ↳ ``<&sc18is604_0_gpio 3 …>`` | + +-----------------------------+-------------------------+----------------------------------+ + | ``<&grove_gpios 4 …>`` | **D4** | | ``<&grove_d4_header 0 …>`` | + | | | | ↳ ``<&sc18is604_0_gpio 4 …>`` | + +-----------------------------+-------------------------+----------------------------------+ + +Utilization +*********** + +The shield abstraction is deliberately kept small. It is purely for evaluating +the necessary drivers and Devicetree bindings on known integration platforms. + +Programming +=========== + +If the host board has an |Arduino UNO R3| connector available, its signals can +be used to connect the shield: + +.. zephyr-app-commands:: + :zephyr-app: + :board: + :shield: "tcs_604_ard" + :goals: build + :compact: + +Hello Shell on :ref:`zephyr:nucleo_f746zg_board` +------------------------------------------------ + +.. include:: helloshell.rsti + +More Samples and Tests +********************** + +This is based on the Zephyr board :ref:`zephyr:nucleo_f746zg_board`. + +.. tabs:: + + .. group-tab:: Grove LED Blinky + + .. include:: grove_blinky.rsti + + .. group-tab:: Grove LED Button + + .. include:: grove_button.rsti + + .. group-tab:: Grove BMP280 Sensor + + .. include:: grove_bmp280.rsti + +References +********** + +.. target-notes:: diff --git a/boards/shields/tcs-604/gpio_connector.dtsi b/boards/shields/tcs-604/gpio_connector.dtsi new file mode 100644 index 0000000000..be0fc4e160 --- /dev/null +++ b/boards/shields/tcs-604/gpio_connector.dtsi @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + tcs_604_gpio: tcs-604-gpio-pins { + compatible = "tiac,604-gpio-header"; + status = "okay"; + + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <0 0 &sc18is604_0_gpio 0 0>, /* IO0 */ + <1 0 &sc18is604_0_gpio 1 0>, /* IO1 */ + <2 0 &sc18is604_0_gpio 2 0>, /* IO2 */ + <3 0 &sc18is604_0_gpio 3 0>, /* IO3 */ + <4 0 &sc18is604_0_gpio 4 0>; /* IO4 (input only) */ + }; +}; diff --git a/boards/shields/tcs-604/grove_connectors.dtsi b/boards/shields/tcs-604/grove_connectors.dtsi new file mode 100644 index 0000000000..1deafd6838 --- /dev/null +++ b/boards/shields/tcs-604/grove_connectors.dtsi @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +grove_i2c: &tcs_604_i2c {}; + +#include "grove_d0_connector.dtsi" +#include "grove_d1_connector.dtsi" +#include "grove_d2_connector.dtsi" +#include "grove_d3_connector.dtsi" +#include "grove_d4_connector.dtsi" + +/ { + grove_laced_if_tcs_604: grove-laced-if-tcs-604 { + compatible = "seeed,grove-laced-if"; + + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = + <0 0 &grove_d0_header 0 0>, /* D0: GPIO */ + <1 0 &grove_d1_header 0 0>, /* D1: GPIO */ + <2 0 &grove_d2_header 0 0>, /* D2: GPIO */ + <3 0 &grove_d3_header 0 0>, /* D3: GPIO */ + <4 0 &grove_d4_header 0 0>; /* D4: GPIO */ + + #pwm-cells = <2>; + pwm-map-mask = <0xffffffff 0>; + pwm-map-pass-thru = <0 0xffffffff>; + pwm-map; /* not possible */ + }; +}; + +grove_gpios: &grove_laced_if_tcs_604 {}; diff --git a/boards/shields/tcs-604/grove_d0_connector.dtsi b/boards/shields/tcs-604/grove_d0_connector.dtsi new file mode 100644 index 0000000000..26999e035e --- /dev/null +++ b/boards/shields/tcs-604/grove_d0_connector.dtsi @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + grove_d0_header: grove-d0-connector { + compatible = "seeed,grove-connector"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <0 0 &sc18is604_0_gpio 0 0>, /* D0 */ + <1 0 &sc18is604_0_gpio 1 0>; /* D1 */ + }; +}; diff --git a/boards/shields/tcs-604/grove_d1_connector.dtsi b/boards/shields/tcs-604/grove_d1_connector.dtsi new file mode 100644 index 0000000000..98a7565193 --- /dev/null +++ b/boards/shields/tcs-604/grove_d1_connector.dtsi @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + grove_d1_header: grove-d1-connector { + compatible = "seeed,grove-connector"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <0 0 &sc18is604_0_gpio 1 0>, /* D1 */ + <1 0 &sc18is604_0_gpio 2 0>; /* D2 */ + }; +}; diff --git a/boards/shields/tcs-604/grove_d2_connector.dtsi b/boards/shields/tcs-604/grove_d2_connector.dtsi new file mode 100644 index 0000000000..e536834e07 --- /dev/null +++ b/boards/shields/tcs-604/grove_d2_connector.dtsi @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + grove_d2_header: grove-d2-connector { + compatible = "seeed,grove-connector"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <0 0 &sc18is604_0_gpio 2 0>, /* D2 */ + <1 0 &sc18is604_0_gpio 3 0>; /* D3 */ + }; +}; diff --git a/boards/shields/tcs-604/grove_d3_connector.dtsi b/boards/shields/tcs-604/grove_d3_connector.dtsi new file mode 100644 index 0000000000..183db86164 --- /dev/null +++ b/boards/shields/tcs-604/grove_d3_connector.dtsi @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + grove_d3_header: grove-d3-connector { + compatible = "seeed,grove-connector"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <0 0 &sc18is604_0_gpio 3 0>, /* D3 */ + <1 0 &sc18is604_0_gpio 4 0>; /* D4 */ + }; +}; diff --git a/boards/shields/tcs-604/grove_d4_connector.dtsi b/boards/shields/tcs-604/grove_d4_connector.dtsi new file mode 100644 index 0000000000..1d421bb714 --- /dev/null +++ b/boards/shields/tcs-604/grove_d4_connector.dtsi @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + grove_d4_header: grove-d4-connector { + compatible = "seeed,grove-connector"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <0 0 &sc18is604_0_gpio 4 0>; /* D4 */ + }; +}; diff --git a/boards/shields/tcs-604/sc18is604_0/core.dtsi b/boards/shields/tcs-604/sc18is604_0/core.dtsi new file mode 100644 index 0000000000..0143eba362 --- /dev/null +++ b/boards/shields/tcs-604/sc18is604_0/core.dtsi @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +&sc18is604_0 { + compatible = "nxp,sc18is604"; + status = "okay"; + + spi-max-frequency = ; + + /* RESET_B @ D8 */ + reset-gpios = <&arduino_header 14 GPIO_ACTIVE_LOW>; + + /* INT_B @ D9 */ + interrupt-gpios = <&arduino_header 15 GPIO_ACTIVE_LOW>; +}; diff --git a/boards/shields/tcs-604/sc18is604_0/gpio.dtsi b/boards/shields/tcs-604/sc18is604_0/gpio.dtsi new file mode 100644 index 0000000000..df70442741 --- /dev/null +++ b/boards/shields/tcs-604/sc18is604_0/gpio.dtsi @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +&sc18is604_0_gpio { + compatible = "nxp,sc18is604-gpio"; + status = "okay"; + + gpio-controller; + #gpio-cells = <2>; + + ngpios = <5>; + + gpio-line-names = "IO0", "IO1", "IO2", "IO3", "IO4"; +}; diff --git a/boards/shields/tcs-604/sc18is604_0/i2c.dtsi b/boards/shields/tcs-604/sc18is604_0/i2c.dtsi new file mode 100644 index 0000000000..de5af8016d --- /dev/null +++ b/boards/shields/tcs-604/sc18is604_0/i2c.dtsi @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&tcs_604_i2c { + compatible = "nxp,sc18is604-i2c"; + status = "okay"; + + #address-cells = <1>; + #size-cells = <0>; + + clock-frequency = ; +}; diff --git a/boards/shields/tcs-604/tcs_604_ard.overlay b/boards/shields/tcs-604/tcs_604_ard.overlay new file mode 100644 index 0000000000..a07fc16dcd --- /dev/null +++ b/boards/shields/tcs-604/tcs_604_ard.overlay @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +&arduino_spi { + status = "okay"; + + sc18is604_0: sc18is604@0 { + reg = <0>; + + sc18is604_0_i2c: sc18is604-0-i2c {}; + sc18is604_0_gpio: sc18is604-0-gpio {}; + }; +}; + +tcs_604_i2c: &sc18is604_0_i2c {}; + +#include "sc18is604_0/core.dtsi" +#include "sc18is604_0/i2c.dtsi" +#include "sc18is604_0/gpio.dtsi" + +#include "gpio_connector.dtsi" +#include "grove_connectors.dtsi" diff --git a/boards/shields/tcs-604/tcs_604_x_grove_testbed.overlay b/boards/shields/tcs-604/tcs_604_x_grove_testbed.overlay new file mode 100644 index 0000000000..b68d42bf29 --- /dev/null +++ b/boards/shields/tcs-604/tcs_604_x_grove_testbed.overlay @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + aliases { + led0 = &grove_led_d3; + sw0 = &grove_btn_d4; + }; +}; diff --git a/doc/bridle/links.txt b/doc/bridle/links.txt index e3b352ac42..4563297bbe 100644 --- a/doc/bridle/links.txt +++ b/doc/bridle/links.txt @@ -41,6 +41,7 @@ .. ### Links to the TiaC Systems developer zone .. _`DevZone`: https://github.com/tiacsys +.. _`TiaC Systems`: https://tiac-systems.net/ .. _`TiaC Systems Launchpad`: https://launchpad.net/~tiac-systems .. _`TiaC Systems Doxygen PPA`: https://launchpad.net/~tiac-systems/+archive/ubuntu/doxygen @@ -52,6 +53,12 @@ .. _`TiaC Magpie F777NI board User Manual`: http://www.st.com/resource/en/user_manual/dm00244518.pdf +.. _`TCS-604-ARD Schematic`: + https://drive.google.com/file/d/1ESK6vR-rOYy9SutSvAAVBB4TkhZem1DL/view?usp=sharing + +.. _`TCS-604-ARD PCBA`: + https://drive.google.com/file/d/1McMEjmS3DjAfxmi55IOcAnv3O7X2ttRu/view?usp=sharing + .. ### Links to required tools and PyPi packages