Hello,
on our baseboard PWM4 is used for backlight brightness control.
I tried to change brightness with test routine shown below.
Unfortunately I did not see any influence - brightness did not change at all.
Do you have any idea what may be wrong ?
Thank you !
void set_backlightpwm() {
DWORD dutyPercent = 0;
HANDLE pwm = Pwm_Init(L"PWM4");
if (pwm) {
int returnValue = Pwm_SetConfigInt(pwm, L"BaseFreq",20000000,StoreVolatile);
uIo io = APALIS_PIN(8);
returnValue = Pwm_SetConfigInt(pwm, L"io", io.GenericDefinition, StoreVolatile);
returnValue = Pwm_Open(pwm);
Pwm_SetPwm(pwm, 1000/*Hz*/, 32768/*of 65536*/); // 1kHz, 50%
for (dutyPercent = 0; dutyPercent <= 100; dutyPercent++) {
Pwm_SetPwm(pwm, 1000/*Hz*/, (65536 * dutyPercent)/100); // 1kHz, sweep duty cycle
Sleep(100);
}
Pwm_Close(pwm);
Pwm_Deinit(pwm);
}
}