2006-10-30 08:56:06 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 by Linus Nielsen Feltzing
|
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2006-10-30 08:56:06 +00:00
|
|
|
*
|
|
|
|
* 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 "kernel.h"
|
|
|
|
#include "system.h"
|
|
|
|
#include "backlight.h"
|
2009-08-06 09:28:25 +00:00
|
|
|
#include "backlight-target.h"
|
2006-10-30 08:56:06 +00:00
|
|
|
#include "lcd.h"
|
|
|
|
|
2007-01-12 20:26:23 +00:00
|
|
|
/* Returns the current state of the backlight (true=ON, false=OFF). */
|
2015-01-08 23:22:40 +00:00
|
|
|
bool backlight_hw_init(void)
|
2006-11-10 18:47:41 +00:00
|
|
|
{
|
|
|
|
or_l(0x00020000, &GPIO1_ENABLE);
|
|
|
|
or_l(0x00020000, &GPIO1_FUNCTION);
|
2007-01-12 20:26:23 +00:00
|
|
|
|
|
|
|
return (GPIO1_OUT & 0x00020000) ? false : true;
|
2006-11-10 18:47:41 +00:00
|
|
|
}
|
|
|
|
|
2015-01-12 11:02:24 +00:00
|
|
|
void backlight_hw_on(void)
|
2006-10-30 08:56:06 +00:00
|
|
|
{
|
|
|
|
and_l(~0x00020000, &GPIO1_OUT);
|
|
|
|
}
|
|
|
|
|
2015-01-12 11:02:24 +00:00
|
|
|
void backlight_hw_off(void)
|
2006-10-30 08:56:06 +00:00
|
|
|
{
|
|
|
|
or_l(0x00020000, &GPIO1_OUT);
|
|
|
|
}
|
|
|
|
|
2015-01-08 23:22:40 +00:00
|
|
|
void remote_backlight_hw_on(void)
|
2006-10-30 08:56:06 +00:00
|
|
|
{
|
|
|
|
and_l(~0x00000800, &GPIO_OUT);
|
|
|
|
}
|
|
|
|
|
2015-01-08 23:22:40 +00:00
|
|
|
void remote_backlight_hw_off(void)
|
2006-10-30 08:56:06 +00:00
|
|
|
{
|
|
|
|
or_l(0x00000800, &GPIO_OUT);
|
|
|
|
}
|