WebRadioApp  0.1
ew_bsp_display.c File Reference

This file is part of the interface (glue layer) between an Embedded Wizard generated UI application and the board support package (BSP) of a dedicated target. Please note: The implementation of this module is partially based on examples that are provided within the STM32 cube firmware. In case you want to adapt this module to your custom specific hardware, please adapt the hardware initialization code according your needs or integrate the generated initialization code created by using the tool CubeMX. This template is responsible to initialize the display hardware of the board and to provide the necessary access to update the display content. More...

#include "ewconfig.h"
#include "stm32h7xx_hal.h"
#include "stm32h747i_discovery.h"
#include "stm32h747i_discovery_bus.h"
#include "stm32h747i_discovery_lcd.h"
#include <string.h>
#include "ewrte.h"
#include "ew_bsp_graphics.h"
#include "ew_bsp_display.h"
#include "ew_bsp_clock.h"
Include dependency graph for ew_bsp_display.c:

Macros

#define LAYER_INDEX   0
 
#define VSYNC   1
 
#define VBP   1
 
#define VFP   1
 
#define HSYNC   1
 
#define HBP   1
 
#define HFP   1
 
#define NO_AREA   0
 
#define LEFT_AREA   1
 
#define RIGHT_AREA   2
 
#define hltdc_handle   hlcd_ltdc
 
#define hdsi_handle   hlcd_dsi
 
#define __DSI_MASK_TE()   (GPIOJ->AFR[0] &= (0xFFFFF0FFU))
 
#define __DSI_UNMASK_TE()
 
#define DSI_COLOR_CODING   DSI_RGB888
 
#define OTM8009A_FORMAT   OTM8009A_FORMAT_RGB888
 

Functions

void LCD_MspInit (void)
 LCD Intialization. More...
 
static void LCD_DisplayOn (void)
 LCD ON. More...
 
static void LCD_DisplayOff (void)
 LCD OFF. More...
 
static int32_t DSI_IO_Write (uint16_t ChannelNbr, uint16_t Reg, uint8_t *pData, uint16_t Size)
 DCS or Generic short/long write command. More...
 
static int32_t DSI_IO_Read (uint16_t ChannelNbr, uint16_t Reg, uint8_t *pData, uint16_t Size)
 DCS or Generic read command. More...
 
void LTDC_IRQHandler (void)
 
void LTDC_ER_IRQHandler (void)
 
void DSI_IRQHandler (void)
 
void HAL_DSI_TearingEffectCallback (DSI_HandleTypeDef *hdsi)
 
void HAL_DSI_EndOfRefreshCallback (DSI_HandleTypeDef *hdsi)
 
static void WaitForDsiTransfer (void)
 
int EwBspDisplayInit (XDisplayInfo *aDisplayInfo)
 The function EwBspDisplayInit initializes the display hardware and returns the display parameter. More...
 
void EwBspDisplayDone (void)
 The function EwBspDisplayDone deinitializes the display hardware. More...
 
int EwBspDisplayGetUpdateArea (XRect *aUpdateRect)
 The function EwBspDisplayGetUpdateArea returns the next update area depending on the selected display mode: In case of a synchroneous single-buffer, the function has to return the the rectangular areas that correspond to the horizontal stripes (fields) of the framebuffer. In case of a scratch-pad buffer, the function has to return the subareas that fit into the provided update rectangle. During each display update, this function is called until it returns 0. More...
 
void EwBspDisplayWaitForCompletion (void)
 The function EwBspDisplayWaitForCompletion is called from the Graphics Engine to ensure that all pending activities of the display system are completed, so that the rendering of the next frame can start. In case of a double-buffering system, the function has to wait until the V-sync has occured and the pending buffer is used by the display controller. In case of an external display controller, the function has to wait until the transfer (update) of the graphics data has been completed and there are no pending buffers. More...
 
void EwBspDisplayCommitBuffer (void *aAddress, int aX, int aY, int aWidth, int aHeight)
 The function EwBspDisplayCommitBuffer is called from the Graphics Engine when the rendering of a certain buffer has been completed. The type of buffer depends on the selected framebuffer concept. If the display is running in a double-buffering mode, the function is called after each buffer update in order to change the currently active framebuffer address. Changing the framebuffer address should be synchronized with V-sync. If the system is using an external graphics controller, this function is responsible to start the transfer of the framebuffer content. More...
 
void EwBspDisplaySetClut (unsigned long *aClut)
 The function EwBspDisplaySetClut is called from the Graphics Engine in order to update the hardware CLUT of the current framebuffer. The function is only called when the color format of the framebuffer is Index8 or LumA44. More...
 

Variables

LTDC_HandleTypeDef hltdc_handle
 
DSI_HandleTypeDef hdsi_handle
 
static LTDC_LayerCfgTypeDef LayerConfig
 
static volatile int32_t ActiveArea = NO_AREA
 
static RCC_PeriphCLKInitTypeDef PeriphClkInitStruct
 
uint8_t pColLeft [] = {0x00, 0x00, 0x01, 0x8F}
 
uint8_t pColRight [] = {0x01, 0x90, 0x03, 0x1F}
 
uint8_t pPage [] = {0x00, 0x00, 0x01, 0xDF}
 
uint8_t pScanCol [] = {0x02, 0x15}
 
static int FirstUpdateIsDone = 0
 

Detailed Description

This file is part of the interface (glue layer) between an Embedded Wizard generated UI application and the board support package (BSP) of a dedicated target. Please note: The implementation of this module is partially based on examples that are provided within the STM32 cube firmware. In case you want to adapt this module to your custom specific hardware, please adapt the hardware initialization code according your needs or integrate the generated initialization code created by using the tool CubeMX. This template is responsible to initialize the display hardware of the board and to provide the necessary access to update the display content.

Author
Kevin Bello (k.bel.nosp@m.lo@t.nosp@m.um.de)
Version
0.1
Date
2021-04-17
  • coauthor {name}