mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-21 19:12:39 -05:00
m:robe 500i port: Add backlight support to the main build.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15404 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
38548c7118
commit
f57ea9acd7
3 changed files with 25 additions and 16 deletions
|
|
@ -24,27 +24,34 @@
|
|||
#include "backlight.h"
|
||||
#include "lcd.h"
|
||||
#include "power.h"
|
||||
#include "spi-target.h"
|
||||
|
||||
void __backlight_on(void)
|
||||
{
|
||||
__backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING);
|
||||
}
|
||||
|
||||
void __backlight_off(void)
|
||||
{
|
||||
__backlight_set_brightness(0);
|
||||
}
|
||||
|
||||
/* Assumes that the backlight has been initialized */
|
||||
void __backlight_set_brightness(int brightness)
|
||||
{
|
||||
(void) brightness;
|
||||
uint8_t bl_command[] = {0xa4, 0x00, brightness, 0xbb};
|
||||
spi_block_transfer(SPI_target_BACKLIGHT, bl_command, 4, 0, 0);
|
||||
}
|
||||
|
||||
void __backlight_dim(bool dim_now)
|
||||
{
|
||||
(void) dim_now;
|
||||
__backlight_set_brightness(dim_now ?
|
||||
DEFAULT_BRIGHTNESS_SETTING :
|
||||
DEFAULT_DIMNESS_SETTING);
|
||||
}
|
||||
|
||||
bool __backlight_init(void)
|
||||
{
|
||||
__backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue