Skip to content

Conversation

@abhinav-s235
Copy link
Contributor

We are using config macros to perform backlight inversion because we are setting backlight to 0 before initialization. At this point we can not read the value of power_inversion, so the inversion logic must be decided statically using config macros.

…nverted) and LCD_ST7785_TYPEB(non_inverted) in power logic

Add CONFIG_LCD_ST7785_TYPEA to existing power inversion condition(via OR)
Add CONFIG_LCD_ST7785_TYPEB in non-inverted power path under existing elif
Copy link
Contributor

@seokhun-eom24 seokhun-eom24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

InterruptEn(lcdc_irq_info.num, lcdc_irq_info.priority);
}
#if defined(CONFIG_LCD_ST7701SN)
#if defined(CONFIG_LCD_ST7701SN) || defined(CONFIG_LCD_ST7785_TYPEA)
Copy link
Contributor

@Taejun-Kwon Taejun-Kwon Jul 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should refer to my comment in your another PR, #6910 (comment)
so below style can be applied. we hide h/w from this code.

static void rtl8730e_control_backlight(float level)
{
	...
	pwmout_write(&g_rtl8730e_config_dev_s.pwm_led, level);
	...
}

static int lcd_setpower(FAR struct lcd_dev_s *dev, int power)
{
	FAR struct mipi_lcd_dev_s *priv = (FAR struct mipi_lcd_dev_s *)dev;
	struct mipi_dsi_device *dsi = dev->dsi_dev;
	...
	dsi->lcd_setpower(priv->config, power);
	...
}

static void st7785_lcd_setpower(struct mipi_lcd_config_s *config, int power)
{
	float level = level/100.0
	config->backlight(level);
}

static void st7701SN_lcd_setpower(struct mipi_lcd_config_s *config, int power)
	float level = 1.0 - (level/100.0);
	config->backlight(level);
}

@seokhun-eom24
Copy link
Contributor

LCD_ST7785_TYPEA and LCD_ST7785_TYPEB definitions are no longer used, could you please close this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants