Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# EDA AI GameBox

## Hardware Overview

| Feature | Specification |
|---------|---------------|
| Chip | ESP32-S3 R8N8 |
| Flash | 8MB QIO 80MHz |
| PSRAM | 8MB Octal 80MHz |
| Display | ST7789 240x320 LCD (SPI) |
| Controls | 五向按键 + XYAB 按键 (共9键) |
| Buzzer | 无源蜂鸣器 (GPIO48, LEDC PWM) |
| Audio | 无 |

## GPIO Mapping

| Function | GPIO |
|----------|------|
| **SPI Display (ST7789)** | |
| MOSI | 13 |
| SCLK | 14 |
| CS | 11 |
| DC | 12 |
| RST | -1 (EN) |
| Backlight | 10 |
| **五向按键** | |
| 上 (Front) | 5 |
| 下 (Back) | 3 |
| 左 (Left) | 1 |
| 右 (Right) | 4 |
| 中 (Center) | 2 |
| **XYAB 按键** | |
| X | 8 |
| Y | 6 |
| A | 9 |
| B | 7 |
| **Buzzer** | |
| Passive Buzzer | 48 |

## Build & Flash

```bash
cd application/edge_agent

# Set target chip
idf.py set-target esp32s3

# Install board manager assistant (required for bmgr)
pip install esp-bmgr-assist

# Generate board configuration
idf.py bmgr --customer-path ./boards -b eda_ai_gamebox

# Build
idf.py build

# Flash
idf.py -p /dev/ttyACM0 flash monitor
```

## Project Documentation

