Hi, all
More than several customers want to use the general purpose timers to implement the PWM outputs on AM37x/35x Linux platform.
And we find that there is a simple guide on internet: http://www.jumpnowtek.com/index.php?option=com_content&view=article&id=56&Itemid=63.
According to the guide, one customer, Jabil, have some try as following:
/*! \fn static void lcd_set_bk_duty(int duty)
\brief set the PWM duty of LCD backlight
\param duty the duty to set, 0 ~ 100
*/
static void lcd_set_bk_duty(int duty)
{
int match_value = 0;
if (NULL == lcd_bk_timer)
{
return;
}
duty = (duty < 0 ? : (duty > 100 ? 100 : duty));
match_value = LCD_BK_FREQ_DEF + (0xFFFFFFFE - LCD_BK_FREQ_DEF) * (100 - duty) / 100;
omap_dm_timer_set_match(lcd_bk_timer, 1, match_value);
omap_dm_timer_set_pwm(lcd_bk_timer, 1, 1, 1);
omap_dm_timer_set_config(lcd_bk_timer, 0x1842);
omap_dm_timer_start(lcd_bk_timer);
duty_bak = duty;
}
But they found that the PWM duty can’t reach 0% or 100% even through it is much closed.
So is there some advice for this?
Thanks & BR !
Yaoming