Implementation file for display and touch handling. More...
Functions | |
static void | dp_lvgl_flush (lv_display_t *disp, const lv_area_t *area, uint8_t *px_map) |
Flush the display buffer to the ILI9341 display. | |
static void | dp_lvgl_read (lv_indev_t *indev, lv_indev_data_t *data) |
Read touch input data from the XPT2046 touchscreen. | |
void | dp_init (void) |
Initialize the display and touchscreen. | |
void | dp_lvgl_init (void) |
Initialize LVGL and set up the display buffer and input device. | |
void | ILI9341_FillWindowCmpltCallBack (void) |
Callback function for ILI9341 fill window complete. | |
Variables | |
lv_display_t * | display |
lv_indev_t * | indev |
XPT2046Handle_t | xpt2046Handle |
SPI_HandleTypeDef * | ili9341_spi = &hspi1 |
SPI_HandleTypeDef * | xpt2046_spi = &hspi3 |
Implementation file for display and touch handling.
This file contains the implementation for initializing and managing the display and touch input for the system. It includes functions for setting up the LVGL display buffer, flushing display data, and reading touch input from the XPT2046 touch screen controller. The file also includes a callback function for the ILI9341 display driver to indicate when a window fill operation is complete.
Created on: Jul 5, 2024 Author: Viktor
void dp_init | ( | void | ) |
Initialize the display and touchscreen.
This function initializes the ILI9341 display and the XPT2046 touchscreen, including setting calibration values for the touchscreen.
|
static |
Flush the display buffer to the ILI9341 display.
This function is called by LVGL to update the display area. It sets the window area on the ILI9341 and then starts the DMA transfer.
disp | Pointer to the display structure. |
area | Pointer to the area to be updated. |
px_map | Pointer to the pixel map containing the buffer data. |
void dp_lvgl_init | ( | void | ) |
Initialize LVGL and set up the display buffer and input device.
This function initializes LVGL, creates a display and input device, sets up the display buffer, and assigns callback functions for display flushing and input reading.
|
static |
Read touch input data from the XPT2046 touchscreen.
This function is called by LVGL to get touch input data from the XPT2046 touchscreen. It checks if the screen is pressed and reads the coordinates if it is.
indev | Pointer to the input device structure. |
data | Pointer to the data structure where the touch input will be stored. |
void ILI9341_FillWindowCmpltCallBack | ( | void | ) |
Callback function for ILI9341 fill window complete.
Weak callback function for window fill completion.
This function is called when the DMA transfer to fill the window on the ILI9341 display is complete. It signals LVGL that the flush operation is done and the display is ready for the next update.
lv_display_t* display |
Pointer to the LVGL display object
SPI_HandleTypeDef* ili9341_spi = &hspi1 |
SPI handle for the ILI9341 display
lv_indev_t* indev |
Pointer to the LVGL input device object
SPI_HandleTypeDef* xpt2046_spi = &hspi3 |
SPI handle for the XPT2046 touch screen
XPT2046Handle_t xpt2046Handle |
Handle for the XPT2046 touch screen controller