- [EDA-AI-GameBox 项目文档](https://wiki.lceda.cn/zh-hans/course-projects/smart-internet/eda-ai-gamebox/eda-ai-gamebox-introduce.html)

## Files

| File | Description |
|------|-------------|
| `board_info.yaml` | Board identity (chip, manufacturer) |
| `board_peripherals.yaml` | Peripheral pin and bus configuration |
| `board_devices.yaml` | Device driver configuration (display, buttons) |
| `sdkconfig.defaults.board` | Board-level sdkconfig defaults |
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
version: 1.0.0
# Devices for EDA AI GameBox (掌上游戏机)

devices:

# ST7789 LCD 240x320 over SPI
- name: display_lcd
chip: st7789
type: display_lcd
sub_type: spi
version: default
config:
# 顺时针旋转 90 度:swap_xy + mirror_x,逻辑分辨率 320x240
mirror_x: true
mirror_y: false
swap_xy: true
invert_color: true
x_max: 320
y_max: 240
io_spi_config:
cs_gpio_num: 11
dc_gpio_num: 12
spi_mode: 0
pclk_hz: 40000000
lcd_panel_config:
reset_gpio_num: -1
data_endian: LCD_RGB_DATA_ENDIAN_BIG
vendor_config: NULL
peripherals:
- name: spi_display

# LCD backlight
- name: lcd_brightness
type: ledc_ctrl
version: default
peripherals:
- name: ledc_backlight

# 五向按键
- name: dpad_up
type: gpio_ctrl
version: default
config:
active_level: 0
default_level: 1
peripherals:
- name: gpio_dpad_up

- name: dpad_down
type: gpio_ctrl
version: default
config:
active_level: 0
default_level: 1
peripherals:
- name: gpio_dpad_down

- name: dpad_left
type: gpio_ctrl
version: default
config:
active_level: 0
default_level: 1
peripherals:
- name: gpio_dpad_left

- name: dpad_right
type: gpio_ctrl
version: default
config:
active_level: 0
default_level: 1
peripherals:
- name: gpio_dpad_right

- name: dpad_center
type: gpio_ctrl
version: default
config:
active_level: 0
default_level: 1
peripherals:
- name: gpio_dpad_center

# XYAB 按键
- name: btn_x
type: gpio_ctrl
version: default
config:
active_level: 0
default_level: 1
peripherals:
- name: gpio_btn_x

- name: btn_y
type: gpio_ctrl
version: default
config:
active_level: 0
default_level: 1
peripherals:
- name: gpio_btn_y

- name: btn_a
type: gpio_ctrl
version: default
config:
active_level: 0
default_level: 1
peripherals:
- name: gpio_btn_a

- name: btn_b
type: gpio_ctrl
version: default
config:
active_level: 0
default_level: 1
peripherals:
- name: gpio_btn_b

# 无源蜂鸣器
- name: buzzer
type: ledc_ctrl
version: default
peripherals:
- name: ledc_buzzer
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
board: eda_ai_gamebox
chip: esp32s3
version: 1.0.0
description: "EDA AI GameBox - ESP32-S3 掌上游戏机 (ST7789 240x320 + 五向按键 + XYAB)"
manufacturer: "lceda-course-examples"
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
version: 1.0.0
# Peripherals for EDA AI GameBox (掌上游戏机)
# ST7789 240x320 LCD + 五向按键 + XYAB 按键

peripherals:

# ST7789 LCD display (SPI3)
- name: spi_display
type: spi
role: master
config:
spi_bus_config:
spi_port: SPI3_HOST
data0_io_num: 13
sclk_io_num: 14
max_transfer_sz: 153600

# LCD backlight (LEDC PWM)
- name: ledc_backlight
type: ledc
role: none
config:
gpio_num: 10
freq_hz: 5000
duty: 0
duty_resolution: LEDC_TIMER_10_BIT
output_invert: false

# 五向按键 - 上 (Front)
- name: gpio_dpad_up
type: gpio
role: io
config:
pin: 5
mode: GPIO_MODE_INPUT
default_level: 1

# 五向按键 - 下 (Back)
- name: gpio_dpad_down
type: gpio
role: io
config:
pin: 3
mode: GPIO_MODE_INPUT
default_level: 1

# 五向按键 - 左 (Left)
- name: gpio_dpad_left
type: gpio
role: io
config:
pin: 1
mode: GPIO_MODE_INPUT
default_level: 1

# 五向按键 - 右 (Right)
- name: gpio_dpad_right
type: gpio
role: io
config:
pin: 4
mode: GPIO_MODE_INPUT
default_level: 1

# 五向按键 - 中 (Center)
- name: gpio_dpad_center
type: gpio
role: io
config:
pin: 2
mode: GPIO_MODE_INPUT
default_level: 1

# XYAB - X
- name: gpio_btn_x
type: gpio
role: io
config:
pin: 8
mode: GPIO_MODE_INPUT
default_level: 1

# XYAB - Y
- name: gpio_btn_y
type: gpio
role: io
config:
pin: 6
mode: GPIO_MODE_INPUT
default_level: 1

# XYAB - A
- name: gpio_btn_a
type: gpio
role: io
config:
pin: 9
mode: GPIO_MODE_INPUT
default_level: 1

# XYAB - B
- name: gpio_btn_b
type: gpio
role: io
config:
pin: 7
mode: GPIO_MODE_INPUT
default_level: 1

# 无源蜂鸣器 (LEDC PWM)
- name: ledc_buzzer
type: ledc
role: none
config:
gpio_num: 48
freq_hz: 2700
duty: 0
duty_resolution: LEDC_TIMER_10_BIT
output_invert: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y

# 8MB flash, QIO 80MHz
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_8MB.csv"

# 8MB PSRAM
CONFIG_SPIRAM=y
CONFIG_SPIRAM_MODE_OCT=y
CONFIG_SPIRAM_SPEED_80M=y

# LCD: ST7789 240x320
CONFIG_LCD_ST7789_240X320=y

# USB: Serial JTAG
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
CONFIG_ESP_CONSOLE_SECONDARY_NONE=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "esp_lcd_panel_st7789.h"

esp_err_t lcd_panel_factory_entry_t(esp_lcd_panel_io_handle_t io,
const esp_lcd_panel_dev_config_t *panel_dev_config,
esp_lcd_panel_handle_t *ret_panel)
{
return esp_lcd_new_panel_st7789(io, panel_dev_config, ret_panel);
}
Loading