blob: 9dd3eb1cf95568cc7f7d8bb5266c6df7d8362231 [file] [log] [blame]
Jens Arnold47bf6c52007-04-12 22:12:13 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Jens Arnold
11 *
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000012 * 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.
Jens Arnold47bf6c52007-04-12 22:12:13 +000016 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef BACKLIGHT_TARGET_H
22#define BACKLIGHT_TARGET_H
23
24#include "config.h"
25#include "cpu.h"
26
27#ifdef HAVE_BACKLIGHT
28/* A stock Ondio has no backlight, it needs a hardware mod. */
29
Jens Arnoldef12b3b2007-11-12 18:49:53 +000030static inline bool _backlight_init(void)
Jens Arnold47bf6c52007-04-12 22:12:13 +000031{
32 PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */
33 or_b(0x40, &PADRH); /* drive it high */
34 or_b(0x40, &PAIORH); /* ..and output */
35 return true;
36}
37
Jens Arnoldef12b3b2007-11-12 18:49:53 +000038static inline void _backlight_on(void)
Jens Arnold47bf6c52007-04-12 22:12:13 +000039{
40 or_b(0x40, &PADRH); /* drive it high */
41}
42
Jens Arnoldef12b3b2007-11-12 18:49:53 +000043static inline void _backlight_off(void)
Jens Arnold47bf6c52007-04-12 22:12:13 +000044{
45 and_b(~0x40, &PADRH); /* drive it low */
46}
47#endif /* HAVE_BACKLIGHT */
48
49#endif