From ef12b3b5c678e4fa44d60061b0c1bc312e589ba1 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Mon, 12 Nov 2007 18:49:53 +0000 Subject: Hardware controlled backlight brightness for iPod Video and Nano, retaining the software PWM fade in/ fade out. * Backlight handling cleanup, getting rid of one layer of 'lowlevelness'. * Use atomic GPIO bit manipulation for PP502x backlight handling. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15599 a1c6a512-1295-4272-9138-f99709370657 --- .../target/coldfire/iriver/h100/backlight-h100.c | 10 +++---- .../target/coldfire/iriver/h100/backlight-target.h | 35 ++++++++++++++++++++++ 2 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 firmware/target/coldfire/iriver/h100/backlight-target.h (limited to 'firmware/target/coldfire/iriver/h100') diff --git a/firmware/target/coldfire/iriver/h100/backlight-h100.c b/firmware/target/coldfire/iriver/h100/backlight-h100.c index 7cff965ff9..1c3dded5e5 100644 --- a/firmware/target/coldfire/iriver/h100/backlight-h100.c +++ b/firmware/target/coldfire/iriver/h100/backlight-h100.c @@ -25,7 +25,7 @@ #include "lcd.h" /* Returns the current state of the backlight (true=ON, false=OFF). */ -bool __backlight_init(void) +bool _backlight_init(void) { or_l(0x00020000, &GPIO1_ENABLE); or_l(0x00020000, &GPIO1_FUNCTION); @@ -33,22 +33,22 @@ bool __backlight_init(void) return (GPIO1_OUT & 0x00020000) ? false : true; } -void __backlight_on(void) +void _backlight_hw_on(void) { and_l(~0x00020000, &GPIO1_OUT); } -void __backlight_off(void) +void _backlight_hw_off(void) { or_l(0x00020000, &GPIO1_OUT); } -void __remote_backlight_on(void) +void _remote_backlight_on(void) { and_l(~0x00000800, &GPIO_OUT); } -void __remote_backlight_off(void) +void _remote_backlight_off(void) { or_l(0x00000800, &GPIO_OUT); } diff --git a/firmware/target/coldfire/iriver/h100/backlight-target.h b/firmware/target/coldfire/iriver/h100/backlight-target.h new file mode 100644 index 0000000000..6697fb19c3 --- /dev/null +++ b/firmware/target/coldfire/iriver/h100/backlight-target.h @@ -0,0 +1,35 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2006 by Linus Nielsen Feltzing + * + * 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 + +bool _backlight_init(void); /* Returns backlight current state (true=ON). */ +void _backlight_hw_on(void); +void _backlight_hw_off(void); + +#define _backlight_on_isr() _backlight_hw_on() +#define _backlight_off_isr() _backlight_hw_off() +#define _backlight_on_normal() _backlight_hw_on() +#define _backlight_off_normal() _backlight_hw_off() +#define _BACKLIGHT_FADE_BOOST + +void _remote_backlight_on(void); +void _remote_backlight_off(void); + +#endif -- cgit v1.2.3