diff options
author | Jens Arnold <amiconn@rockbox.org> | 2007-04-12 22:12:13 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2007-04-12 22:12:13 +0000 |
commit | 47bf6c5a5ad1fd9143ab87328793b285230f74a3 (patch) | |
tree | 5199f2225a3dfc438bb1c4c5e9906f14664dfa43 /firmware/target | |
parent | 734278b7d1fde5e177c6842f49c16b9df8c353fa (diff) | |
download | rockbox-47bf6c5a5ad1fd9143ab87328793b285230f74a3.tar.gz rockbox-47bf6c5a5ad1fd9143ab87328793b285230f74a3.zip |
Moved archos backlight code to target tree. Changed old mutlivalue CONFIG_BACKLIGHT to a simple HAVE_BACKLIGHT.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13136 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
11 files changed, 173 insertions, 3 deletions
diff --git a/firmware/target/arm/ipod/backlight-target.h b/firmware/target/arm/ipod/backlight-target.h index d35dccdc4a..f4e34cb53a 100644 --- a/firmware/target/arm/ipod/backlight-target.h +++ b/firmware/target/arm/ipod/backlight-target.h @@ -19,6 +19,7 @@ #ifndef BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H +#define __backlight_init() true void __backlight_on(void); void __backlight_off(void); diff --git a/firmware/target/arm/iriver/backlight-target.h b/firmware/target/arm/iriver/backlight-target.h index d35dccdc4a..f4e34cb53a 100644 --- a/firmware/target/arm/iriver/backlight-target.h +++ b/firmware/target/arm/iriver/backlight-target.h @@ -19,6 +19,7 @@ #ifndef BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H +#define __backlight_init() true void __backlight_on(void); void __backlight_off(void); diff --git a/firmware/target/arm/sandisk/sansa-e200/backlight-target.h b/firmware/target/arm/sandisk/sansa-e200/backlight-target.h index 5b96ae5e7e..16a02a4d11 100644 --- a/firmware/target/arm/sandisk/sansa-e200/backlight-target.h +++ b/firmware/target/arm/sandisk/sansa-e200/backlight-target.h @@ -19,6 +19,7 @@ #ifndef BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H +#define __backlight_init() true void __backlight_on(void); void __backlight_off(void); void __backlight_set_brightness(int brightness); diff --git a/firmware/target/arm/tatung/tpj1022/backlight-target.h b/firmware/target/arm/tatung/tpj1022/backlight-target.h index b5fe2f7c5d..079a8ce8aa 100644 --- a/firmware/target/arm/tatung/tpj1022/backlight-target.h +++ b/firmware/target/arm/tatung/tpj1022/backlight-target.h @@ -22,6 +22,7 @@ #ifndef BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H +#define __backlight_init() true void __backlight_on(void); void __backlight_off(void); diff --git a/firmware/target/coldfire/iaudio/m5/backlight-target.h b/firmware/target/coldfire/iaudio/m5/backlight-target.h index d9c116803e..824810baa1 100644 --- a/firmware/target/coldfire/iaudio/m5/backlight-target.h +++ b/firmware/target/coldfire/iaudio/m5/backlight-target.h @@ -19,7 +19,6 @@ #ifndef BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H -#define __BACKLIGHT_INIT bool __backlight_init(void); void __backlight_on(void); void __backlight_off(void); diff --git a/firmware/target/coldfire/iaudio/x5/backlight-target.h b/firmware/target/coldfire/iaudio/x5/backlight-target.h index e70bea08e4..6e03aaa76f 100644 --- a/firmware/target/coldfire/iaudio/x5/backlight-target.h +++ b/firmware/target/coldfire/iaudio/x5/backlight-target.h @@ -19,7 +19,6 @@ #ifndef BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H -#define __BACKLIGHT_INIT bool __backlight_init(void); void __backlight_on(void); void __backlight_off(void); diff --git a/firmware/target/coldfire/iriver/backlight-target.h b/firmware/target/coldfire/iriver/backlight-target.h index e653fa1ffb..30a57e4fbc 100644 --- a/firmware/target/coldfire/iriver/backlight-target.h +++ b/firmware/target/coldfire/iriver/backlight-target.h @@ -19,7 +19,6 @@ #ifndef BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H -#define __BACKLIGHT_INIT bool __backlight_init(void); /* Returns backlight current state (true=ON). */ void __backlight_on(void); void __backlight_off(void); 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 |