From 2392bb41996963c6683253114bdfb3174146e7dc Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Thu, 31 Dec 2009 19:15:20 +0000 Subject: FS#10047 : Clipv2 Reuse some code from Clip (LCD) and a lot of code from AS3525 Add a new CPU type : AS3525v2, identical to AS3525 except it's an ARMv5 (arm926-ejs) SD code still not working For an unknown reason LCD doesn't work anymore (to be investigated) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24131 a1c6a512-1295-4272-9138-f99709370657 --- .../target/arm/as3525/sansa-clip/lcd-ssd1303.c | 55 +++++++++++++++++++--- 1 file changed, 49 insertions(+), 6 deletions(-) (limited to 'firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c') diff --git a/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c b/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c index 1ca26dd1a1..45de3e80dc 100644 --- a/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c +++ b/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c @@ -9,7 +9,7 @@ * * Copyright (C) 2002 by Alan Korr * Copyright (C) 2008 François Dinel - * Copyright (C) 2008 Rafaël Carré + * Copyright (C) 2008-2009 Rafaël Carré * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -30,7 +30,12 @@ #include "string.h" /*** AS3525 specifics ***/ +#ifdef SANSA_CLIPV2 +#include "as3525v2.h" +#else #include "as3525.h" +#endif + #include "ascodec.h" /*** definitions ***/ @@ -71,6 +76,7 @@ /* DBOP initialisation, do what OF does */ static void ams3525_dbop_init(void) { +#ifdef SANSA_CLIP CGU_DBOP = (1<<3) | AS3525_DBOP_DIV; GPIOB_AFSEL = 0x08; /* DBOP on pin 3 */ @@ -79,14 +85,34 @@ static void ams3525_dbop_init(void) DBOP_CTRL = 0x51008; DBOP_TIMPOL_01 = 0x6E167; DBOP_TIMPOL_23 = 0xA167E06F; +#else /* SANSA_CLIPV2 */ + CCU_IO |= (1<<12); /* ?? */ + CGU_DBOP |= /*(1<<3)*/ 0x18 | AS3525_DBOP_DIV; + + DBOP_CTRL = 0x51004; + DBOP_TIMPOL_01 = 0x36A12F; + DBOP_TIMPOL_23 = 0xE037E037; +#endif } +#ifdef SANSA_CLIP +#define LCD_DELAY 1 +#else /* SANSA_CLIPV2 */ +#define LCD_DELAY 10 +#endif + void lcd_write_command(int byte) { volatile int i = 0; - while(i<1) i++; + while(i