cancel
Showing results for 
Search instead for 
Did you mean: 

How to turn on/off backlight of STM32H747I_DISCO board

Louie88
Associate III

I would like to turn off the backlight if the LCD module of STM32H747I_DISCO board. I figured out that the PJ12 (LCD_BL_CTRL, PORT = J PIN = 12) probably controls the backlight of the LCD module (from schematics). The "PJ12" is initialized in "main.MX_GPIO_Init()" and it is set to output to level low (GPIO_PIN_RESET) during POR. 

I tried to set PJ12 to high and low with the follow HAL call:

 

 

void Screen1View::handleTickEvent()
{
	if (++tickCount >= ScreenUpdateCount)
	{
		tickCount = 0;
		updateScreen();
		if (++lcdBackLightCount >= TurnOffLcdBacklightCount)
		{
			lcdBackLightCount = 0;
			// Turn off LCD
			HAL_GPIO_WritePin(GPIOJ, LCD_BL_Pin, GPIO_PIN_SET);
			// HAL_GPIO_WritePin(GPIOJ, LCD_BL_Pin, GPIO_PIN_RESET);
		}
	}
}

 

 

 

but it did nothing. Backlight of the LCD stays always on.

The test app is based on TouchGFX.

Any idea?

Thanks,

Louis

 

10 REPLIES 10
Louie88
Associate III

Okay, now I can turn off the LCD/Backlight anytime, but I need to turn it back (on) if any part of the LCD Module is touched. I probably need to capture the TOUCH interrupt and turn the backlight on from the interrupt service routine. I could not find any usable idea in the community forum.

Thanks,

Louis