diff options
Diffstat (limited to 'firmware/target/sh')
-rw-r--r-- | firmware/target/sh/archos/fm_v2/backlight-target.h | 39 | ||||
-rw-r--r-- | firmware/target/sh/archos/ondio/backlight-target.h | 47 | ||||
-rw-r--r-- | firmware/target/sh/archos/player/backlight-target.h | 44 | ||||
-rw-r--r-- | firmware/target/sh/archos/recorder/backlight-target.h | 39 |
4 files changed, 169 insertions, 0 deletions
diff --git a/firmware/target/sh/archos/fm_v2/backlight-target.h b/firmware/target/sh/archos/fm_v2/backlight-target.h new file mode 100644 index 0000000000..834d10bdc6 --- /dev/null +++ b/firmware/target/sh/archos/fm_v2/backlight-target.h @@ -0,0 +1,39 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2007 by Jens Arnold + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef BACKLIGHT_TARGET_H +#define BACKLIGHT_TARGET_H + +#include "config.h" +#include "rtc.h" + +#define __backlight_init() true + +static inline void __backlight_on(void) +{ + /* Enable square wave */ + rtc_write(0x0a, rtc_read(0x0a) | 0x40); +} + +static inline void __backlight_off(void) +{ + /* Disable square wave */ + rtc_write(0x0a, rtc_read(0x0a) & ~0x40); +} + +#endif diff --git a/firmware/target/sh/archos/ondio/backlight-target.h b/firmware/target/sh/archos/ondio/backlight-target.h new file mode 100644 index 0000000000..9be66bd6a0 --- /dev/null +++ b/firmware/target/sh/archos/ondio/backlight-target.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2007 by Jens Arnold + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef BACKLIGHT_TARGET_H +#define BACKLIGHT_TARGET_H + +#include "config.h" +#include "cpu.h" + +#ifdef HAVE_BACKLIGHT +/* A stock Ondio has no backlight, it needs a hardware mod. */ + +static inline bool __backlight_init(void) +{ + PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */ + or_b(0x40, &PADRH); /* drive it high */ + or_b(0x40, &PAIORH); /* ..and output */ + return true; +} + +static inline void __backlight_on(void) +{ + or_b(0x40, &PADRH); /* drive it high */ +} + +static inline void __backlight_off(void) +{ + and_b(~0x40, &PADRH); /* drive it low */ +} +#endif /* HAVE_BACKLIGHT */ + +#endif diff --git a/firmware/target/sh/archos/player/backlight-target.h b/firmware/target/sh/archos/player/backlight-target.h new file mode 100644 index 0000000000..d3bb7f39ed --- /dev/null +++ b/firmware/target/sh/archos/player/backlight-target.h @@ -0,0 +1,44 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2007 by Jens Arnold + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef BACKLIGHT_TARGET_H +#define BACKLIGHT_TARGET_H + +#include "config.h" +#include "cpu.h" + +static inline bool __backlight_init(void) +{ + PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */ + and_b(~0x40, &PADRH); /* drive and set low */ + or_b(0x40, &PAIORH); /* ..and output */ + return true; +} + +static inline void __backlight_on(void) +{ + and_b(~0x40, &PADRH); /* drive and set low */ + or_b(0x40, &PAIORH); +} + +static inline void __backlight_off(void) +{ + and_b(~0x40, &PAIORH); /* let it float (up) */ +} + +#endif diff --git a/firmware/target/sh/archos/recorder/backlight-target.h b/firmware/target/sh/archos/recorder/backlight-target.h new file mode 100644 index 0000000000..834d10bdc6 --- /dev/null +++ b/firmware/target/sh/archos/recorder/backlight-target.h @@ -0,0 +1,39 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2007 by Jens Arnold + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef BACKLIGHT_TARGET_H +#define BACKLIGHT_TARGET_H + +#include "config.h" +#include "rtc.h" + +#define __backlight_init() true + +static inline void __backlight_on(void) +{ + /* Enable square wave */ + rtc_write(0x0a, rtc_read(0x0a) | 0x40); +} + +static inline void __backlight_off(void) +{ + /* Disable square wave */ + rtc_write(0x0a, rtc_read(0x0a) & ~0x40); +} + +#endif |