-
Notifications
You must be signed in to change notification settings - Fork 0
Home

Checkout the git directory, you will find some main.c with pseudo code. Anybody who is used to develop with STMCube for STM32 should be able to use this, others will have to find the way to configure their hardware for SPI support (SPI_POLARITY_HIGH, SPI_FIRSTBIT_LSB just by definition of this library).
To follow the fast reconfiguration of the display implementation with DMA is required. After your SPI is configured with DMA, you can start the display with
deh7800_startSpiDMA();
The SPI DMA callback (HAL_SPI_RxCpltCallback(SPI_HandleTypeDef* spiHandle)) will than check if the beginning of a multipart data transfer is happening and copy all the relevant data into spiRxBuffer[deh_7800_spi_BufferSize]
To display this data once in a while (-loop), call deh7800_showDisplay(...) with some positioning and coloring options. For sure you have to find your own way to implement all LCD_*-calls to get something drawn of the display of your choice. As you can see, the major magic happens in
void deh7800_showSegments(unsigned int rootX, unsigned int rootY, uint16_t fg_color);
void deh7800_showSideMatrix(unsigned int rootX, unsigned int rootY, uint16_t fg_color);
void deh7800_showIcons(unsigned int rootX, unsigned int rootY, uint16_t fg_color, uint16_t bg_color, uint16_t inactive_color);
void deh7800_showInfoBar(unsigned int rootX, unsigned int rootY, uint16_t fg_color);There is crazy code mapping the datastream to some suitable pixels, and that's what this library is all about!
For the display I used some Nucleo STM32-L476RG board and attached some Adafruit Touch Screen to it. Send a personal mail if you are using the same hardware and I might provide you with more files on howto use the display etc.
The first step to figure out howto connect a display is to turn apart the whole radio. Once you open the display, you will see two Multi-function Segment Drivers BU97540KV on this board.

While reading the complete documentation, you can see that this chip is connected via SPI and can run in 2-chip Master+Slave mode. Perfect. Some measurements later I had the right pins sorted out and a wire connected to a test stm32 board. In the image you can see the relevant contacts, the descriptions in this image have to be mapped to the contact tip, not the board


As you can see, only SPI and SCK are connected, I only like to read the display data, not to modify it. In the current version I will connect the Src-Pin as well to be able to switch the radio on and off via the remote control.
So, we can connect now our Microcontroller directly to these pins, to improve the signal quality and prevent disturbances I added some high-speed differential line drivers to those lines (SN65LVDS9638DGN = Sender / SN65LVDT34D = Receiver).
After this was done, the puzzling about interpreting the datastream started. It was not easy to make sense out of the data. At the beginning I used mainly static data (like the settings menu) and compared the changes in it visually with the complete dataset out trough void deh7800_printDataOverview(void).

But this didn't helped on the long run, therefore I implemented a website with the display parts to be able to click all elements on or off as I liked (DisplayClicker.html). Beside I let it calculate some dataset out of the current settings, just a combination of all data how I would have implemented to control.
In parallel, I read out the data coming via the SPI to the display. After collecting a few data-pairs (one from my website, one from the spi) I matched them and checked which combination makes the most sense (DisplayMatch.c). Assuming that the display board developer will mostly use parallel wires for its elements and only break this rule if it's really required, I could find some schemas in the chaos.
And with a lot of guessing I had a working display, yeah!