Open Source Hardware Resources

Last Updated on : 2026-04-23 03:12:51Copy for LLMView as MarkdownDownload PDF

Overview

The boards directory contains the board support packages (BSP) for different hardware development boards. Each development board has its own independent configuration, GPIO pin definitions, display settings, and camera support. The UI uses a unified interface (tuya_ai_display.h), with each board implementing its own specific interface and interaction logic within its respective ui/ directory.

Directory

boards
├── T5AI_BOARD/           # T5AI standard development board
├── T5AI_BOARD_EVB/       # T5AI EVB evaluation board
├── T5AI_BOARD_EYES/      # T5AI eyes edition development board
├── T5AI_BOARD_ROBOT/     # T5AI robot edition development board
├── T5AI_BOARD_DESKTOP/   # T5AI desktop edition development board
└── Ubuntu/               # Ubuntu simulation environment

Board-level configuration

Standard development board: T5AI_BOARD

  • Use cases: Standard development, demonstration, and prototyping.

  • Schematic diagram: T5AI-Board Development Board Diagram

  • Hardware configuration:

    • Display: 3.5-inch LCD (320 × 480), ILI9488 driver
    • Camera: DVP camera (480 × 480@10 fps, MJPEG)
    • Audio trigger pin: GPIO 12
    • Speaker enable pin: GPIO 28
    • LED pin: GPIO 56
    • Pairing pin: Not used
    • Audio encoder: Opus encoder
  • Features:

    • Large screen supports diverse UI
    • Camera supports multimodal AI
    • Touchscreen support
    • WeChat-style chat interface
  • Configuration details:

    // Display
    #define TUYA_LCD_IC_NAME     "ili9488"
    #define TUYA_LCD_WIDTH        320
    #define TUYA_LCD_HEIGHT       480
    #define LCD_FPS               10
    
    // Camera (if enabled)
    #define TUYA_AI_TOY_CAMERA_TYPE  TKL_VI_CAMERA_TYPE_DVP
    #define TUYA_AI_TOY_ISP_WIDTH    480
    #define TUYA_AI_TOY_ISP_HEIGHT   480
    #define TUYA_AI_TOY_ISP_FPS      10
    
    // Audio
    #define ENABLE_APP_OPUS_ENCODER 1
    
  • Product ID (PID): badnnka7rzrm2idb by default

  • UI: WeChat-style chat interface (wechat_app.c)

White box: T5AI_BOARD_EVB

  • Use cases: Product evaluation, testing, and portable devices

  • Schematic diagram: T5-AI Voice Box

  • Hardware configuration:

    • Display: Small-sized LCD (240 × 240), ST7789 driver
    • Camera: Not supported
    • Audio trigger pin: GPIO 4
    • Speaker enable pin: GPIO 19
    • LED pin: GPIO 8
    • Pairing pin: GPIO 12
    • Battery: Supported (charging pin GPIO 21, capacity pin GPIO 28)
    • Audio encoder: Opus encoder
  • Features:

    • Compact design
    • Powered by batteries
    • Network status indicator
    • Rich emoji support
    • Xiaozhi-style chat interface
  • Configuration details:

    // Display
    #define TUYA_LCD_IC_NAME     "spi_st7789"
    #define TUYA_LCD_WIDTH        240
    #define TUYA_LCD_HEIGHT       240
    #define LCD_FPS               15
    
    // Battery
    #define TUYA_AI_TOY_BATTERY_ENABLE 1
    #define TUYA_AI_TOY_CHARGE_PIN     TUYA_GPIO_NUM_21
    #define TUYA_AI_TOY_BATTERY_CAP_PIN TUYA_GPIO_NUM_28
    
  • PID: e3jrgtmuqsljru1t

  • UI: Xiaozhi-style chat interface with emoji support (xiaozhi_app.c)

Eyes edition development board: T5AI_BOARD_EYES

  • Use cases: Expressive interaction, emotion display, and toy applications

  • Schematic diagram: T5AI-Board Development Board

  • Hardware configuration:

    • Display: Small-sized circular/square display (128 × 128), ST7735S driver
    • Camera: DVP camera (480 × 480@10 fps, MJPEG)
    • Audio trigger pin: GPIO 12
    • Speaker enable pin: GPIO 28
    • LED pin: Not used
    • Pairing pin: Not used
    • Audio encoder: Opus encoder
  • Features:

    • Small screen optimized for eye expression display
    • Multiple emotional states (angry, confused, delicious, and more)
    • Camera support for visual interaction
    • Vivid UI animations
  • Configuration details:

    // Display, with a small screen for eye use
    #define TUYA_LCD_IC_NAME     "spi_st7735s"
    #define TUYA_LCD_WIDTH        128
    #define TUYA_LCD_HEIGHT       128
    #define LCD_FPS               10
    
    // Camera
    #define TUYA_AI_TOY_CAMERA_TYPE  TKL_VI_CAMERA_TYPE_DVP
    #define TUYA_AI_TOY_ISP_WIDTH    480
    #define TUYA_AI_TOY_ISP_HEIGHT   480
    
  • UI: Eye expression application (eyes_app.c), containing multiple emotion resources.

