1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2008 by Dave Chapman
11 * Copyright (C) 2010 by Thomas Martitz
13 * LCD driver for the Sansa Fuze - controller unknown
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
23 ****************************************************************************/
29 #include "clock-target.h"
30 #include "dbop-as3525.h"
33 void lcd_write_cmd(int16_t cmd
)
35 unsigned short data
= swap16(cmd
);
36 DBOP_TIMPOL_23
= 0xA12F0036;
37 dbop_write_data(&data
, 1);
44 DBOP_TIMPOL_23
= 0xA12FE037;
47 void lcd_write_reg(int reg
, int value
)
49 int16_t data
= swap16(value
);
51 dbop_write_data(&data
, 1);
55 static void as3525_dbop_init(void)
58 CGU_DBOP
|= (1<<4) | (1<<3) | AS3525_DBOP_DIV
;
59 DBOP_TIMPOL_01
= 0xE12FE12F;
60 DBOP_TIMPOL_23
= 0xE12F0036;
62 DBOP_TIMPOL_23
= 0x60036;
64 DBOP_TIMPOL_01
= 0x60036;
65 DBOP_TIMPOL_23
= 0xA12FE037;
69 void lcd_init_device(void)
73 GPIOA_DIR
|= (0x20|0x1);
79 GPIOB_DIR
|= (1<<0)|(1<<2)|(1<<3);