1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
29 DI (Data In) - PB0 (doubles as data pin for the LCD)
30 CL (Clock) - PB1 (doubles as clock for the LCD)
31 CE (Chip Enable) - PB3 (also chip select for the LCD, but active low)
35 /* cute little functions */
36 #define CE_LO and_b(~0x08, PBDRL_ADDR)
37 #define CE_HI or_b(0x08, PBDRL_ADDR)
38 #define CL_LO and_b(~0x02, PBDRL_ADDR)
39 #define CL_HI or_b(0x02, PBDRL_ADDR)
40 #define DO (PBDR & 0x10)
41 #define DI_LO and_b(~0x01, PBDRL_ADDR)
42 #define DI_HI or_b(0x01, PBDRL_ADDR)
44 #define START or_b((0x08 | 0x02), PBDRL_ADDR)
47 #define DELAY do { int _x; for(_x=0;_x<10;_x++);} while (0)
50 int fmradio_read(int addr
)
57 /* First address bit */
67 /* Second address bit */
77 for(i
= 0; i
< 21;i
++)
92 void fmradio_set(int addr
, int data
)
96 /* Include the address in the data */
101 for(i
= 0; i
< 23;i
++)