|
H753_CPP_SPI_BT817_EVE_02 1.0
STM32H753 draws its own touch screens on a Bridgetek BT817 (ME817EV + DP-0701-01A) over SPI with the STM32_Bridgetek_EVE_API library: a two-page widget tour
|
Firmware for a NUCLEO-H753ZI that draws its own touch screens on a Bridgetek BT817 EVE graphics controller (ME817EV board with the DP-0701-01A 7-inch 800 x 480 capacitive-touch panel) over plain SPI. The screens are written in C with the STM32_Bridgetek_EVE_API library (a git submodule); EVE Screen Designer is not used.
Status: tested on the hardware with SPI1 at 12 Mbit/s: start-up check, touch calibration, both pages, Next/Back, and the final pop-up.
After the CubeMX peripheral init, main.c:
eveChipIdTest() (switched by runChipIdTest), the same as in Part 2: BT817 reset, host commands, REG_ID 0x7C, REG_CPURESET 0, chip ID 08 17 01 00;widgetTourInit(): EVE_Init() starts the BT817 through the library, then touch calibration (tap the three dots) and two touch trackers (slider and dial);widgetTourRun(), which loops about 60 times a second: read the touch registers, then build and show one complete screen as a co-processor command list.The widget tour (Core/Src/widgetTour.c):
| Page | Contents |
|---|---|
| 1 | Title bar with Next >, a Press me button with a press count, an OFF/ON toggle that switches an LED, a gauge, a slider and a progress bar that share one value (0..100) |
| 2 | Title bar with **< Back** and Done, the typed digits with Clear, a keypad (1..0), an analog clock (time since reset) and a dial with its angle in degrees |
| Done | A final "Congratulations! / Widget tour completed / Press reset to start over" pop-up; nothing reacts after it |
Touch uses EVE tags: 1 button, 2 toggle, 3 slider, 4 Next, 5 Back, 6 Clear, 7 dial, 8 Done, and the keypad keys use their own character ('0'..'9') as the tag.
CMD_TEXT fills in d only with the EVE_OPT_FORMAT option. s with EVE_OPT_FORMAT expects an address in the BT817's own memory, so format a string on the STM32 with snprintf() first.CMD_SPINNER animates until CMD_STOP, which does not fit a screen redrawn every frame.The same wiring as Part 2 (H753_CPP_SPI_BT817_EVE_01):
| ME817EV CN8 | Signal | NUCLEO-H753ZI | Notes |
|---|---|---|---|
| 1 | SCK | PA5 | SPI1_SCK |
| 2 | CS# | PB6 | GPIO output, EVE CS# |
| 3 | MISO | PA6 | SPI1_MISO |
| 4 | MOSI | PB5 | SPI1_MOSI |
| 11, 12 | GND | GND | both ground pins |
| 13 | PD# | PD15 | GPIO output, EVE PD#, starts low |
| 14 | INT# | PF3 | EXTI3 (not used yet) |
| 10 | 5V_HOST | not connected | the ME817EV has its own USB-C supply |
USART1 (PA9 TX, PA10 RX, 19200 baud) is the terminal. On the ME817EV: SW2 all OFF, JP1 on 1-2.
Connect the grounds properly: besides the GND pins of the signal wiring, add a short, heavy ground connection between the two boards, which have separate supplies.
FT8XX_TYPE=BT817, PANEL_TYPE=DP_0701_01A, PLATFORM_STM32_CUBE=1 (SPI), PLATFORM_STM32_CUBE_CHANNEL=1 (SPI1).STM32_Bridgetek_EVE_API/ - Bridgetek's EVE library (MIT), as a submodule; its README lists the changes made for STM32Cube.