diff --git a/boards/shields/sc16is75x_bb/Kconfig.defconfig b/boards/shields/sc16is75x_bb/Kconfig.defconfig new file mode 100644 index 0000000000..9b53f5cf8d --- /dev/null +++ b/boards/shields/sc16is75x_bb/Kconfig.defconfig @@ -0,0 +1,44 @@ +# Copyright (c) 2024 TiaC Systems +# SPDX-License-Identifier: Apache-2.0 + +config SHIELD_CJMCU_750 + bool + default y if SHIELD_CJMCU_750_I2C + default y if SHIELD_CJMCU_750_I2C_NOIRQ + default y if SHIELD_CJMCU_750_SPI + default y if SHIELD_CJMCU_750_SPI_NOIRQ + default n + +config SHIELD_CJMCU_752 + bool + default y if SHIELD_CJMCU_752_I2C + default y if SHIELD_CJMCU_752_I2C_NOIRQ + default y if SHIELD_CJMCU_752_SPI + default y if SHIELD_CJMCU_752_SPI_NOIRQ + default n + +config MFD + default y + depends on SHIELD_CJMCU_750 || SHIELD_CJMCU_752 + +config I2C + default y if SHIELD_CJMCU_750_I2C || SHIELD_CJMCU_750_I2C_NOIRQ + default y if SHIELD_CJMCU_752_I2C || SHIELD_CJMCU_752_I2C_NOIRQ + depends on SHIELD_CJMCU_750 || SHIELD_CJMCU_752 + +config SPI + default y if SHIELD_CJMCU_750_SPI || SHIELD_CJMCU_750_SPI_NOIRQ + default y if SHIELD_CJMCU_752_SPI || SHIELD_CJMCU_752_SPI_NOIRQ + depends on SHIELD_CJMCU_750 || SHIELD_CJMCU_752 + +config SERIAL + default y if DT_HAS_NXP_SC16IS75X_UART_ENABLED + depends on SHIELD_CJMCU_750 || SHIELD_CJMCU_752 + +config GPIO + default y if DT_HAS_NXP_SC16IS75X_GPIO_ENABLED + depends on SHIELD_CJMCU_750 || SHIELD_CJMCU_752 + +config DYNAMIC_THREAD_POOL_SIZE + default 1 if MFD_SC16IS75X_ASYNC && !DYNAMIC_THREAD_ALLOC + depends on (SHIELD_CJMCU_750 || SHIELD_CJMCU_752) && MFD_SC16IS75X diff --git a/boards/shields/sc16is75x_bb/Kconfig.shield b/boards/shields/sc16is75x_bb/Kconfig.shield new file mode 100644 index 0000000000..483c91f1e2 --- /dev/null +++ b/boards/shields/sc16is75x_bb/Kconfig.shield @@ -0,0 +1,26 @@ +# Copyright (c) 2024 TiaC Systems +# SPDX-License-Identifier: Apache-2.0 + +config SHIELD_CJMCU_750_I2C + def_bool $(shields_list_contains,cjmcu_750_i2c) + +config SHIELD_CJMCU_750_I2C_NOIRQ + def_bool $(shields_list_contains,cjmcu_750_i2c_noirq) + +config SHIELD_CJMCU_750_SPI + def_bool $(shields_list_contains,cjmcu_750_spi) + +config SHIELD_CJMCU_750_SPI_NOIRQ + def_bool $(shields_list_contains,cjmcu_750_spi_noirq) + +config SHIELD_CJMCU_752_I2C + def_bool $(shields_list_contains,cjmcu_752_i2c) + +config SHIELD_CJMCU_752_I2C_NOIRQ + def_bool $(shields_list_contains,cjmcu_752_i2c_noirq) + +config SHIELD_CJMCU_752_SPI + def_bool $(shields_list_contains,cjmcu_752_spi) + +config SHIELD_CJMCU_752_SPI_NOIRQ + def_bool $(shields_list_contains,cjmcu_752_spi_noirq) diff --git a/boards/shields/sc16is75x_bb/cjmcu_750.dtsi b/boards/shields/sc16is75x_bb/cjmcu_750.dtsi new file mode 100644 index 0000000000..c66bcec4d1 --- /dev/null +++ b/boards/shields/sc16is75x_bb/cjmcu_750.dtsi @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "cjmcu_750/osc.dtsi" +#include "cjmcu_75x/core.dtsi" +#include "cjmcu_75x/gpio.dtsi" +#include "cjmcu_75x/uart0.dtsi" diff --git a/boards/shields/sc16is75x_bb/cjmcu_750/osc.dtsi b/boards/shields/sc16is75x_bb/cjmcu_750/osc.dtsi new file mode 100644 index 0000000000..6177093439 --- /dev/null +++ b/boards/shields/sc16is75x_bb/cjmcu_750/osc.dtsi @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + cjmcu_osc: sc16is752-osc { + compatible = "fixed-clock"; + status = "okay"; + + #clock-cells = <0>; + clock-frequency = <14746500>; + }; +}; diff --git a/boards/shields/sc16is75x_bb/cjmcu_750_i2c.overlay b/boards/shields/sc16is75x_bb/cjmcu_750_i2c.overlay new file mode 100644 index 0000000000..20ab8c49fe --- /dev/null +++ b/boards/shields/sc16is75x_bb/cjmcu_750_i2c.overlay @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "cjmcu_750_i2c_noirq.overlay" + +&cjmcu_75x { + interrupt-gpios = <&cjmcu_hif_i2c 3 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; +}; diff --git a/boards/shields/sc16is75x_bb/cjmcu_750_i2c_noirq.overlay b/boards/shields/sc16is75x_bb/cjmcu_750_i2c_noirq.overlay new file mode 100644 index 0000000000..f6d187c921 --- /dev/null +++ b/boards/shields/sc16is75x_bb/cjmcu_750_i2c_noirq.overlay @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +&cjmcu_i2c { + status = "okay"; + + clock-frequency = ; + + cjmcu_75x: sc16is750@48 { + reg = <0x48>; + + reset-gpios = <&cjmcu_hif_i2c 7 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + + cjmcu_75x_gpio: sc16is750-48-gpio {}; + cjmcu_75x_uart0: sc16is750-48-uart@0 {}; + }; +}; + +#include "cjmcu_750.dtsi" diff --git a/boards/shields/sc16is75x_bb/cjmcu_750_spi.overlay b/boards/shields/sc16is75x_bb/cjmcu_750_spi.overlay new file mode 100644 index 0000000000..b653c7c07f --- /dev/null +++ b/boards/shields/sc16is75x_bb/cjmcu_750_spi.overlay @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "cjmcu_750_spi_noirq.overlay" + +&cjmcu_75x { + interrupt-gpios = <&cjmcu_hif_spi 3 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; +}; diff --git a/boards/shields/sc16is75x_bb/cjmcu_750_spi_noirq.overlay b/boards/shields/sc16is75x_bb/cjmcu_750_spi_noirq.overlay new file mode 100644 index 0000000000..f9db4dfe8b --- /dev/null +++ b/boards/shields/sc16is75x_bb/cjmcu_750_spi_noirq.overlay @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +&cjmcu_spi { + status = "okay"; + + cjmcu_75x: sc16is750@0 { + reg = <0>; + + spi-max-frequency = ; + reset-gpios = <&cjmcu_hif_spi 7 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + + cjmcu_75x_gpio: sc16is750-0-gpio {}; + cjmcu_75x_uart0: sc16is750-0-uart@0 {}; + }; +}; + +#include "cjmcu_750.dtsi" diff --git a/boards/shields/sc16is75x_bb/cjmcu_752.dtsi b/boards/shields/sc16is75x_bb/cjmcu_752.dtsi new file mode 100644 index 0000000000..3455216d48 --- /dev/null +++ b/boards/shields/sc16is75x_bb/cjmcu_752.dtsi @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "cjmcu_752/osc.dtsi" +#include "cjmcu_75x/core.dtsi" +#include "cjmcu_75x/gpio.dtsi" +#include "cjmcu_75x/uart0.dtsi" +#include "cjmcu_75x/uart1.dtsi" diff --git a/boards/shields/sc16is75x_bb/cjmcu_752/osc.dtsi b/boards/shields/sc16is75x_bb/cjmcu_752/osc.dtsi new file mode 100644 index 0000000000..306bcbf40a --- /dev/null +++ b/boards/shields/sc16is75x_bb/cjmcu_752/osc.dtsi @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + cjmcu_osc: sc16is752-osc { + compatible = "fixed-clock"; + status = "okay"; + + #clock-cells = <0>; + clock-frequency = <1843200>; + }; +}; diff --git a/boards/shields/sc16is75x_bb/cjmcu_752_i2c.overlay b/boards/shields/sc16is75x_bb/cjmcu_752_i2c.overlay new file mode 100644 index 0000000000..93fb455915 --- /dev/null +++ b/boards/shields/sc16is75x_bb/cjmcu_752_i2c.overlay @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "cjmcu_752_i2c_noirq.overlay" + +&cjmcu_75x { + interrupt-gpios = <&cjmcu_hif_i2c 3 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; +}; diff --git a/boards/shields/sc16is75x_bb/cjmcu_752_i2c_noirq.overlay b/boards/shields/sc16is75x_bb/cjmcu_752_i2c_noirq.overlay new file mode 100644 index 0000000000..87b28637f8 --- /dev/null +++ b/boards/shields/sc16is75x_bb/cjmcu_752_i2c_noirq.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +&cjmcu_i2c { + status = "okay"; + + clock-frequency = ; + + cjmcu_75x: sc16is752@48 { + reg = <0x48>; + + reset-gpios = <&cjmcu_hif_i2c 7 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + + cjmcu_75x_gpio: sc16is752-48-gpio {}; + cjmcu_75x_uart0: sc16is752-48-uart@0 {}; + cjmcu_75x_uart1: sc16is752-48-uart@1 {}; + }; +}; + +#include "cjmcu_752.dtsi" diff --git a/boards/shields/sc16is75x_bb/cjmcu_752_spi.overlay b/boards/shields/sc16is75x_bb/cjmcu_752_spi.overlay new file mode 100644 index 0000000000..1ccb3c559d --- /dev/null +++ b/boards/shields/sc16is75x_bb/cjmcu_752_spi.overlay @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "cjmcu_752_spi_noirq.overlay" + +&cjmcu_75x { + interrupt-gpios = <&cjmcu_hif_spi 3 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; +}; diff --git a/boards/shields/sc16is75x_bb/cjmcu_752_spi_noirq.overlay b/boards/shields/sc16is75x_bb/cjmcu_752_spi_noirq.overlay new file mode 100644 index 0000000000..52500aab41 --- /dev/null +++ b/boards/shields/sc16is75x_bb/cjmcu_752_spi_noirq.overlay @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +&cjmcu_spi { + status = "okay"; + + cjmcu_75x: sc16is752@0 { + reg = <0>; + + spi-max-frequency = ; + reset-gpios = <&cjmcu_hif_spi 7 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + + cjmcu_75x_gpio: sc16is752-0-gpio {}; + cjmcu_75x_uart0: sc16is752-0-uart@0 {}; + cjmcu_75x_uart1: sc16is752-0-uart@1 {}; + }; +}; + +#include "cjmcu_752.dtsi" diff --git a/boards/shields/sc16is75x_bb/cjmcu_75x/core.dtsi b/boards/shields/sc16is75x_bb/cjmcu_75x/core.dtsi new file mode 100644 index 0000000000..6e6dc4db44 --- /dev/null +++ b/boards/shields/sc16is75x_bb/cjmcu_75x/core.dtsi @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +&cjmcu_75x { + compatible = "nxp,sc16is75x"; + status = "okay"; + + #address-cells = <1>; + #size-cells = <0>; + + clock = <&cjmcu_osc>; +}; diff --git a/boards/shields/sc16is75x_bb/cjmcu_75x/gpio.dtsi b/boards/shields/sc16is75x_bb/cjmcu_75x/gpio.dtsi new file mode 100644 index 0000000000..3e842e7531 --- /dev/null +++ b/boards/shields/sc16is75x_bb/cjmcu_75x/gpio.dtsi @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + cjmcu_gpio: cjmcu-75x-gpio-pins { + compatible = "cjmcu,75x-gpio-header"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <0 0 &cjmcu_75x_gpio 0 0>, + <1 0 &cjmcu_75x_gpio 1 0>, + <2 0 &cjmcu_75x_gpio 2 0>, + <3 0 &cjmcu_75x_gpio 3 0>, + <4 0 &cjmcu_75x_gpio 4 0>, + <5 0 &cjmcu_75x_gpio 5 0>, + <6 0 &cjmcu_75x_gpio 6 0>, + <7 0 &cjmcu_75x_gpio 7 0>; + }; +}; + +&cjmcu_75x_gpio { + compatible = "nxp,sc16is75x-gpio"; + status = "okay"; + + gpio-controller; + #gpio-cells = <2>; + ngpios = <8>; + + gpio-line-names = "IO0", "IO1", "IO2", "IO3", + "IO4", "IO5", "IO6", "IO7"; +}; diff --git a/boards/shields/sc16is75x_bb/cjmcu_75x/uart0.dtsi b/boards/shields/sc16is75x_bb/cjmcu_75x/uart0.dtsi new file mode 100644 index 0000000000..3acdde371d --- /dev/null +++ b/boards/shields/sc16is75x_bb/cjmcu_75x/uart0.dtsi @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +&cjmcu_75x_uart0 { + compatible = "nxp,sc16is75x-uart"; + status = "okay"; + + reg = <0>; + + current-speed = <115200>; + data-bits = <8>; + parity = "none"; + stop-bits = "1"; +}; diff --git a/boards/shields/sc16is75x_bb/cjmcu_75x/uart1.dtsi b/boards/shields/sc16is75x_bb/cjmcu_75x/uart1.dtsi new file mode 100644 index 0000000000..65d7674ba1 --- /dev/null +++ b/boards/shields/sc16is75x_bb/cjmcu_75x/uart1.dtsi @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +&cjmcu_75x_uart1 { + compatible = "nxp,sc16is75x-uart"; + status = "okay"; + + reg = <1>; + + current-speed = <115200>; + data-bits = <8>; + parity = "none"; + stop-bits = "1"; +}; diff --git a/boards/shields/sc16is75x_bb/doc/i2c_address_selection.rsti b/boards/shields/sc16is75x_bb/doc/i2c_address_selection.rsti new file mode 100644 index 0000000000..cb4e893737 --- /dev/null +++ b/boards/shields/sc16is75x_bb/doc/i2c_address_selection.rsti @@ -0,0 +1,106 @@ +.. list-table:: I2C address selection. + :stub-columns: 2 + :header-rows: 1 + :align: center + + * - A1 + - A2 + - raw address + - 8-bit address + - 7-bit address (shifted) + + * - V\ :sub:`DD` + - V\ :sub:`DD` + - 1001 000X + - *0x90* + - **0x48** + + * - V\ :sub:`DD` + - V\ :sub:`SS` + - 1001 001X + - *0x92* + - **0x49** + + * - V\ :sub:`DD` + - SCL + - 1001 010X + - *0x94* + - **0x4A** + + * - V\ :sub:`DD` + - SDA + - 1001 011X + - *0x96* + - **0x4B** + + * - V\ :sub:`SS` + - V\ :sub:`DD` + - 1001 100X + - *0x98* + - **0x4C** + + * - V\ :sub:`SS` + - V\ :sub:`SS` + - 1001 101X + - *0x9A* + - **0x4D** + + * - V\ :sub:`SS` + - SCL + - 1001 110X + - *0x9C* + - **0x4E** + + * - V\ :sub:`SS` + - SDA + - 1001 111X + - *0x9E* + - **0x4F** + + * - SCL + - V\ :sub:`DD` + - 1010 000X + - *0xA0* + - **0x50** + + * - SCL + - V\ :sub:`SS` + - 1010 001X + - *0xA2* + - **0x51** + + * - SCL + - SCL + - 1010 010X + - *0xA4* + - **0x52** + + * - SCL + - SDA + - 1010 011X + - *0xA6* + - **0x53** + + * - SDA + - V\ :sub:`DD` + - 1010 100X + - *0xA8* + - **0x54** + + * - SDA + - V\ :sub:`SS` + - 1010 101X + - *0xAA* + - **0x55** + + * - SDA + - SCL + - 1010 110X + - *0xAC* + - **0x56** + + * - SDA + - SDA + - 1010 111X + - *0xAE* + - **0x57** diff --git a/boards/shields/sc16is75x_bb/doc/img/BOB-09745.jpg b/boards/shields/sc16is75x_bb/doc/img/BOB-09745.jpg new file mode 100644 index 0000000000..76aa0dcc97 Binary files /dev/null and b/boards/shields/sc16is75x_bb/doc/img/BOB-09745.jpg differ diff --git a/boards/shields/sc16is75x_bb/doc/img/BOB-09981.jpg b/boards/shields/sc16is75x_bb/doc/img/BOB-09981.jpg new file mode 100644 index 0000000000..59c5601e92 Binary files /dev/null and b/boards/shields/sc16is75x_bb/doc/img/BOB-09981.jpg differ diff --git a/boards/shields/sc16is75x_bb/doc/img/BOB-09xxx-IRQ-fix.jpg b/boards/shields/sc16is75x_bb/doc/img/BOB-09xxx-IRQ-fix.jpg new file mode 100644 index 0000000000..21bb7444d0 Binary files /dev/null and b/boards/shields/sc16is75x_bb/doc/img/BOB-09xxx-IRQ-fix.jpg differ diff --git a/boards/shields/sc16is75x_bb/doc/img/CJMCU-750-IRQ-fix.jpg b/boards/shields/sc16is75x_bb/doc/img/CJMCU-750-IRQ-fix.jpg new file mode 100644 index 0000000000..eef31d6341 Binary files /dev/null and b/boards/shields/sc16is75x_bb/doc/img/CJMCU-750-IRQ-fix.jpg differ diff --git a/boards/shields/sc16is75x_bb/doc/img/CJMCU-750.jpg b/boards/shields/sc16is75x_bb/doc/img/CJMCU-750.jpg new file mode 100644 index 0000000000..3fb56e6436 Binary files /dev/null and b/boards/shields/sc16is75x_bb/doc/img/CJMCU-750.jpg differ diff --git a/boards/shields/sc16is75x_bb/doc/img/CJMCU-752.jpg b/boards/shields/sc16is75x_bb/doc/img/CJMCU-752.jpg new file mode 100644 index 0000000000..6200f22cba Binary files /dev/null and b/boards/shields/sc16is75x_bb/doc/img/CJMCU-752.jpg differ diff --git a/boards/shields/sc16is75x_bb/doc/img/GT-SC16IS750.jpg b/boards/shields/sc16is75x_bb/doc/img/GT-SC16IS750.jpg new file mode 100644 index 0000000000..ecb6c79360 Binary files /dev/null and b/boards/shields/sc16is75x_bb/doc/img/GT-SC16IS750.jpg differ diff --git a/boards/shields/sc16is75x_bb/doc/img/SC16IS750-BD-I2C.jpg b/boards/shields/sc16is75x_bb/doc/img/SC16IS750-BD-I2C.jpg new file mode 100644 index 0000000000..966f7850b8 Binary files /dev/null and b/boards/shields/sc16is75x_bb/doc/img/SC16IS750-BD-I2C.jpg differ diff --git a/boards/shields/sc16is75x_bb/doc/img/SC16IS750-BD-SPI.jpg b/boards/shields/sc16is75x_bb/doc/img/SC16IS750-BD-SPI.jpg new file mode 100644 index 0000000000..d9be7fc7aa Binary files /dev/null and b/boards/shields/sc16is75x_bb/doc/img/SC16IS750-BD-SPI.jpg differ diff --git a/boards/shields/sc16is75x_bb/doc/img/SC16IS752-BD-I2C.jpg b/boards/shields/sc16is75x_bb/doc/img/SC16IS752-BD-I2C.jpg new file mode 100644 index 0000000000..7004600e02 Binary files /dev/null and b/boards/shields/sc16is75x_bb/doc/img/SC16IS752-BD-I2C.jpg differ diff --git a/boards/shields/sc16is75x_bb/doc/img/SC16IS752-BD-SPI.jpg b/boards/shields/sc16is75x_bb/doc/img/SC16IS752-BD-SPI.jpg new file mode 100644 index 0000000000..2fb63bbbee Binary files /dev/null and b/boards/shields/sc16is75x_bb/doc/img/SC16IS752-BD-SPI.jpg differ diff --git a/boards/shields/sc16is75x_bb/doc/img/WCMCU-750.jpg b/boards/shields/sc16is75x_bb/doc/img/WCMCU-750.jpg new file mode 100644 index 0000000000..13380965ee Binary files /dev/null and b/boards/shields/sc16is75x_bb/doc/img/WCMCU-750.jpg differ diff --git a/boards/shields/sc16is75x_bb/doc/img/WCMCU-752.jpg b/boards/shields/sc16is75x_bb/doc/img/WCMCU-752.jpg new file mode 100644 index 0000000000..da32da7a30 Binary files /dev/null and b/boards/shields/sc16is75x_bb/doc/img/WCMCU-752.jpg differ diff --git a/boards/shields/sc16is75x_bb/doc/index.rst b/boards/shields/sc16is75x_bb/doc/index.rst new file mode 100644 index 0000000000..f4dbbb2178 --- /dev/null +++ b/boards/shields/sc16is75x_bb/doc/index.rst @@ -0,0 +1,386 @@ +.. _sc16is75x_bb_shield: + +SC16IS75x Breakout Boards +######################### + +This is a collection of very simple and often copied breakout boards as Zephyr +:ref:`shield ` based on the NXP SC16IS750_ or SC16IS752_ chip, +a bridge from an :ref:`I2C ` or :ref:`SPI ` +bus to a single or dual channel :ref:`UART ` with integrated +:ref:`GPIO ` controller. The origin of all breakout boards was +the BOB-09981_ (BOB-09745_) design from SparkFun with the single-channel +UART/GPIO bridge. This is available both as a one-to-one clone and as a modified +version with a two-channel UART/GPIO bridge from |CJMCU|_ or |Q-Baihe|_. + +Operation and connection +************************ + +All breakout boards contain only the essential components required to operate +the bridge IC. These are a crystal for clock provision, blocking capacitors, +important pull-up resistors and a small 3.3V power supply. Any additional +circuits or components required must be provided externally. The single channel +UART/GPIO breakout boards use the NXP SC16IS750_. The dual channel UART/GPIO +breakout boards use the NXP SC16IS752_. The user is free to select either an +I2C or an SPI bus to operate with the bridge IC. The selection is made via +the pin labeled ``I2C/SPI`` on one of the headers. See figures below. + +All bridge ICs are interrupt-capable (``/IRQ``) and can be reset by a hardware +reset (``/RESET``). Breakout boards with a **SC16IS750** (*single channel*) +have a crystal with a fixed frequency of **14.7456MHz**. Breakout boards with +a **SC16IS752** (*dual channel*) have a crystal with a fixed frequency of +**1.8432MHz**. + +SPI bus operation +================= + +The SC16IS750 or SC16IS752 works in SPI bus operation mode when ``I2C/SPI`` +set to **Low**. + +.. list-table:: + :header-rows: 1 + :align: center + + * - .. image:: img/SC16IS750-BD-SPI.jpg + :align: center + - .. image:: img/SC16IS752-BD-SPI.jpg + :align: center + + * - SC16IS750 on SPI bus + - SC16IS752 on SPI bus + +Multiple bridge ICs can be used by connecting the SPI ``/CS`` signal to +different outputs of the SPI host controller. + +.. note:: + + Despite what may be printed on the PCB, when using the SC16IS750 or + SC16IS752 in SPI mode, the ``SDA`` pin should be held low or open, + not high. Otherwise, interrupt handling may not function correctly. + +I2C bus operation +================= + +The SC16IS750 or SC16IS752 works in I2C bus operation mode when ``I2C/SPI`` +set to **High**. + +.. list-table:: + :header-rows: 1 + :align: center + + * - .. image:: img/SC16IS750-BD-I2C.jpg + :align: center + - .. image:: img/SC16IS752-BD-I2C.jpg + :align: center + + * - SC16IS750 on I2C bus + - SC16IS752 on I2C bus + +Multiple bridge ICs can be operated on a single I2C host controller by +correctly wiring the I2C address select pins ``A0`` and ``A1``. See the +following table. + +.. include:: i2c_address_selection.rsti + +Supported Shields +***************** + +Single-channel UART/GPIO bridge +=============================== + +.. tabs:: + + .. group-tab:: SparkFun BOB-09745 + + :brd:`OBSOLETE and UNSUPPORTED`, use BOB-09981 instead! + + .. image:: img/BOB-09745.jpg + :align: center + :width: 33% + + The BOB-09745_ is the original breakout board from SparkFun in the + early first **revision v1.2** with a :brd:`12.2880MHz` crystal. This + revision is not supported by this shield abstraction, as a + :brd:`crystal` is populated :brd:`with an unsuitable value`! + + - `BOB-09745 Schematic`_ + - Git: https://github.com/sparkfun/SC16IS750_Breakout/tree/v_1.3 + - `SC16IS750 Datasheet`_ + + .. warning:: + + .. image:: img/BOB-09xxx-IRQ-fix.jpg + :align: right + + The board contains a design defect resulting in the interrupt pin + (``/IRQ``) of the SC16IS750 not being physically connected to the + board outputs. + + See also: https://github.com/sparkfun/SC16IS750_Breakout/issues/1 + + However, this error can be fixed by soldering a small wire bridge + from pin 11 (``/IRQ``) of the SC16IS750, or rather the one side of + the related pull-up resistor, to the pin header directly to the + left side of it. See the enclosed illustration. + + .. group-tab:: SparkFun BOB-09981 + + :byl:`SUPPORTED` but :brd:`FAULTY HARDWARE` + + .. image:: img/BOB-09981.jpg + :align: center + :width: 33% + + The BOB-09981_ is the original breakout board from SparkFun in the + redesigned **revision v1.3** with a :bgn:`14.7456MHz` crystal to + :bgn:`allow baud rates from 9600 up to 921600`. + + - `BOB-09981 Schematic`_ + - Git: https://github.com/sparkfun/SC16IS750_Breakout/tree/v_1.3 + - `SC16IS750 Datasheet`_ + + .. warning:: + + .. image:: img/BOB-09xxx-IRQ-fix.jpg + :align: right + + The board contains a design defect resulting in the interrupt pin + (``/IRQ``) of the SC16IS750 not being physically connected to the + board outputs. + + See also: https://github.com/sparkfun/SC16IS750_Breakout/issues/1 + + However, this error can be fixed by soldering a small wire bridge + from pin 11 (``/IRQ``) of the SC16IS750, or rather the one side of + the related pull-up resistor, to the pin header directly to the + left side of it. See the enclosed illustration. + + .. group-tab:: CJMCU-750 + + :byl:`SUPPORTED` but :brd:`FAULTY HARDWARE` + + .. image:: img/CJMCU-750.jpg + :align: center + :width: 33% + + The `CJMCU-750 `_ is a widely used clone based on the original + SparkFun breakout board and :brd:`has the exact same design flaws!` + + - `SC16IS750 Datasheet`_ + + .. warning:: + + .. image:: img/CJMCU-750-IRQ-fix.jpg + :align: right + + The unconnected interrupt line was copied from the faulty original + design, the interrupt pin (``/IRQ``) of the SC16IS750 not being + physically connected to the board outputs. + + See also: https://github.com/sparkfun/SC16IS750_Breakout/issues/1 + + However, this error can be fixed by soldering a small wire bridge + from pin 11 (``/IRQ``) of the SC16IS750, or rather the one side of + the related pull-up resistor, to the pin header directly to the + left side of it. See the enclosed illustration. + + .. group-tab:: Q-Baihe GT-SC16IS750 + + :bgn:`SUPPORTED (best choice)` + + .. image:: img/GT-SC16IS750.jpg + :align: center + :width: 33% + + The `GT-SC16IS750`_ is a very rare clone based on the original SparkFun + breakout board, **but with the missing interrupt line fixed!** This copy + corresponds to the design **revision v1.4** from SparkFun. + + - `GT-SC16IS750 Schematic`_ + - Git: https://github.com/sparkfun/SC16IS750_Breakout/tree/v_1.4 + - `SC16IS750 Datasheet`_ + +Dual-channel UART/GPIO bridge +============================= + +Derived from the single-channel breakout board, the new development from +|CJMCU|_ and its clones with an SC16IS752 are also supported. These feature +a dual-channel UART/GPIO bridge. All this boards coming with a **1.8432MHz** +crystal. There are no circuit documents for any of the dual-channel breakout +boards. + +.. tabs:: + + .. group-tab:: CJMCU-752 + + .. image:: img/CJMCU-752.jpg + :align: center + :width: 33% + + - `SC16IS752 Datasheet`_ + + .. group-tab:: WCMCU-752 + + .. image:: img/WCMCU-752.jpg + :align: center + :width: 33% + + - `SC16IS752 Datasheet`_ + +Utilization +*********** + +The shield abstraction of these breakout boards is deliberately kept small. +It is purely for evaluating the necessary drivers and Devicetree bindings +on known integration platforms. Due to the large number of clones and the +associated PCB designations and product names, only two basic shield names +are used and extended by the respective short name of the serial peripheral +bus to be used. A special case is the suffix ``_noirq``. This is necessary +if a faulty single-channel breakout board **without interrupt line** is to +be used. The various connectors on the single and dual channel boards are +generally defined using their own Nyxus header bindings: + +.. list-table:: + :stub-columns: 1 + :header-rows: 1 + :align: center + + * - + - I2C shield names + - SPI shield names + - DTS header bindings + + * - SC16IS750 + - | ``cjmcu_750_i2c`` + | ``cjmcu_750_i2c_noirq`` + - | ``cjmcu_750_spi`` + | ``cjmcu_750_spi_noirq`` + - | :dtcompatible:`cjmcu,75x-hif-header` + | :dtcompatible:`cjmcu,75x-gpio-header` + + * - SC16IS752 + - | ``cjmcu_752_i2c`` + | ``cjmcu_752_i2c_noirq`` + - | ``cjmcu_752_spi`` + | ``cjmcu_752_spi_noirq`` + - | :dtcompatible:`cjmcu,75x-hif-header` + | :dtcompatible:`cjmcu,75x-gpio-header` + +This shields can be used with any development board or shield that provides +a Devicetree node with the :dtcompatible:`cjmcu,75x-hif-header` property in +the compatibility. That is needed for GPIO mapping of the reset and optional +interrupt line. Users can rely on the :ref:`x_cjmcu_75x_shield` or create +their own interconnection shields with the necessary mappings in them. + +Programming +=========== + +.. tabs:: + + .. group-tab:: Single-channel UART/GPIO bridge (SC16IS750) + + .. tabs:: + + .. group-tab:: SPI + + .. zephyr-app-commands:: + :app: bridle/samples/helloshell + :build-dir: cjmcu_750 + :board: nucleo_f746zg + :shield: "x_cjmcu_75x cjmcu_750_spi" + :west-args: -p always + :goals: flash + :host-os: unix + :compact: + + .. rubric:: Interrupt disabled + + .. zephyr-app-commands:: + :app: bridle/samples/helloshell + :build-dir: cjmcu_750 + :board: nucleo_f746zg + :shield: "x_cjmcu_75x cjmcu_750_spi_noirq" + :west-args: -p always + :goals: flash + :host-os: unix + :compact: + + .. group-tab:: I2C + + .. zephyr-app-commands:: + :app: bridle/samples/helloshell + :build-dir: cjmcu_750 + :board: nucleo_f746zg + :shield: "x_cjmcu_75x cjmcu_750_i2c" + :west-args: -p always + :goals: flash + :host-os: unix + :compact: + + .. rubric:: Interrupt disabled + + .. zephyr-app-commands:: + :app: bridle/samples/helloshell + :build-dir: cjmcu_750 + :board: nucleo_f746zg + :shield: "x_cjmcu_75x cjmcu_750_i2c_noirq" + :west-args: -p always + :goals: flash + :host-os: unix + :compact: + + .. group-tab:: Dual-channel UART/GPIO bridge (SC16IS752) + + .. tabs:: + + .. group-tab:: SPI + + .. zephyr-app-commands:: + :app: bridle/samples/helloshell + :build-dir: cjmcu_752 + :board: nucleo_f746zg + :shield: "x_cjmcu_75x cjmcu_752_spi" + :west-args: -p always + :goals: flash + :host-os: unix + :compact: + + .. rubric:: Interrupt disabled + + .. zephyr-app-commands:: + :app: bridle/samples/helloshell + :build-dir: cjmcu_752 + :board: nucleo_f746zg + :shield: "x_cjmcu_75x cjmcu_752_spi_noirq" + :west-args: -p always + :goals: flash + :host-os: unix + :compact: + + .. group-tab:: I2C + + .. zephyr-app-commands:: + :app: bridle/samples/helloshell + :build-dir: cjmcu_752 + :board: nucleo_f746zg + :shield: "x_cjmcu_75x cjmcu_752_i2c" + :west-args: -p always + :goals: flash + :host-os: unix + :compact: + + .. rubric:: Interrupt disabled + + .. zephyr-app-commands:: + :app: bridle/samples/helloshell + :build-dir: cjmcu_752 + :board: nucleo_f746zg + :shield: "x_cjmcu_75x cjmcu_752_i2c_noirq" + :west-args: -p always + :goals: flash + :host-os: unix + :compact: + +References +********** + +.. target-notes:: diff --git a/boards/shields/x_cjmcu_75x/Kconfig.defconfig b/boards/shields/x_cjmcu_75x/Kconfig.defconfig new file mode 100644 index 0000000000..52401faf68 --- /dev/null +++ b/boards/shields/x_cjmcu_75x/Kconfig.defconfig @@ -0,0 +1,5 @@ +# Copyright (c) 2024 TiaC Systems +# SPDX-License-Identifier: Apache-2.0 + +# This file is intentionally empty. Please confer with shield documentation +# for instructions to use this shield. diff --git a/boards/shields/x_cjmcu_75x/Kconfig.shield b/boards/shields/x_cjmcu_75x/Kconfig.shield new file mode 100644 index 0000000000..70343de218 --- /dev/null +++ b/boards/shields/x_cjmcu_75x/Kconfig.shield @@ -0,0 +1,5 @@ +# Copyright (c) 2024 TiaC Systems +# SPDX-License-Identifier: Apache-2.0 + +config SHIELD_X_CJMCU_75X + def_bool $(shields_list_contains,x_cjmcu_75x) diff --git a/boards/shields/x_cjmcu_75x/boards/arduino_to_cjmcu_if.dtsi b/boards/shields/x_cjmcu_75x/boards/arduino_to_cjmcu_if.dtsi new file mode 100644 index 0000000000..d789e00a00 --- /dev/null +++ b/boards/shields/x_cjmcu_75x/boards/arduino_to_cjmcu_if.dtsi @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +cjmcu_i2c: &arduino_i2c {}; +cjmcu_spi: &arduino_spi {}; + +/ { + cjmcu_hif_i2c: cjmcu-75x-hif-i2c-pins { + compatible = "cjmcu,75x-hif-header"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <0 0 &arduino_header 20 0>, /* SDA @ D18 (D14) */ + <1 0 &arduino_header 21 0>, /* SCL @ D19 (D14) */ + /* 2: I2C/nSPI signal set to high (VCC) */ + <3 0 &arduino_header 15 0>, /* nIRQ @ D9 */ + /* 4: NC/SO signal not connected */ + /* 5: A1/SI signal set to I2C addr. select */ + /* 6: A0/CS signal set to I2C addr. select */ + <7 0 &arduino_header 14 0>; /* nRESET @ D8 */ + }; + + cjmcu_hif_spi: cjmcu-75x-hif-spi-pins { + compatible = "cjmcu,75x-hif-header"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = /* 0: SDA/NC signal not connected */ + <1 0 &arduino_header 19 0>, /* SCLK @ D13 (SCK) */ + /* 2: I2C/nSPI signal set to low (GND) */ + <3 0 &arduino_header 15 0>, /* nIRQ @ D9 */ + <4 0 &arduino_header 18 0>, /* SO @ D12 (CIPO) */ + <5 0 &arduino_header 17 0>, /* SI @ D11 (COPI) */ + <6 0 &arduino_header 16 0>, /* CS @ D10 (SS) */ + <7 0 &arduino_header 14 0>; /* nRESET @ D8 */ + }; +}; diff --git a/boards/shields/x_cjmcu_75x/boards/nucleo_f303re.overlay b/boards/shields/x_cjmcu_75x/boards/nucleo_f303re.overlay new file mode 100644 index 0000000000..cd318087d3 --- /dev/null +++ b/boards/shields/x_cjmcu_75x/boards/nucleo_f303re.overlay @@ -0,0 +1,6 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "arduino_to_cjmcu_if.dtsi" diff --git a/boards/shields/x_cjmcu_75x/boards/nucleo_f401re.overlay b/boards/shields/x_cjmcu_75x/boards/nucleo_f401re.overlay new file mode 100644 index 0000000000..cd318087d3 --- /dev/null +++ b/boards/shields/x_cjmcu_75x/boards/nucleo_f401re.overlay @@ -0,0 +1,6 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "arduino_to_cjmcu_if.dtsi" diff --git a/boards/shields/x_cjmcu_75x/boards/nucleo_f413zh.overlay b/boards/shields/x_cjmcu_75x/boards/nucleo_f413zh.overlay new file mode 100644 index 0000000000..cd318087d3 --- /dev/null +++ b/boards/shields/x_cjmcu_75x/boards/nucleo_f413zh.overlay @@ -0,0 +1,6 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "arduino_to_cjmcu_if.dtsi" diff --git a/boards/shields/x_cjmcu_75x/boards/nucleo_f746zg.overlay b/boards/shields/x_cjmcu_75x/boards/nucleo_f746zg.overlay new file mode 100644 index 0000000000..cd318087d3 --- /dev/null +++ b/boards/shields/x_cjmcu_75x/boards/nucleo_f746zg.overlay @@ -0,0 +1,6 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "arduino_to_cjmcu_if.dtsi" diff --git a/boards/shields/x_cjmcu_75x/boards/nucleo_f767zi.overlay b/boards/shields/x_cjmcu_75x/boards/nucleo_f767zi.overlay new file mode 100644 index 0000000000..cd318087d3 --- /dev/null +++ b/boards/shields/x_cjmcu_75x/boards/nucleo_f767zi.overlay @@ -0,0 +1,6 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "arduino_to_cjmcu_if.dtsi" diff --git a/boards/shields/x_cjmcu_75x/doc/TCS-750-i2c-ard.fzz b/boards/shields/x_cjmcu_75x/doc/TCS-750-i2c-ard.fzz new file mode 100644 index 0000000000..32c682fa71 Binary files /dev/null and b/boards/shields/x_cjmcu_75x/doc/TCS-750-i2c-ard.fzz differ diff --git a/boards/shields/x_cjmcu_75x/doc/TCS-750-spi-ard.fzz b/boards/shields/x_cjmcu_75x/doc/TCS-750-spi-ard.fzz new file mode 100644 index 0000000000..d69bef553e Binary files /dev/null and b/boards/shields/x_cjmcu_75x/doc/TCS-750-spi-ard.fzz differ diff --git a/boards/shields/x_cjmcu_75x/doc/arduino_to_cjmcu_hif_map.rsti b/boards/shields/x_cjmcu_75x/doc/arduino_to_cjmcu_hif_map.rsti new file mode 100644 index 0000000000..15dfa1c819 --- /dev/null +++ b/boards/shields/x_cjmcu_75x/doc/arduino_to_cjmcu_hif_map.rsti @@ -0,0 +1,143 @@ +.. list-table:: + :class: longtable + :align: center + :header-rows: 1 + + * - Arduino Uno (R3) + - :dtcompatible:`arduino-header-r3` + - :dtcompatible:`cjmcu,75x-hif-header` + - :ref:`sc16is75x_bb_shield` + + * - :rpi-pico-vdd:`3V3` + - + - + - :rpi-pico-vdd:`VCC` + + * - :rpi-pico-vdd:`3V3` + - + - :rpi-pico-pin:`2` + - for :rpi-pico-sys:`I2C` + + * - :rpi-pico-adc:`A0` / + :rpi-pico-pio:`D14` + - :rpi-pico-pin:`0` + - + - + + * - :rpi-pico-adc:`A1` / + :rpi-pico-pio:`D15` + - :rpi-pico-pin:`1` + - + - + + * - :rpi-pico-adc:`A2` / + :rpi-pico-pio:`D16` + - :rpi-pico-pin:`2` + - + - + + * - :rpi-pico-adc:`A3` / + :rpi-pico-pio:`D17` + - :rpi-pico-pin:`3` + - + - + + * - :rpi-pico-adc:`A4` / + :rpi-pico-pio:`D18` / + :rpi-pico-i2c-dfl:`SDA` + - :rpi-pico-pin:`4` / + :rpi-pico-pin:`20` + - :rpi-pico-pin:`0` + - :rpi-pico-i2c:`SDA` + + * - :rpi-pico-adc:`A5` / + :rpi-pico-pio:`D19` / + :rpi-pico-i2c-dfl:`SCL` + - :rpi-pico-pin:`5` / + :rpi-pico-pin:`21` + - :rpi-pico-pin:`1` + - :rpi-pico-i2c:`SCL` + + * - :rpi-pico-pio:`D0` + - :rpi-pico-pin:`6` + - + - + + * - :rpi-pico-pio:`D1` + - :rpi-pico-pin:`7` + - + - + + * - :rpi-pico-pio:`D2` + - :rpi-pico-pin:`8` + - + - + + * - :rpi-pico-pio:`D3` + - :rpi-pico-pin:`9` + - + - + + * - :rpi-pico-pio:`D4` + - :rpi-pico-pin:`10` + - + - + + * - :rpi-pico-pio:`D5` + - :rpi-pico-pin:`11` + - + - + + * - :rpi-pico-pio:`D6` + - :rpi-pico-pin:`12` + - + - + + * - :rpi-pico-pio:`D7` + - :rpi-pico-pin:`13` + - + - + + * - :rpi-pico-pio:`D8` + - :rpi-pico-pin:`14` + - :rpi-pico-pin:`7` + - :rpi-pico-pio:`nRESET` + + * - :rpi-pico-pio:`D9` + - :rpi-pico-pin:`15` + - :rpi-pico-pin:`3` + - :rpi-pico-pio:`nIRQ` + + * - :rpi-pico-pio:`D10` / + :rpi-pico-spi-dfl:`SS` + - :rpi-pico-pin:`16` + - :rpi-pico-pin:`6` + - :rpi-pico-spi:`CS` + + * - :rpi-pico-pio:`D11` / + :rpi-pico-spi-dfl:`COPI` + - :rpi-pico-pin:`17` + - :rpi-pico-pin:`5` + - :rpi-pico-spi:`SI` + + * - :rpi-pico-pio:`D12` / + :rpi-pico-spi-dfl:`CIPO` + - :rpi-pico-pin:`18` + - :rpi-pico-pin:`4` + - :rpi-pico-spi:`SO` + + * - :rpi-pico-pio:`D13` / + :rpi-pico-spi-dfl:`SCK` + - :rpi-pico-pin:`19` + - :rpi-pico-pin:`1` + - :rpi-pico-spi:`SCLK` + + * - :rpi-pico-gnd:`GND` + - + - :rpi-pico-pin:`2` + - for :rpi-pico-sys:`SPI` + + * - :rpi-pico-gnd:`GND` + - + - + - :rpi-pico-gnd:`GND` diff --git a/boards/shields/x_cjmcu_75x/doc/img/TCS-750-i2c-ard_bb.png b/boards/shields/x_cjmcu_75x/doc/img/TCS-750-i2c-ard_bb.png new file mode 100644 index 0000000000..cb4671b4b9 Binary files /dev/null and b/boards/shields/x_cjmcu_75x/doc/img/TCS-750-i2c-ard_bb.png differ diff --git a/boards/shields/x_cjmcu_75x/doc/img/TCS-750-i2c-ard_pcb.png b/boards/shields/x_cjmcu_75x/doc/img/TCS-750-i2c-ard_pcb.png new file mode 100644 index 0000000000..971b70bb63 Binary files /dev/null and b/boards/shields/x_cjmcu_75x/doc/img/TCS-750-i2c-ard_pcb.png differ diff --git a/boards/shields/x_cjmcu_75x/doc/img/TCS-750-i2c-ard_schem.png b/boards/shields/x_cjmcu_75x/doc/img/TCS-750-i2c-ard_schem.png new file mode 100644 index 0000000000..b847199e64 Binary files /dev/null and b/boards/shields/x_cjmcu_75x/doc/img/TCS-750-i2c-ard_schem.png differ diff --git a/boards/shields/x_cjmcu_75x/doc/img/TCS-750-spi-ard_bb.png b/boards/shields/x_cjmcu_75x/doc/img/TCS-750-spi-ard_bb.png new file mode 100644 index 0000000000..d3313ce0a5 Binary files /dev/null and b/boards/shields/x_cjmcu_75x/doc/img/TCS-750-spi-ard_bb.png differ diff --git a/boards/shields/x_cjmcu_75x/doc/img/TCS-750-spi-ard_pcb.png b/boards/shields/x_cjmcu_75x/doc/img/TCS-750-spi-ard_pcb.png new file mode 100644 index 0000000000..f01bc51d59 Binary files /dev/null and b/boards/shields/x_cjmcu_75x/doc/img/TCS-750-spi-ard_pcb.png differ diff --git a/boards/shields/x_cjmcu_75x/doc/img/TCS-750-spi-ard_schem.png b/boards/shields/x_cjmcu_75x/doc/img/TCS-750-spi-ard_schem.png new file mode 100644 index 0000000000..9f4925ed68 Binary files /dev/null and b/boards/shields/x_cjmcu_75x/doc/img/TCS-750-spi-ard_schem.png differ diff --git a/boards/shields/x_cjmcu_75x/doc/index.rst b/boards/shields/x_cjmcu_75x/doc/index.rst new file mode 100644 index 0000000000..301c43801c --- /dev/null +++ b/boards/shields/x_cjmcu_75x/doc/index.rst @@ -0,0 +1,170 @@ +.. _x_cjmcu_75x_shield: + +CJMCU-75x Interconnection Shield +################################ + +Overview +******** + +This shield is less a plug-on module in the conventional sense than more +a wiring for interconnection of certain signals from a board down to the +:ref:`sc16is75x_bb_shield`. + +Requirements +************ + +This shield requires a board which provides a configuration that allows: + +- two GPIO lines, 1st for reset output and 2nd for optional interrupt input +- one SPI interface, COPI for output and CIPO for input +- one I2C interfaces, SDA and SCL for peripheral + +Supported variations +******************** + +The table below suggests shield variation often found on many development +boards: + ++--------------------+--------------------------+-----------+ +| Connector Standard | Shield Designation | Variation | ++====================+==========================+===========+ +| Without standard | **needs board adaption** | 1 | ++--------------------+--------------------------+-----------+ +| |Arduino UNO R3| | |arduino_to_cjmcu_if| | 2 | ++--------------------+--------------------------+-----------+ +| |MikroBus| | (:yl:`not yet, planned`) | 3 | ++--------------------+--------------------------+-----------+ + +.. |arduino_to_cjmcu_if| replace:: + :bridle_file:`boards/arduino_to_cjmcu_if.dtsi + ` + +Arduino Uno (R3) headers +======================== + +The connector standard |Arduino UNO R3| can be used with a variety of +development boards that provide it. Any of these boards must be added +separately. For example, the file |nucleo_f746zg_overlay| exists for +the :ref:`zephyr:nucleo_f746zg_board` and simply integrates the +generally valid interface |arduino_to_cjmcu_if|: + +.. literalinclude:: ../boards/nucleo_f746zg.overlay + :caption: nucleo_f746zg.overlay (as an example) + :language: DTS + :encoding: ISO-8859-1 + :emphasize-lines: 1 + :linenos: + :start-at: arduino_to_cjmcu_if.dtsi + :end-at: arduino_to_cjmcu_if.dtsi + +.. |nucleo_f746zg_overlay| replace:: + :bridle_file:`boards/nucleo_f746zg.overlay + ` + +.. rubric:: Serial Bus and GPIO Mapping + +.. list-table:: + :class: longtable + :align: center + :widths: 50, 50 + :header-rows: 1 + + * - I2C Host Interface + - SPI Host Interface + * - .. literalinclude:: ../boards/arduino_to_cjmcu_if.dtsi + :caption: arduino_to_cjmcu_if.dtsi: I2C serial bus mapping + :language: DTS + :encoding: ISO-8859-1 + :emphasize-lines: 1 + :linenos: + :start-at: cjmcu_i2c + :end-at: cjmcu_i2c + .. literalinclude:: ../boards/arduino_to_cjmcu_if.dtsi + :caption: arduino_to_cjmcu_if.dtsi: I2C host interface GPIO mapping + :language: DTS + :encoding: ISO-8859-1 + :emphasize-lines: 2,7,8,10,14 + :linenos: + :prepend: / { + :start-at: cjmcu_hif_i2c + :end-at: }; + :append: }; + - .. literalinclude:: ../boards/arduino_to_cjmcu_if.dtsi + :caption: arduino_to_cjmcu_if.dtsi: SPI serial bus mapping + :language: DTS + :encoding: ISO-8859-1 + :emphasize-lines: 1 + :linenos: + :start-at: cjmcu_spi + :end-at: cjmcu_spi + .. literalinclude:: ../boards/arduino_to_cjmcu_if.dtsi + :caption: arduino_to_cjmcu_if.dtsi: SPI host interface GPIO mapping + :language: DTS + :encoding: ISO-8859-1 + :emphasize-lines: 2,8,10,11,12,13,14 + :linenos: + :prepend: / { + :start-at: cjmcu_hif_spi + :end-at: }; + :append: }; + +.. rubric:: Interconnection + +.. include:: arduino_to_cjmcu_hif_map.rsti + +Sample Prototypes +----------------- + +.. tabs:: + + .. group-tab:: CJMCU-750 (SC16IS750) on I2C bus + + * Fritzing project file: :download:`TCS-750-i2c-ard.fzz` + + .. list-table:: + :align: center + :width: 100% + :widths: 55, 45 + + * - .. rubric:: Schematic (not for production) + - .. rubric:: Prototype and Printed Circuit Board + + * - .. image:: img/TCS-750-i2c-ard_schem.png + :align: center + :alt: TCS-750-i2c-ard Schematic + - .. image:: img/TCS-750-i2c-ard_bb.png + :align: center + :alt: TCS-750-i2c-ard Prototype + .. image:: img/TCS-750-i2c-ard_pcb.png + :align: center + :alt: TCS-750-i2c-ard PCB + + .. group-tab:: CJMCU-750 (SC16IS750) on SPI bus + + * Fritzing project file: :download:`TCS-750-spi-ard.fzz` + + .. list-table:: + :align: center + :width: 100% + :widths: 55, 45 + + * - .. rubric:: Schematic (not for production) + - .. rubric:: Prototype and Printed Circuit Board + + * - .. image:: img/TCS-750-spi-ard_schem.png + :align: center + :alt: TCS-750-spi-ard Schematic + - .. image:: img/TCS-750-spi-ard_bb.png + :align: center + :alt: TCS-750-spi-ard Prototype + .. image:: img/TCS-750-spi-ard_pcb.png + :align: center + :alt: TCS-750-spi-ard PCB + +Mikro BUS headers +================= + +.. note:: + + The connector standard |MikroBus| is not yet supported + and has yet to be defined. diff --git a/boards/shields/x_cjmcu_75x/x_cjmcu_75x.overlay b/boards/shields/x_cjmcu_75x/x_cjmcu_75x.overlay new file mode 100644 index 0000000000..f14a8d2cc4 --- /dev/null +++ b/boards/shields/x_cjmcu_75x/x_cjmcu_75x.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2024 TiaC Systems + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * This file is intentionally empty. Please confer with shield documentation + * for instructions to use this shield. + */ diff --git a/doc/bridle/links.txt b/doc/bridle/links.txt index 46102d1c85..922f7bd2dc 100644 --- a/doc/bridle/links.txt +++ b/doc/bridle/links.txt @@ -322,6 +322,20 @@ +.. ### Links to Adafruit Products + +.. _`Adafruit Products`: + https://www.adafruit.com/categories + + + +.. ### Links to SparkFun Products + +.. _`SparkFun Products`: + https://www.sparkfun.com/categories + + + .. ### Links to Raspberry Pi Products .. _`Raspberry Pi Products`: @@ -488,6 +502,7 @@ https://picoboy.de/einfuehrung/fuer-erfahrene-nutzer + .. ### Links to Waveshare Systems .. _`Waveshare wiki`: @@ -622,6 +637,57 @@ +.. ### Links to CJMCU (Changjiang Zhidong Technology Co., Ltd.) Products + +.. |CJMCU| replace:: + :strong:`CJMCU` (:emphasis:`Changjiang Intelligent Technology Co., Ltd.`) +.. _`CJMCU`: https://web.archive.org/web/20150925195021/http://www.cjmcu.com/ + + + +.. ### Links to Q-Baihe (Wuhan Lilly Electronics Co., Ltd.) Products + +.. |Q-Baihe| replace:: + :strong:`Q-Baihe` (:emphasis:`Wuhan Lilly Electronics Co., Ltd.`) +.. _Q-Baihe: https://www.lillyelectronicsllc.com/ + + + +.. #### Links to the Adafruit STEMMA / STEMMA QT System + +.. _`STEMMA/QT System`: + https://learn.adafruit.com/introducing-adafruit-stemma-qt + +.. _`STEMMA/QT 4-Pin Layout (I2C)`: + https://learn.adafruit.com/introducing-adafruit-stemma-qt/technical-specs#stemma-4-pin-i2c-both-standard-and-stemma-qt-3035230 + +.. _`STEMMA/QT Power Lines`: + https://learn.adafruit.com/introducing-adafruit-stemma-qt/technical-specs#power-lines-3035228 + +.. _`STEMMA/QT Data Lines`: + https://learn.adafruit.com/introducing-adafruit-stemma-qt/technical-specs#data-lines-3035228 + +.. _`STEMMA 3-Pin Layout (Analog/Digital/PWM)`: + https://learn.adafruit.com/introducing-adafruit-stemma-qt/technical-specs#stemma-3-pin-analog-slash-digital-slash-pwm-3035231 + + + +.. #### Links to the SparkFun Qwiic System + +.. _`Qwiic System`: + https://www.sparkfun.com/qwiic + +.. _`Qwiic Specification (FAQ)`: + https://www.sparkfun.com/qwiic#faqs + +.. _`Qwiic Cable Datasheet`: + https://cdn.sparkfun.com/assets/e/9/8/9/8/Qwiic-Cable.pdf + +.. _`Qwiic Connector Datasheet`: + https://cdn.sparkfun.com/assets/parts/1/2/2/8/9/Qwiic_Connector_Datasheet.pdf + + + .. ### Links to the Grove System .. _`Grove System`: @@ -782,6 +848,35 @@ +.. ### Links to the Q-Baihe Breakout Boards + +.. #### Links to the Q-Baihe I2C/SPI-to-UART Breakout - SC16IS750 + +.. _GT-SC16IS750: https://www.lillyelectronicsllc.com/breakout-board-for-sc16is750-i2c-spi-to-uart-ic + + + +.. ### Links to the SparkFun Breakout Boards + +.. #### Links to the SparkFun I2C/SPI-to-UART Breakout - SC16IS750 + +.. _BOB-09981: https://www.sparkfun.com/products/retired/9981 + +.. _`BOB-09981 Schematic`: + https://www.sparkfun.com/datasheets/BreakoutBoards/SC16IS750_Breakout-v13.pdf + +.. _`GT-SC16IS750 Schematic`: + https://oshwlab.com/rexut95/sparkfun-sc16is750-breakout + +.. #### Links to the SparkFun Breakout Board for SC16IS750 I2C/SPI-to-UART IC + +.. _BOB-09745: https://www.sparkfun.com/products/retired/9745 + +.. _`BOB-09745 Schematic`: + https://www.sparkfun.com/datasheets/BreakoutBoards/SC16IS750_Breakout-v12.pdf + + + .. ### Links to the Raspberry Pi Pico Shields .. #### Links to the GeeekPi Pico Breadboard Kit @@ -1667,6 +1762,38 @@ .. https://www.waveshare.com/wiki/Pico-ResTouch-LCD-3.5#Documents .. https://files.waveshare.com/upload/b/b0/XPT2046.pdf +.. #### Links to Bridge Controllers or similar to drive busses + +.. _`SC16IS740`: + https://www.nxp.com/products:SC16IS740_750_760 + +.. _`SC16IS740 Datasheet`: + https://www.nxp.com/docs/en/data-sheet/SC16IS740_750_760.pdf + +.. _`SC16IS750`: + https://www.nxp.com/products:SC16IS740_750_760 + +.. _`SC16IS750 Datasheet`: + https://www.nxp.com/docs/en/data-sheet/SC16IS740_750_760.pdf + +.. _`SC16IS760`: + https://www.nxp.com/products:SC16IS740_750_760 + +.. _`SC16IS760 Datasheet`: + https://www.nxp.com/docs/en/data-sheet/SC16IS740_750_760.pdf + +.. _`SC16IS752`: + https://www.nxp.com/products:SC16IS752_SC16IS762 + +.. _`SC16IS752 Datasheet`: + https://www.nxp.com/docs/en/data-sheet/SC16IS752_SC16IS762.pdf + +.. _`SC16IS762`: + https://www.nxp.com/products:SC16IS752_SC16IS762 + +.. _`SC16IS762 Datasheet`: + https://www.nxp.com/docs/en/data-sheet/SC16IS752_SC16IS762.pdf + .. #### Links to Ethernet Controllers or similar to drive networks .. _`CH9120`: diff --git a/doc/bridle/releases/release-notes-3.7.0.rst b/doc/bridle/releases/release-notes-3.7.0.rst index 78f516d0ec..89a9929695 100644 --- a/doc/bridle/releases/release-notes-3.7.0.rst +++ b/doc/bridle/releases/release-notes-3.7.0.rst @@ -130,6 +130,7 @@ Supported shields * Waveshare LCD Modules * Waveshare Pico 10-DOF IMU Sensor * Waveshare Pico Environment Sensor +* SC16IS75x Breakout Boards Supported snippets ****************** @@ -175,6 +176,16 @@ Change log * *EP-0164* **Pico Breadboard Kit** shield by 52Pi (GeeekPi) * *EP-0172* **Pico Breadboard Kit Plus** shield by 52Pi (GeeekPi) + * *SC16IS75x Breakout Boards as Shields*: + + * *BOB-09981* **I2C/SPI-to-UART Breakout - SC16IS750** shield by SparkFun + * *CJMCU-750* **I2C/SPI-to-UART Breakout - SC16IS750** shield by CJMCU + (Changjiang Intelligent Technology Co., Ltd.) + * *GT-SC16IS750* **I2C/SPI-to-UART Breakout - SC16IS750** shield by Q-Baihe + (Wuhan Lilly Electronics Co., Ltd.) + * *CJMCU-752* **I2C/SPI-to-UART Breakout - SC16IS752** shield by CJMCU + (Changjiang Intelligent Technology Co., Ltd.) + The following sections provide detailed lists of changes by component. * PROJECT UPDATE to `Zephyr Project`_ v3.7 @@ -238,6 +249,7 @@ Issue Related Items These GitHub issues were addressed since project bootstrapping: +* :github:`257` - [HW] SC16IS75x Breakout Boards as Shields * :github:`254` - [FCR] Bump to Zephyr v3.7 * :github:`252` - [FCR] Upgrade to Zephyr SDK 0.16.8 * :github:`247` - [HW] NXP SC18IS604 SPI to I2C bridge diff --git a/dts/bindings/gpio/cjmcu,75x-gpio-header.yaml b/dts/bindings/gpio/cjmcu,75x-gpio-header.yaml new file mode 100644 index 0000000000..7ed75b107a --- /dev/null +++ b/dts/bindings/gpio/cjmcu,75x-gpio-header.yaml @@ -0,0 +1,44 @@ +# Copyright (c) 2024 TiaC Systems +# SPDX-License-Identifier: Apache-2.0 + +description: | + GPIO pins exposed on CJMCU SC16IS75x breakout board headers. + + The SC16IS75x breakout board layout provides a wraparound header on + two opposite edges of the board and can be divided into three sections. + Firstly, up to the host controller the serial bus configuration, + communication and chip control, secondly the UART interface to the + outside, and thirdly the GPIO interface down to other I/O components. + + Proceeding clockwise on SC16IS750 breakout board: + * A 11-pin header. 5 pins on this header are exposed by this binding. + * A 11-pin header. 3 pins on this header are exposed by this binding. + + Proceeding clockwise on SC16IS752 breakout board: + * A 2x8-pin header. 8 pins on this header are exposed by this binding. + * A 10-pin header. 0 pins on this header are exposed by this binding. + + This binding provides a nexus mapping for 8 pins where parent pins 0 + through 7 correspond as depicted below: + + SC16IS750 SC16IS752 + .-----------------------. .-----------------------------. + - |o I2C/nSPI GND o| - | __ | + - |o A0/CS _ nRESET o| - | .-´ |- --. | + - |o A1/SI _|| ||_ RX o| - - |o VCC | |- .---´ v| + - |o NC/SO ||_|| TX o| - - |o GND `-.__|- GP7|TXA o o| 7 - + - |o SCL/SCK CTS o| - - |o nRESET GP6|RXA o o| 6 - + - |o SDA/NC _____ RTS o| - - |o A0/CS _ GP5|RTSA o o| 5 - + - |o nIRQ | | IO7 o| 7 - |o A1/SI -||_||- GP4|CTSA o o| 4 - + 0 |o IO0 | 750 | IO6 o| 6 - |o NC/SO ___ GP3|TXB o o| 3 - + 1 |o IO1 |_____| IO5 o| 5 - |o nIRQ | | GP2|RXB o o| 2 - + 2 |o IO2 ____ IO4 o| 4 - |o I2C/nSPI | 7 | GP1|RTSB o o| 1 - + - |o VCC |____| IO3 o| 3 - |o SCL/SCLK | 5 | GP0|CTSB o o| 0 - + `-----------------------´ - |o SDA/NC | 2 | ---+ .^ | + | |___| `--´ | + | | + `-----------------------------´ + +compatible: "cjmcu,75x-gpio-header" + +include: [gpio-nexus.yaml, base.yaml] diff --git a/dts/bindings/gpio/cjmcu,75x-hif-header.yaml b/dts/bindings/gpio/cjmcu,75x-hif-header.yaml new file mode 100644 index 0000000000..4a138afc94 --- /dev/null +++ b/dts/bindings/gpio/cjmcu,75x-hif-header.yaml @@ -0,0 +1,44 @@ +# Copyright (c) 2024 TiaC Systems +# SPDX-License-Identifier: Apache-2.0 + +description: | + Host interface exposed on CJMCU SC16IS75x breakout board headers. + + The SC16IS75x breakout board layout provides a wraparound header on + two opposite edges of the board and can be divided into three sections. + Firstly, up to the host controller the serial bus configuration, + communication and chip control, secondly the UART interface to the + outside, and thirdly the GPIO interface down to other I/O components. + + Proceeding clockwise on SC16IS750 breakout board: + * A 11-pin header. 1 pins on this header are exposed by this binding. + * A 11-pin header. 7 pins on this header are exposed by this binding. + + Proceeding clockwise on SC16IS752 breakout board: + * A 2x8-pin header. 0 pins on this header are exposed by this binding. + * A 10-pin header. 8 pins on this header are exposed by this binding. + + This binding provides a nexus mapping for 8 pins where parent pins 0 + through 7 correspond as depicted below: + + SC16IS750 SC16IS752 + .-----------------------. .-----------------------------. + 2 |o I2C/nSPI GND o| - | __ | + 6 |o A0/CS _ nRESET o| 7 | .-´ |- --. | + 5 |o A1/SI _|| ||_ RX o| - - |o VCC | |- .---´ v| + 4 |o NC/SO ||_|| TX o| - - |o GND `-.__|- GP7|TXA o o| - - + 1 |o SCL/SCK CTS o| - 7 |o nRESET GP6|RXA o o| - - + 0 |o SDA/NC _____ RTS o| - 6 |o A0/CS _ GP5|RTSA o o| - - + 3 |o nIRQ | | IO7 o| - 5 |o A1/SI -||_||- GP4|CTSA o o| - - + - |o IO0 | 750 | IO6 o| - 4 |o NC/SO ___ GP3|TXB o o| - - + - |o IO1 |_____| IO5 o| - 3 |o nIRQ | | GP2|RXB o o| - - + - |o IO2 ____ IO4 o| - 2 |o I2C/nSPI | 7 | GP1|RTSB o o| - - + - |o VCC |____| IO3 o| - 1 |o SCL/SCLK | 5 | GP0|CTSB o o| - - + `-----------------------´ 0 |o SDA/NC | 2 | ---+ .^ | + | |___| `--´ | + | | + `-----------------------------´ + +compatible: "cjmcu,75x-hif-header" + +include: [gpio-nexus.yaml, base.yaml] diff --git a/dts/bindings/vendor-prefixes.txt b/dts/bindings/vendor-prefixes.txt index 37a26dc888..f8895fafba 100644 --- a/dts/bindings/vendor-prefixes.txt +++ b/dts/bindings/vendor-prefixes.txt @@ -12,6 +12,7 @@ # zephyr-keep-sorted-start adafruit Adafruit Industries, LLC +cjmcu Changjiang Intelligent Technology Co., Ltd. cytron Cytron Technologies dfrobot DFRobot Corporation digilent Digilent, Inc.