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.
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
Use cases: Standard development, demonstration, and prototyping.
Schematic diagram: T5AI-Board Development Board Diagram
Hardware configuration:
Features:
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)
Use cases: Product evaluation, testing, and portable devices
Schematic diagram: T5-AI Voice Box
Hardware configuration:
Features:
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)
Use cases: Expressive interaction, emotion display, and toy applications
Schematic diagram: T5AI-Board Development Board
Hardware configuration:
Features:
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.
Use cases: Robotics applications, mobile devices, and advanced interaction
Schematic diagram: T5AI-DOG_V1
Hardware configuration:
Features:
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.
Use cases: Desktop devices, fixed installation, fully-featured applications
Schematic diagram:
Hardware configuration:
Features:
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:
desk_startup.cdesk_home.cdesk_chat.cdesk_personal.cdesk_func_settings.cdesk_event_handle.cUse cases: Development on a personal computer, debugging, and simulation without physical hardware
Hardware configuration:
Features:
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
| Development board | Display | Camera | Battery | Network | Encoder | UI style | Scenario |
|---|---|---|---|---|---|---|---|
| T5AI_BOARD | 320 × 480 | DVP | No | No | Opus | 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 |
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;
}
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.
Create a new directory under the boards/ directory, for example, T5AI_BOARD_NEW/.
Create tuya_device_board.c and tuya_device_board.h. Implement the board initialization functions and define GPIO pins, display settings, and more.
If custom UI is required, implement the UI application in the ui/ directory.
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
make app_menuconfig APP_NAME=tuyaos_demo_wukong_ai to select the newly added development board.make app_config APP_NAME=tuyaos_demo_wukong_ai to generate the configuration file for the new development board.Test the acoustic performance and structure of the development board according to the Acoustic Algorithm Debugging, and verify related software functionalities.
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.
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:
If you have any problems with TuyaOS development, you can post your questions in the Tuya Developer Forum.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback