Sansa clipzip: miscellaneous updates

* add support for OF version 01.01.17 in mkamsboot
* introduce and implement oled_brightness function
* configure voltage CVDD2 to 2.8V (like the OF does)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30831 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Bertrik Sikken 2011-10-23 14:20:47 +00:00
parent bf831106f5
commit 94c573f3ec
4 changed files with 24 additions and 9 deletions

View file

@ -336,18 +336,28 @@ static void lcd_setup_rect(int x, int x_end, int y, int y_end)
}
/* sets the brightness of the OLED */
void lcd_brightness(uint8_t red, uint8_t green, uint8_t blue)
void oled_brightness(int brightness)
{
int r, g, b;
if (lcd_type == 0) {
lcd_write(0x40, red); /* COLUMN_CURRENT_R */
lcd_write(0x41, green); /* COLUMN_CURRENT_G */
lcd_write(0x42, blue); /* COLUMN_CURRENT_B */
r = 2 + 16*brightness;
g = 1 + 10*brightness;
b = 1 + (23*brightness)/2;
lcd_write(0x40, r); /* COLUMN_CURRENT_R */
lcd_write(0x41, g); /* COLUMN_CURRENT_G */
lcd_write(0x42, b); /* COLUMN_CURRENT_B */
}
else {
r = 6 + 10*brightness;
g = 1 + 6*brightness;
b = 3 + 10*brightness;
lcd_write_cmd(0x0E);
lcd_write_nibbles(red);
lcd_write_nibbles(green);
lcd_write_nibbles(blue);
lcd_write_nibbles(r);
lcd_write_nibbles(g);
lcd_write_nibbles(b);
}
}

View file

@ -23,5 +23,5 @@
#include "config.h"
/* target-specific OLED brightness function */
void lcd_brightness(uint8_t red, uint8_t green, uint8_t blue);
void oled_brightness(int brightness);

View file

@ -285,7 +285,11 @@ void system_init(void)
ascodec_write_pmu(0x18, 1, 0x35);
/* AVDD17: set AVDD17 power supply to 2.5V */
ascodec_write_pmu(0x18, 7, 0x31);
#else
#ifdef SANSA_CLIPZIP
/* CVDD2: set CVDD2 power supply to 2.8V */
ascodec_write_pmu(0x17, 2, 0xF4);
#endif
#else /* HAVE_AS3543 */
ascodec_write(AS3514_CVDD_DCDC3, AS314_CP_DCDC3_SETTING);
#endif /* HAVE_AS3543 */

View file

@ -174,6 +174,7 @@ static struct md5sums sansasums[] = {
#if 0 /* disabled for now because it's not been proven they can be patched */
{ MODEL_CLIPZIP, "1.01.12", "45adea0873326b5af34f096e5c402f78" },
{ MODEL_CLIPZIP, "1.01.15", "f62af954334cd9ba1a87a7fa58ec6074" },
{ MODEL_CLIPZIP, "1.01.17", "27bcb343d6950f35dc261629e22ba60c" },
#endif
};