Jens Arnold | 47bf6c5 | 2007-04-12 22:12:13 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
| 10 | * Copyright (C) 2007 by Jens Arnold |
| 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 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. |
Jens Arnold | 47bf6c5 | 2007-04-12 22:12:13 +0000 | [diff] [blame] | 16 | * |
| 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 Arnold | ef12b3b | 2007-11-12 18:49:53 +0000 | [diff] [blame] | 30 | static inline bool _backlight_init(void) |
Jens Arnold | 47bf6c5 | 2007-04-12 22:12:13 +0000 | [diff] [blame] | 31 | { |
| 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 Arnold | ef12b3b | 2007-11-12 18:49:53 +0000 | [diff] [blame] | 38 | static inline void _backlight_on(void) |
Jens Arnold | 47bf6c5 | 2007-04-12 22:12:13 +0000 | [diff] [blame] | 39 | { |
| 40 | or_b(0x40, &PADRH); /* drive it high */ |
| 41 | } |
| 42 | |
Jens Arnold | ef12b3b | 2007-11-12 18:49:53 +0000 | [diff] [blame] | 43 | static inline void _backlight_off(void) |
Jens Arnold | 47bf6c5 | 2007-04-12 22:12:13 +0000 | [diff] [blame] | 44 | { |
| 45 | and_b(~0x40, &PADRH); /* drive it low */ |
| 46 | } |
| 47 | #endif /* HAVE_BACKLIGHT */ |
| 48 | |
| 49 | #endif |