diff options
Diffstat (limited to 'firmware/target/arm/sandisk')
-rw-r--r-- | firmware/target/arm/sandisk/sansa-view/backlight-target.h | 1 | ||||
-rw-r--r-- | firmware/target/arm/sandisk/sansa-view/backlight-view.c | 31 |
2 files changed, 25 insertions, 7 deletions
diff --git a/firmware/target/arm/sandisk/sansa-view/backlight-target.h b/firmware/target/arm/sandisk/sansa-view/backlight-target.h index a2282ba316..545ee93677 100644 --- a/firmware/target/arm/sandisk/sansa-view/backlight-target.h +++ b/firmware/target/arm/sandisk/sansa-view/backlight-target.h | |||
@@ -24,7 +24,6 @@ | |||
24 | 24 | ||
25 | #include <stdbool.h> | 25 | #include <stdbool.h> |
26 | 26 | ||
27 | #define _backlight_init() true | ||
28 | void _backlight_on(void); | 27 | void _backlight_on(void); |
29 | void _backlight_off(void); | 28 | void _backlight_off(void); |
30 | 29 | ||
diff --git a/firmware/target/arm/sandisk/sansa-view/backlight-view.c b/firmware/target/arm/sandisk/sansa-view/backlight-view.c index d227016c35..c065ec3f2a 100644 --- a/firmware/target/arm/sandisk/sansa-view/backlight-view.c +++ b/firmware/target/arm/sandisk/sansa-view/backlight-view.c | |||
@@ -25,6 +25,25 @@ | |||
25 | #include "lcd.h" | 25 | #include "lcd.h" |
26 | #include "backlight.h" | 26 | #include "backlight.h" |
27 | 27 | ||
28 | bool _backlight_init(void) | ||
29 | { | ||
30 | GPIO_SET_BITWISE(GPIOD_ENABLE, 0x01); | ||
31 | GPIO_SET_BITWISE(GPIOD_OUTPUT_EN, 0x01); | ||
32 | GPIO_SET_BITWISE(GPIOA_ENABLE, 0x01); | ||
33 | GPIO_SET_BITWISE(GPIOA_OUTPUT_EN, 0x01); | ||
34 | GPIO_SET_BITWISE(GPIOA_ENABLE, 0x02); | ||
35 | GPIO_SET_BITWISE(GPIOA_OUTPUT_EN, 0x02); | ||
36 | GPIO_SET_BITWISE(GPIOR_ENABLE, 0x10); | ||
37 | GPIO_SET_BITWISE(GPIOR_ENABLE, 0x20); | ||
38 | GPIO_SET_BITWISE(GPIOR_ENABLE, 0x40); | ||
39 | GPIO_SET_BITWISE(GPIOR_ENABLE, 0x80); | ||
40 | GPIO_SET_BITWISE(GPIOA_OUTPUT_EN, 0x10); | ||
41 | GPIO_SET_BITWISE(GPIOA_OUTPUT_EN, 0x20); | ||
42 | GPIO_SET_BITWISE(GPIOA_OUTPUT_EN, 0x40); | ||
43 | GPIO_SET_BITWISE(GPIOA_OUTPUT_EN, 0x80); | ||
44 | return true; | ||
45 | } | ||
46 | |||
28 | void _backlight_set_brightness(int brightness) | 47 | void _backlight_set_brightness(int brightness) |
29 | { | 48 | { |
30 | (void)brightness; | 49 | (void)brightness; |
@@ -40,10 +59,10 @@ void _backlight_on(void) | |||
40 | GPIO_SET_BITWISE(GPIOD_OUTPUT_VAL, 0x01); | 59 | GPIO_SET_BITWISE(GPIOD_OUTPUT_VAL, 0x01); |
41 | } | 60 | } |
42 | 61 | ||
43 | void _buttonlight_on(void) | 62 | void _buttonlight_off(void) |
44 | { | 63 | { |
45 | /* GPIO_SET_BITWISE(GPIOA_OUTPUT_VAL, 0x02); */ /* vertical buttonlight */ | 64 | GPIO_CLEAR_BITWISE(GPIOA_OUTPUT_VAL, 0x02); /* vertical buttonlight */ |
46 | GPIO_SET_BITWISE(GPIOA_OUTPUT_VAL, 0x01); /* horizontal buttonlight */ | 65 | GPIO_CLEAR_BITWISE(GPIOA_OUTPUT_VAL, 0x01); /* horizontal buttonlight */ |
47 | 66 | ||
48 | GPIO_CLEAR_BITWISE(GPIOR_OUTPUT_VAL, 0x80); /* scrollwheel bottom led */ | 67 | GPIO_CLEAR_BITWISE(GPIOR_OUTPUT_VAL, 0x80); /* scrollwheel bottom led */ |
49 | GPIO_CLEAR_BITWISE(GPIOR_OUTPUT_VAL, 0x40); /* scrollwheel right led */ | 68 | GPIO_CLEAR_BITWISE(GPIOR_OUTPUT_VAL, 0x40); /* scrollwheel right led */ |
@@ -51,10 +70,10 @@ void _buttonlight_on(void) | |||
51 | GPIO_CLEAR_BITWISE(GPIOR_OUTPUT_VAL, 0x10); /* scrollwheel left led */ | 70 | GPIO_CLEAR_BITWISE(GPIOR_OUTPUT_VAL, 0x10); /* scrollwheel left led */ |
52 | } | 71 | } |
53 | 72 | ||
54 | void _buttonlight_off(void) | 73 | void _buttonlight_on(void) |
55 | { | 74 | { |
56 | /* GPIO_CLEAR_BITWISE(GPIOA_OUTPUT_VAL, 0x02); */ /* vertical buttonlight */ | 75 | GPIO_SET_BITWISE(GPIOA_OUTPUT_VAL, 0x02); /* vertical buttonlight */ |
57 | GPIO_CLEAR_BITWISE(GPIOA_OUTPUT_VAL, 0x01); /* horizontal buttonlight */ | 76 | GPIO_SET_BITWISE(GPIOA_OUTPUT_VAL, 0x01); /* horizontal buttonlight */ |
58 | 77 | ||
59 | GPIO_SET_BITWISE(GPIOR_OUTPUT_VAL, 0x80); /* scrollwheel bottom led */ | 78 | GPIO_SET_BITWISE(GPIOR_OUTPUT_VAL, 0x80); /* scrollwheel bottom led */ |
60 | GPIO_SET_BITWISE(GPIOR_OUTPUT_VAL, 0x40); /* scrollwheel right led */ | 79 | GPIO_SET_BITWISE(GPIOR_OUTPUT_VAL, 0x40); /* scrollwheel right led */ |