Sansa View: implement proper backlight and buttonlight switching.
Change-Id: Iab05c1fa5356efa28a4ee774bfd994b22c5661da
This commit is contained in:
parent
62ac0c78c3
commit
7b015f8681
1 changed files with 17 additions and 4 deletions
|
@ -8,6 +8,7 @@
|
|||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2009 by Robert Keevil
|
||||
* Copyright (C) 2014 by Szymon Dziok
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -31,20 +32,32 @@ void _backlight_set_brightness(int brightness)
|
|||
|
||||
void _backlight_off(void)
|
||||
{
|
||||
GPIO_SET_BITWISE(GPIOD_ENABLE, 1<<8);
|
||||
GPIO_CLEAR_BITWISE(GPIOD_OUTPUT_VAL, 0x01);
|
||||
}
|
||||
|
||||
void _backlight_on(void)
|
||||
{
|
||||
GPIO_SET_BITWISE(GPIOD_ENABLE, 1);
|
||||
GPIO_SET_BITWISE(GPIOD_OUTPUT_VAL, 0x01);
|
||||
}
|
||||
|
||||
void _buttonlight_on(void)
|
||||
{
|
||||
GPIO_CLEAR_BITWISE(GPIOA_ENABLE, 0x2);
|
||||
/* GPIO_SET_BITWISE(GPIOA_OUTPUT_VAL, 0x02); */ /* vertical buttonlight */
|
||||
GPIO_SET_BITWISE(GPIOA_OUTPUT_VAL, 0x01); /* horizontal buttonlight */
|
||||
|
||||
GPIO_CLEAR_BITWISE(GPIOR_OUTPUT_VAL, 0x80); /* scrollwheel bottom led */
|
||||
GPIO_CLEAR_BITWISE(GPIOR_OUTPUT_VAL, 0x40); /* scrollwheel right led */
|
||||
GPIO_CLEAR_BITWISE(GPIOR_OUTPUT_VAL, 0x20); /* scrollwheel top led */
|
||||
GPIO_CLEAR_BITWISE(GPIOR_OUTPUT_VAL, 0x10); /* scrollwheel left led */
|
||||
}
|
||||
|
||||
void _buttonlight_off(void)
|
||||
{
|
||||
GPIO_SET_BITWISE(GPIOA_ENABLE, 0x2);
|
||||
/* GPIO_CLEAR_BITWISE(GPIOA_OUTPUT_VAL, 0x02); */ /* vertical buttonlight */
|
||||
GPIO_CLEAR_BITWISE(GPIOA_OUTPUT_VAL, 0x01); /* horizontal buttonlight */
|
||||
|
||||
GPIO_SET_BITWISE(GPIOR_OUTPUT_VAL, 0x80); /* scrollwheel bottom led */
|
||||
GPIO_SET_BITWISE(GPIOR_OUTPUT_VAL, 0x40); /* scrollwheel right led */
|
||||
GPIO_SET_BITWISE(GPIOR_OUTPUT_VAL, 0x20); /* scrollwheel top led */
|
||||
GPIO_SET_BITWISE(GPIOR_OUTPUT_VAL, 0x10); /* scrollwheel left led */
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue