diff --git a/firmware/SOURCES b/firmware/SOURCES index c347ad7903..5ecad19bba 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -1208,7 +1208,8 @@ target/arm/tcc77x/c100/audio-c100.c #ifdef SANSA_CLIPPLUS #ifndef SIMULATOR -target/arm/as3525/sansa-clip/lcd-ssd1303.c +target/arm/as3525/lcd-ssd1303.c +target/arm/as3525/sansa-clipplus/lcd-clip-plus.c target/arm/as3525/sansa-clipplus/lcd-as-clip-plus.S target/arm/as3525/sansa-clipplus/button-clip.c target/arm/as3525/sansa-clipplus/backlight-clip.c @@ -1221,8 +1222,9 @@ target/arm/as3525/sansa-clip/powermgmt-clip.c #ifdef SANSA_CLIPV2 #ifndef SIMULATOR -target/arm/as3525/sansa-clip/lcd-ssd1303.c -target/arm/as3525/sansa-clip/lcd-as-clip.S +target/arm/as3525/lcd-ssd1303.c +target/arm/as3525/sansa-clipv2/lcd-clipv2.c +target/arm/as3525/sansa-clip/lcd-as-clip.S /* TODO for clipv2 */ target/arm/as3525/sansa-clipv2/button-clip.c target/arm/as3525/sansa-clipv2/backlight-clip.c #ifndef BOOTLOADER @@ -1234,7 +1236,8 @@ target/arm/as3525/sansa-clip/powermgmt-clip.c #ifdef SANSA_CLIP #ifndef SIMULATOR -target/arm/as3525/sansa-clip/lcd-ssd1303.c +target/arm/as3525/lcd-ssd1303.c +target/arm/as3525/sansa-clip/lcd-clip.c target/arm/as3525/sansa-clip/lcd-as-clip.S target/arm/as3525/sansa-clip/button-clip.c target/arm/as3525/sansa-clip/backlight-clip.c diff --git a/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c b/firmware/target/arm/as3525/lcd-ssd1303.c similarity index 71% rename from firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c rename to firmware/target/arm/as3525/lcd-ssd1303.c index dba5b9c3d7..e4437e70ca 100644 --- a/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c +++ b/firmware/target/arm/as3525/lcd-ssd1303.c @@ -22,21 +22,13 @@ ****************************************************************************/ #include "config.h" -#include "hwcompat.h" #include "kernel.h" #include "lcd.h" #include "system.h" #include "cpu.h" #include "string.h" -/*** AS3525 specifics ***/ -#ifdef SANSA_CLIPV2 -#include "as3525v2.h" -#else -#include "as3525.h" -#endif - -#include "ascodec.h" +#include "lcd-clip.h" /*** definitions ***/ @@ -73,125 +65,6 @@ #define LCD_CNTL_HIGHCOL 0x10 /* Upper column address */ #define LCD_CNTL_LOWCOL 0x00 /* Lower column address */ - -static void lcd_hw_init(void) -{ -#if defined(SANSA_CLIP) -/* DBOP initialisation, do what OF does */ - CGU_DBOP = (1<<3) | AS3525_DBOP_DIV; - - GPIOB_AFSEL = 0x08; /* DBOP on pin 3 */ - GPIOC_AFSEL = 0x0f; /* DBOP on pins 3:0 */ - - DBOP_CTRL = 0x51008; - DBOP_TIMPOL_01 = 0x6E167; - DBOP_TIMPOL_23 = 0xA167E06F; -#elif defined(SANSA_CLIPV2) -/* DBOP initialisation, do what OF does */ - CCU_IO |= (1<<12); /* ?? */ - CGU_DBOP |= /*(1<<3)*/ 0x18 | AS3525_DBOP_DIV; - - DBOP_CTRL = 0x51004; - DBOP_TIMPOL_01 = 0x36A12F; - DBOP_TIMPOL_23 = 0xE037E037; -#elif defined(SANSA_CLIPPLUS) - CGU_PERI |= CGU_SSP_CLOCK_ENABLE; - - SSP_CPSR = AS3525_SSP_PRESCALER; /* OF = 0x10 */ - SSP_CR0 = (1<<7) | (1<<6) | 7; /* Motorola SPI frame format, 8 bits */ - SSP_CR1 = (1<<3) | (1<<1); /* SSP Operation enabled */ - SSP_IMSC = 0; /* No interrupts */ -#endif -} - -#ifdef SANSA_CLIP -#define LCD_DELAY 1 -#else /* SANSA_CLIPV2 */ -#define LCD_DELAY 10 -#endif - -#if defined(SANSA_CLIP) || defined(SANSA_CLIPV2) -void lcd_write_command(int byte) -{ - volatile int i = 0; - while(i