Robot dog: T5AI_BOARD_ROBOT

  • Use cases: Robotics applications, mobile devices, and advanced interaction

  • Schematic diagram: T5AI-DOG_V1

  • Hardware configuration:

    • Display: Widescreen (320 × 172), ST7789P3 driver (landscape mode)
    • Camera: UVC camera (640 × 480@15 fps, MJPEG)
    • Audio trigger pin: GPIO 5
    • Speaker enable pin: GPIO 26
    • LED pin: Not used
    • Pairing pin: GPIO 4
    • Battery: Supported (charging pin GPIO 21, capacity pin GPIO 28)
    • Audio encoder: Opus encoder
  • Features:

    • Widescreen display for robot face/interface
    • High-resolution camera (640 × 480)
    • Battery powered for mobile robotics
    • Network connectivity
    • Robot-style UI and animations
  • Configuration details:

    // Display, widescreen landscape
    #define TUYA_LCD_IC_NAME     "spi_st7789p3"
    #define TUYA_LCD_WIDTH        320
    #define TUYA_LCD_HEIGHT       172
    #define LCD_FPS               10
    
    // Camera, UVC type, higher resolution
    #define TUYA_AI_TOY_CAMERA_TYPE  TKL_VI_CAMERA_TYPE_UVC
    #define TUYA_AI_TOY_ISP_WIDTH    640
    #define TUYA_AI_TOY_ISP_HEIGHT   480
    #define TUYA_AI_TOY_ISP_FPS      15
    
  • UI: Robot application, containing multiple robot expressions and actions.

Desktop edition development board: T5AI_BOARD_DESKTOP

  • Use cases: Desktop devices, fixed installation, fully-featured applications

  • Schematic diagram:

  • Hardware configuration:

    • Display: Medium-sized LCD (320 × 240), ST7789V2 driver
    • Camera: Supported
    • Audio trigger pin: GPIO 28
    • Speaker enable pin: GPIO 26
    • LED pin: Not used
    • Pairing pin: Not used
    • Power management: Device power pin GPIO 4, power/network button pin GPIO 3
    • Battery: Supported (charging pin GPIO 2, capacity pin GPIO 12)
    • Audio encoder: Opus encoder
  • Features:

    • Complete desktop application interface
    • Multi-page UI (home, chat, profile, and settings)
    • Power management (press and hold to power off)
    • Network reset support (key combination)
    • Rich font resources
    • Complete interaction flow
  • Configuration details:

    // Display
    #define TUYA_LCD_IC_NAME     "spi_st7789v2"
    #define TUYA_LCD_WIDTH        320
    #define TUYA_LCD_HEIGHT       240
    #define LCD_FPS               15
    
    // Power management
    #define DEVICE_POWER_NET_KEY_PIN  TUYA_GPIO_NUM_3
    #define DEVICE_POWER_PIN          TUYA_GPIO_NUM_4
    
    // Battery
    #define TUYA_AI_TOY_BATTERY_ENABLE 1
    #define TUYA_AI_TOY_CHARGE_PIN     TUYA_GPIO_NUM_2
    #define TUYA_AI_TOY_BATTERY_CAP_PIN TUYA_GPIO_NUM_12
    
  • UI: Complete desktop application containing multiple pages:

    • Startup screen: desk_startup.c
    • Homepage: desk_home.c
    • Chat interface: desk_chat.c
    • Profile center: desk_personal.c
    • Feature settings: desk_func_settings.c
    • Event handling: desk_event_handle.c

