1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
32 DI (Data In) - PB0 (doubles as data pin for the LCD)
33 CL (Clock) - PB1 (doubles as clock for the LCD)
34 CE (Chip Enable) - PB3 (also chip select for the LCD, but active low)
38 /* cute little functions */
39 #define CE_LO and_b(~0x08, PBDRL_ADDR)
40 #define CE_HI or_b(0x08, PBDRL_ADDR)
41 #define CL_LO and_b(~0x02, PBDRL_ADDR)
42 #define CL_HI or_b(0x02, PBDRL_ADDR)
43 #define DO (PBDR & 0x10)
44 #define DI_LO and_b(~0x01, PBDRL_ADDR)
45 #define DI_HI or_b(0x01, PBDRL_ADDR)
47 #define START or_b((0x08 | 0x02), PBDRL_ADDR)
50 #define DELAY do { int _x; for(_x=0;_x<10;_x++);} while (0)
53 int fmradio_read(int addr
)
60 /* First address bit */
70 /* Second address bit */
80 for(i
= 0; i
< 21;i
++)
95 void fmradio_set(int addr
, int data
)
99 /* Include the address in the data */
104 for(i
= 0; i
< 23;i
++)