diff options
| author | Hristo Kovachev <bger@rockbox.org> | 2005-12-22 10:43:36 +0000 |
|---|---|---|
| committer | Hristo Kovachev <bger@rockbox.org> | 2005-12-22 10:43:36 +0000 |
| commit | 9b83c6c4bddca41411d31b8aab17ecc577b37eb4 (patch) | |
| tree | 3311cff5a451e4462e02feffdfe4ddc610eeb6e5 /firmware/drivers | |
| parent | 9d67765cae62e873c3d004bf9bcb68947f1568f6 (diff) | |
| download | rockbox-9b83c6c4bddca41411d31b8aab17ecc577b37eb4.zip rockbox-9b83c6c4bddca41411d31b8aab17ecc577b37eb4.tar.gz rockbox-9b83c6c4bddca41411d31b8aab17ecc577b37eb4.tar.bz2 rockbox-9b83c6c4bddca41411d31b8aab17ecc577b37eb4.tar.xz | |
Patch No 1387627 by Peter D'Hoye: Backlight Brightness setting for H300
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8280 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
| -rw-r--r-- | firmware/drivers/pcf50606.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/firmware/drivers/pcf50606.c b/firmware/drivers/pcf50606.c index b99b2e9..cb05d25 100644 --- a/firmware/drivers/pcf50606.c +++ b/firmware/drivers/pcf50606.c @@ -44,6 +44,7 @@ /* delay loop to achieve 400kHz at 120MHz CPU frequency */ #define DELAY do { int _x; for(_x=0;_x<22;_x++);} while(0) +void pcf50606_set_bl_pwm(unsigned char ucVal); static void pcf50606_i2c_start(void) { @@ -281,5 +282,23 @@ void pcf50606_init(void) set_voltages(); /* Backlight PWM = 512Hz 50/50 */ - pcf50606_write(0x35, 0x13); + /*pcf50606_write(0x35, 0x13);*/ + pcf50606_set_bl_pwm(9); +} + +void pcf50606_set_bl_pwm(unsigned char ucVal) +{ + /* set the backlight PWM */ + /* range is 0 - 15 */ + + /* limit incoming value */ + ucVal = ucVal & 0x0F; + + /* shift one bit left */ + ucVal = ucVal << 1; + ucVal = ucVal | 0x01; + + /* 0x00 = 512Hz */ + ucVal = ucVal | 0x00; + pcf50606_write(0x35, ucVal); } |