summaryrefslogtreecommitdiffstats
path: root/firmware/target/sh
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2007-04-12 22:12:13 +0000
committerJens Arnold <amiconn@rockbox.org>2007-04-12 22:12:13 +0000
commit47bf6c5a5ad1fd9143ab87328793b285230f74a3 (patch)
tree5199f2225a3dfc438bb1c4c5e9906f14664dfa43 /firmware/target/sh
parent734278b7d1fde5e177c6842f49c16b9df8c353fa (diff)
downloadrockbox-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/sh')
-rw-r--r--firmware/target/sh/archos/fm_v2/backlight-target.h39
-rw-r--r--firmware/target/sh/archos/ondio/backlight-target.h47
-rw-r--r--firmware/target/sh/archos/player/backlight-target.h44
-rw-r--r--firmware/target/sh/archos/recorder/backlight-target.h39
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