diff --git a/boards/shields/seeed_xiao_expansion_board/Kconfig.defconfig b/boards/shields/seeed_xiao_expansion_board/Kconfig.defconfig new file mode 100644 index 000000000000000..ccc874d270b30b9 --- /dev/null +++ b/boards/shields/seeed_xiao_expansion_board/Kconfig.defconfig @@ -0,0 +1,27 @@ +# Copyright (c) 2024 Charles Dias +# SPDX-License-Identifier: Apache-2.0 + +if SHIELD_SEEED_XIAO_EXPANSION_BOARD + +if DISPLAY + +if LVGL + +config LV_Z_VDB_SIZE + default 64 + +config LV_DPI_DEF + default 148 + +config LV_Z_BITS_PER_PIXEL + default 1 + +choice LV_COLOR_DEPTH + default LV_COLOR_DEPTH_1 +endchoice + +endif # LVGL + +endif # DISPLAY + +endif # SHIELD_SEEED_XIAO_EXPANSION_BOARD diff --git a/boards/shields/seeed_xiao_expansion_board/Kconfig.shield b/boards/shields/seeed_xiao_expansion_board/Kconfig.shield new file mode 100644 index 000000000000000..a7665933c8c9028 --- /dev/null +++ b/boards/shields/seeed_xiao_expansion_board/Kconfig.shield @@ -0,0 +1,5 @@ +# Copyright (c) 2024 Charles Dias +# SPDX-License-Identifier: Apache-2.0 + +config SHIELD_SEEED_XIAO_EXPANSION_BOARD + def_bool $(shields_list_contains,seeed_xiao_expansion_board) diff --git a/boards/shields/seeed_xiao_expansion_board/doc/img/pins_xiao_expansion_board.webp b/boards/shields/seeed_xiao_expansion_board/doc/img/pins_xiao_expansion_board.webp new file mode 100644 index 000000000000000..a1f7e72a664b6e1 Binary files /dev/null and b/boards/shields/seeed_xiao_expansion_board/doc/img/pins_xiao_expansion_board.webp differ diff --git a/boards/shields/seeed_xiao_expansion_board/doc/img/seeed_xiao_expansion_board.webp b/boards/shields/seeed_xiao_expansion_board/doc/img/seeed_xiao_expansion_board.webp new file mode 100644 index 000000000000000..427ae739ee1e441 Binary files /dev/null and b/boards/shields/seeed_xiao_expansion_board/doc/img/seeed_xiao_expansion_board.webp differ diff --git a/boards/shields/seeed_xiao_expansion_board/doc/index.rst b/boards/shields/seeed_xiao_expansion_board/doc/index.rst new file mode 100644 index 000000000000000..1c484204fee2cce --- /dev/null +++ b/boards/shields/seeed_xiao_expansion_board/doc/index.rst @@ -0,0 +1,84 @@ +.. _seeed_xiao_expansion_board: + +Seeed Studio XIAO Expansion Board +################################# + +Overview +******** + +Seeed Studio XIAO Expansion Board is a powerful functional expansion board +for `Seeed Studio XIAO series`_ of only half Raspberry Pi 4 size. It enables +building prototypes and projects in an easy and quick way. With its rich +peripherals, you could explore the infinite possibilities of Seeed Studio +XIAO series. + +.. figure:: img/seeed_xiao_expansion_board.webp + :width: 600px + :align: center + :alt: Seeed Studio XIAO Expansion Board + + Seeed Studio XIAO Expansion Board (Credit: Seeed Studio) + +Pin Assignments +=============== + ++-----------------------+---------------------------------------------+ +| Shield Connector Pin | Function | ++=======================+=============================================+ +| 0 | Grove*1 (A0, D0) | ++-----------------------+---------------------------------------------+ +| 1 | User button | ++-----------------------+---------------------------------------------+ +| 2 | MicroSD SPI CSn | ++-----------------------+---------------------------------------------+ +| 3 | Buzzer(A3) | ++-----------------------+---------------------------------------------+ +| 4 | Grove*2 I2C SDA | ++-----------------------+---------------------------------------------+ +| 5 | Grove*2 I2C SCL | ++-----------------------+---------------------------------------------+ +| 6 | Grove*1 UART TX | ++-----------------------+---------------------------------------------+ +| 7 | Grove*1 UART RX | ++-----------------------+---------------------------------------------+ +| 8 | MicroSD SPI SCK (Serial Clock Input) | ++-----------------------+---------------------------------------------+ +| 9 | MicroSD SPI MISO (Serial Data Input) | ++-----------------------+---------------------------------------------+ +| 10 | MicroSD SPI MOSI (Serial Data Output) | ++-----------------------+---------------------------------------------+ + +.. figure:: img/pins_xiao_expansion_board.webp + :width: 600px + :align: center + :alt: Seeed Studio XIAO Expansion Board Pins + + Seeed Studio XIAO Expansion Board Pins (Credit: Seeed Studio) + +Programming +*********** + +LED Button Sample +================= + +Set ``-DSHIELD=seeed_xiao_expansion_board`` when you invoke ``west build``. For example: + +.. zephyr-app-commands:: + :zephyr-app: samples/basic/button + :board: xiao_ble/nrf52840 + :shield: seeed_xiao_expansion_board + :goals: build + +LVGL Basic Sample +========================== + +Set ``-DSHIELD=seeed_xiao_expansion_board`` when you invoke ``west build``. For example: + +.. zephyr-app-commands:: + :zephyr-app: samples/subsys/display/lvgl + :board: xiao_ble/nrf52840 + :shield: seeed_xiao_expansion_board + :goals: build + +.. _Seeed Studio XIAO series: + https://www.seeedstudio.com/XIAO-c-1964.html diff --git a/boards/shields/seeed_xiao_expansion_board/seeed_xiao_expansion_board.overlay b/boards/shields/seeed_xiao_expansion_board/seeed_xiao_expansion_board.overlay new file mode 100644 index 000000000000000..cd318d5fe50a1bb --- /dev/null +++ b/boards/shields/seeed_xiao_expansion_board/seeed_xiao_expansion_board.overlay @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2024 Charles Dias + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + chosen { + zephyr,display = &ssd1306_128x64; + zephyr,rtc = &pfc8563_rtc; + }; + + buttons { + compatible = "gpio-keys"; + xiao_button0: button_0 { + gpios = <&xiao_d 1 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "SW0"; + zephyr,code = ; + }; + }; + + aliases { + sw0 = &xiao_button0; + rtc = &pfc8563_rtc; + }; +}; + +&xiao_i2c { + status = "okay"; + + ssd1306_128x64: ssd1306@3c { + compatible = "solomon,ssd1306fb"; + reg = <0x3c>; + width = <128>; + height = <64>; + segment-offset = <0>; + page-offset = <0>; + display-offset = <0>; + multiplex-ratio = <63>; + segment-remap; + com-invdir; + prechargep = <0x22>; + }; + + pfc8563_rtc: pfc8563@51 { + compatible = "nxp,pcf8563"; + reg = <0x51>; + status = "okay"; + }; +}; + +&xiao_spi { + status = "okay"; + cs-gpios = <&xiao_d 2 GPIO_ACTIVE_LOW>; + + sdhc0: sdhc@0 { + compatible = "zephyr,sdhc-spi-slot"; + reg = <0>; + status = "okay"; + mmc { + compatible = "zephyr,sdmmc-disk"; + status = "okay"; + }; + spi-max-frequency = <24000000>; + }; +};