Simulation environment: Ubuntu

  • Use cases: Development on a personal computer, debugging, and simulation without physical hardware

  • Hardware configuration:

    • Display: Not used (simulated)
    • Camera: Not used (simulated)
    • Audio trigger pin: Not used (GPIO_MAX)
    • Speaker enable pin: GPIO 26
    • LED pin: Not used (GPIO_MAX)
    • Pairing pin: Not used (GPIO_MAX)
    • Audio encoder: Speex encoder (for UART codec)
  • Features:

    • UART codec support (CI1302 chip)
    • Speex encoding format
    • No hardware dependency
    • Convenient for debugging and development
  • Configuration details:

    // UART codec configuration
    #define UART_CODEC_VENDOR_ID         1       // CI1302
    #define UART_CODEC_UART_PORT         TUYA_UART_NUM_2
    #define UART_CODEC_BOOT_IO           TUYA_GPIO_NUM_2
    #define UART_CODEC_POWER_IO          TUYA_GPIO_NUM_3
    #define UART_CODEC_UPLOAD_FORMAT     1       // SPEEX
    
    // Audio encoder
    #define ENABLE_APP_OPUS_ENCODER 0
    #define ENABLE_APP_SPEEX_ENCODER 1
    

Comparison of development boards

Development board Display Camera Battery Network Encoder UI style Scenario
T5AI_BOARD 320 × 480 DVP No No Opus WeChat Standard development
T5AI_BOARD_EVB 240 × 240 No Yes Yes Opus Xiaozhi Evaluation and testing
T5AI_BOARD_EYES 128 × 128 DVP No No Opus Eyes Expression display
T5AI_BOARD_ROBOT 320 × 172 UVC Yes Yes Opus Robot Robotics applications
T5AI_BOARD_DESKTOP 320 × 240 DVP Yes No Opus Desktop Desktop devices
Ubuntu N/A N/A N/A N/A Speex N/A Simulation environment

Board-level initialization

Each development board implements the tuya_device_board_init() function in tuya_device_board.c.

/**
 * @brief Board-level initialization.
 *
 * Initialize GPIOs, peripherals (display, camera, and buttons), UI, and other board-specific components.
 *
 * @return Return OPRT_OK on success. Otherwise, return an error code.
 */
OPERATE_RET tuya_device_board_init(VOID)
{
    OPERATE_RET rt = OPRT_OK;

    // 1. Initialize GPIOs.
    // 2. Initialize peripherals (display, camera, and buttons).
    // 3. Initialize other board-specific components.

    return rt;
}

UI implementation

The display layer uses a unified interface (tuya_ai_display.h). Each board provides its own implementation in the ui/ directory. If a development board needs to implement its own UI, it only needs to implement the following two interfaces (called by tuya_ai_display.c during initialization and message dispatching).

Interface Description
void app_ui_init(void) Initialize the UI: Create the UI and register callbacks.
void app_ui_msg_handler(TY_DISPLAY_MSG_T *msg) Handle messages sent from the display layer (type determined by msg->type, such as chat, status, and emotion).

For more information about message types and data structure definitions, see src/miscs/gui/display/tuya_ai_display.h.

Add a new development board

Step 1: Create a board directory

Create a new directory under the boards/ directory, for example, T5AI_BOARD_NEW/.

Step 2: Implement board-level initialization

Create tuya_device_board.c and tuya_device_board.h. Implement the board initialization functions and define GPIO pins, display settings, and more.

Step 3: Implement UI (Optional)

If custom UI is required, implement the UI application in the ui/ directory.

Step 4: Configure the build system

Add the new development board’s build options in local.mk or the relevant configuration file.

ifeq ($(CONFIG_T5AI_BOARD), y)
LOCAL_TUYA_SDK_INC += $(LOCAL_PATH)/src/boards/T5AI_BOARD/
LOCAL_SRC_FILES := $(LOCAL_PATH)/src/boards/T5AI_BOARD/tuya_device_board.c
endif

Step 5: Configure the development board

  • Use make app_menuconfig APP_NAME=tuyaos_demo_wukong_ai to select the newly added development board.
  • Use make app_config APP_NAME=tuyaos_demo_wukong_ai to generate the configuration file for the new development board.

Step 6: Test and verify

Test the acoustic performance and structure of the development board according to the Acoustic Algorithm Debugging, and verify related software functionalities.

Add cellular module support

By default, any hardware can support a cellular module. During the make app_menuconfig APP_NAME=tuyaos_demo_wukong_ai stage, select ENABLE_USB_CELLULUA_DONGLE.

Add voice chip support

By default, any hardware can support a voice chip. During the make app_menuconfig APP_NAME=tuyaos_demo_wukong_ai stage, or in ./build/APPConfig for the specific board, check or add the following:

select USING_UART_AUDIO_INPUT
select USING_UART_AUDIO_OUTPUT

The directory already supports three voice chips, including NationalChip and ChipIntelli:

  • GX8006
  • GX8008C
  • CI1302

Support

If you have any problems with TuyaOS development, you can post your questions in the Tuya Developer Forum.