This documentation covers a STM32 NUCLEO-H753ZI tutorial project 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 touch panel) over plain SPI. The screens are written in C with the STM32_Bridgetek_EVE_API library; no EVE Screen Designer is used.
Project Overview
The firmware demonstrates:
- The same start-up check as Part 2: BT817 reset, host commands, REG_ID, REG_CPURESET and the chip ID, see eveChipIdTest
- Starting the BT817 through the library, calibrating touch and registering two touch trackers, see widgetTourInit, calibrateTouch and registerTrackers
- Building a complete screen each frame as one co-processor command list, see drawScreen
- Page 1, the widgets: a button with a press counter, a toggle that switches an LED, and a slider that drives a gauge and a progress bar, see drawButton, drawToggle and drawSliderGroup
- Page 2, more widgets: a keypad that types digits, an analog clock and a dial, see drawPageMore
- Touch through EVE tags: a press counts only on first touch, the slider and the dial follow the finger through the touch tracker, see readTouch
- Moving between pages with Next and Back, and a final "Completed" pop-up after Done, see drawHeader and drawPopup
Project-Level Documentation
- widgetTour.h – the widget tour: pages, touch tags and how to call it
- widgetTour.c – drawing the pages, reading touch, the pop-up
- main.c – the start-up check and the call to the widget tour
Bridgetek's library (STM32_Bridgetek_EVE_API) is third-party code used as supplied and is not part of this documentation.
Hardware
The same wiring as Part 2. The ME817EV host connector CN8 goes to the NUCLEO-H753ZI: SCK to PA5, MISO to PA6, MOSI to PB5 (SPI1), CS# to PB6, PD# to PD15, INT# to PF3, and both CN8 GND pins to GND. The ME817EV is powered from its own USB-C supply; never connect its 5V_HOST pin to the Nucleo. Connect the two boards' grounds with a short, heavy connection as well. The terminal is USART1 at 19200 baud.
Things worth knowing
- 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 a string on the STM32 is formatted with snprintf() first (a co-processor exception otherwise).
- When a page changes under a finger that is still down, the button drawn there must not count as pressed; a press therefore counts only on the frame where the finger first touches.
- CMD_SPINNER animates until CMD_STOP, which does not fit a screen redrawn every frame, so it is not used here.