Backlight for iAudio X5
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9185 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
cff2a54e7c
commit
13618007b3
4 changed files with 69 additions and 1 deletions
|
@ -212,5 +212,6 @@ target/coldfire/iaudio/x5/adc-x5.c
|
|||
target/coldfire/iaudio/x5/ata-x5.c
|
||||
target/coldfire/iaudio/x5/system-x5.c
|
||||
target/coldfire/iaudio/x5/usb-x5.c
|
||||
target/coldfire/iaudio/x5/backlight-x5.c
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -40,9 +40,13 @@
|
|||
#ifdef HAVE_REMOTE_LCD
|
||||
#include "lcd-remote.h"
|
||||
#endif
|
||||
#ifdef TARGET_TREE
|
||||
#include "backlight-target.h"
|
||||
#endif
|
||||
|
||||
/* Basic low-level code that simply switches backlight on or off. Probably
|
||||
* a nice candidate for inclusion in the target/ dir. */
|
||||
#ifndef TARGET_TREE
|
||||
static inline void __backlight_on(void)
|
||||
{
|
||||
#ifdef SIMULATOR
|
||||
|
@ -121,7 +125,7 @@ static inline void __backlight_off(void)
|
|||
outl(((0x100 | 0) << 3), 0x6000d824);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BACKLIGHT) && !defined(BOOTLOADER)
|
||||
|
||||
|
|
25
firmware/target/coldfire/iaudio/x5/backlight-target.h
Executable file
25
firmware/target/coldfire/iaudio/x5/backlight-target.h
Executable file
|
@ -0,0 +1,25 @@
|
|||
/***************************************************************************
|
||||
* __________ __ ___.
|
||||
* 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
|
||||
|
||||
void __backlight_on(void);
|
||||
void __backlight_off(void);
|
||||
|
||||
#endif
|
38
firmware/target/coldfire/iaudio/x5/backlight-x5.c
Executable file
38
firmware/target/coldfire/iaudio/x5/backlight-x5.c
Executable file
|
@ -0,0 +1,38 @@
|
|||
/***************************************************************************
|
||||
* __________ __ ___.
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
#include "config.h"
|
||||
#include "cpu.h"
|
||||
#include "system.h"
|
||||
#include "backlight.h"
|
||||
#include "pcf50606.h"
|
||||
|
||||
void __backlight_on(void)
|
||||
{
|
||||
int level = set_irq_level(HIGHEST_IRQ_LEVEL);
|
||||
pcf50606_write(0x38, 0x30); /* Backlight ON */
|
||||
set_irq_level(level);
|
||||
}
|
||||
|
||||
void __backlight_off(void)
|
||||
{
|
||||
int level = set_irq_level(HIGHEST_IRQ_LEVEL);
|
||||
pcf50606_write(0x38, 0x70); /* Backlight OFF */
|
||||
set_irq_level(level);
|
||||
}
|
||||
|
Loading…
Reference in a new issue