Set display brightness of EDT 7" using C# with WEC800

Hi,

from your great code-examples (vcsharp_pwm_demo_v1.0.zip) I got the following code:

pwm.Pwm_SetConfigInt(pwmHandle_D, "BaseFreq", pwmBaseFreqDemo, TdxCommon.ParamStorageType.StoreVolatile);
pwm.Pwm_Open(pwmHandle_D);

this causes the brightness to become 100% (fully bright), but why?? How can I read the current PWM value (brightness)?

var success = pwm.Pwm_SetPwm(pwmHandle_D, pwmFrequencyD, dutyCycleD * pwmOffsetFactor / 100);

success is TRUE but the brightness (between 0 and 65536) does not change.

I have found the solution. You have to first set the IO config for that PWM port, and set the PIN corresponding to the docs (apalis_arm_som_imx6_datasheet.pdf):

pwm.Pwm_SetConfigInt(pwmHandle_D, "io", 0x003000EF,  TdxCommon.ParamStorageType.StoreVolatile);

Then set the freqency (pwmBaseFreqDemo = baseFreqiMX6x = 20000000)

pwm.Pwm_SetConfigInt(pwmHandle_D, "BaseFreq", pwmBaseFreqDemo, TdxCommon.ParamStorageType.StoreVolatile);

You should check that the pin is configured as PWM and not as a regular GPIO using the GPIO library. You should configure the PWM library to use the pin you need as output and you can check that it has been properly configured using the gpio tool.