Low-Cost Rotary Knob Display from Team Source Display
Solution Overview
This is a rotary display with a 240x240 circular TFT LCD and an STM32C091 core controller. It features an aluminum alloy frame that can rotate infinitely left and right, 360 degree surround LED ambient lighting, and can be pressed down as a button. The cost is super cool, and also requires less attention to interaction design details during development.
Hardware Description
When open the official sample project file to check its peripherals. We can see that more than half of the pins are occupied by its built-in peripherals, essentially consuming all the resources of this LQFP48 MCU.


This rotary display is an SPI screen, controlled by SPI1. There is also three PWM channels to control the RGB ambient lighting.

To facilitate debugging without a programmer, the template project includes USART1 for serial port printing. KEY_A and KEY_B are microswitches used to detect clockwise and counterclockwise rotation of the outer frame. There is also a pin labeled KEY_CLICK to determine whether a button is pressed. In the project, we can write a KeySampler to connect all the hardware entities of the buttons to the TouchGFX interface. The official documentation already provides one, so it’s no need to write it ourselves like when first used the ST screen expansion board.

Software Description
Surprisingly, ST has officially provided a TouchGFX project template for it, which saves you the trouble of manually porting it yourself.

Meanwhile, an official development guide has been released on support.touchgfx.com to help us quickly get started with this non-touchscreen interaction mode of knob + single button.

Create a carousel menu controlled by a knob
First, let's outline the software architecture for this part.

This is a diagram that AI Diantang drew specifically for this tutorial. Our core focus is on how to most easily connect the behavior of hardware buttons and controls. This diagram actually explains everything.
The triggering of the hardware button is passed to the TouchGFX application layer via KeySampler.
In TouchGFX Designer, we manually define the functions that run when each button is triggered. These functions are responsible for helping us scroll and rotate the menu

Something like this. So in our project, we need to create a function for the scroll menu, which allows you to use the knob to scroll and rotate the menu.



