diff options
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/pcf50606.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/firmware/drivers/pcf50606.c b/firmware/drivers/pcf50606.c index af2c2ca2eb..f4c93deb38 100644 --- a/firmware/drivers/pcf50606.c +++ b/firmware/drivers/pcf50606.c | |||
@@ -44,8 +44,6 @@ | |||
44 | /* delay loop to achieve 400kHz at 120MHz CPU frequency */ | 44 | /* delay loop to achieve 400kHz at 120MHz CPU frequency */ |
45 | #define DELAY do { int _x; for(_x=0;_x<22;_x++);} while(0) | 45 | #define DELAY do { int _x; for(_x=0;_x<22;_x++);} while(0) |
46 | 46 | ||
47 | void pcf50606_set_bl_pwm(unsigned char ucVal); | ||
48 | |||
49 | static void pcf50606_i2c_start(void) | 47 | static void pcf50606_i2c_start(void) |
50 | { | 48 | { |
51 | SDA_OUTPUT; | 49 | SDA_OUTPUT; |
@@ -285,24 +283,5 @@ void pcf50606_init(void) | |||
285 | pcf50606_write(0x09, 0x05); /* USB and ON key debounce: 14ms */ | 283 | pcf50606_write(0x09, 0x05); /* USB and ON key debounce: 14ms */ |
286 | pcf50606_write(0x29, 0x1C); /* Disable the unused MBC module */ | 284 | pcf50606_write(0x29, 0x1C); /* Disable the unused MBC module */ |
287 | 285 | ||
288 | /* Backlight PWM = 512Hz 50/50 */ | 286 | pcf50606_write(0x35, 0x13); /* Backlight PWM = 512Hz 50/50 */ |
289 | /*pcf50606_write(0x35, 0x13);*/ | ||
290 | pcf50606_set_bl_pwm(9); | ||
291 | } | ||
292 | |||
293 | void pcf50606_set_bl_pwm(unsigned char ucVal) | ||
294 | { | ||
295 | /* set the backlight PWM */ | ||
296 | /* range is 0 - 15 */ | ||
297 | |||
298 | /* limit incoming value */ | ||
299 | ucVal = ucVal & 0x0F; | ||
300 | |||
301 | /* shift one bit left */ | ||
302 | ucVal = ucVal << 1; | ||
303 | ucVal = ucVal | 0x01; | ||
304 | |||
305 | /* 0x00 = 512Hz */ | ||
306 | ucVal = ucVal | 0x00; | ||
307 | pcf50606_write(0x35, ucVal); | ||
308 | } | 287 | } |