Skip to content

Commit

Permalink
boards: shields: Add Seeed Studio XIAO Expansion Board
Browse files Browse the repository at this point in the history
Add Seeed Studio XIAO Expansion Board:
- User button
- SSD1306 128x64 pixels
- MicroSD
- PFC8563 RTC

Signed-off-by: Charles Dias <charlesdias.cd@outlook.com>
  • Loading branch information
CharlesDias committed Mar 10, 2024
1 parent eaf140e commit 1b00987
Show file tree
Hide file tree
Showing 6 changed files with 181 additions and 0 deletions.
27 changes: 27 additions & 0 deletions boards/shields/seeed_xiao_expansion_board/Kconfig.defconfig
@@ -0,0 +1,27 @@
# Copyright (c) 2024 Charles Dias <charlesdias.cd@outlook.com>
# 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
5 changes: 5 additions & 0 deletions boards/shields/seeed_xiao_expansion_board/Kconfig.shield
@@ -0,0 +1,5 @@
# Copyright (c) 2024 Charles Dias <charlesdias.cd@outlook.com>
# SPDX-License-Identifier: Apache-2.0

config SHIELD_SEEED_XIAO_EXPANSION_BOARD
def_bool $(shields_list_contains,seeed_xiao_expansion_board)
Binary file not shown.
Binary file not shown.
84 changes: 84 additions & 0 deletions 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
@@ -0,0 +1,65 @@
/*
* Copyright (c) 2024 Charles Dias <charlesdias.cd@outlook.com>
* 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 = <INPUT_KEY_0>;
};
};

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>;
};
};

0 comments on commit 1b00987

Please sign in to comment.