1.1 --- a/stage2/minipc_claa070vc01.h Tue Jun 09 23:07:03 2015 +0200
1.2 +++ b/stage2/minipc_claa070vc01.h Tue Jun 09 23:07:42 2015 +0200
1.3 @@ -23,4 +23,36 @@
1.4 #ifndef __MINIPC_CLAA070VC01_H__
1.5 #define __MINIPC_CLAA070VC01_H__
1.6
1.7 +#define __lcd_set_backlight_level(n) \
1.8 +do { \
1.9 + __gpio_as_pwm(); \
1.10 + REG_PWM_DUT(0) = n; \
1.11 + REG_PWM_PER(0) = 7; \
1.12 + REG_PWM_CTR(0) = 0xc1; \
1.13 +} while (0)
1.14 +
1.15 +#define __lcd_close_backlight() \
1.16 +do { \
1.17 +__gpio_as_output(GPIO_PWM0);\
1.18 +__gpio_clear_pin(GPIO_PWM0);\
1.19 +} while (0)
1.20 +
1.21 +#define __lcd_display_pin_init() \
1.22 +do { \
1.23 + __gpio_as_output(GPIO_DISP_OFF_N); \
1.24 + __lcd_set_backlight_level(8); \
1.25 +} while (0)
1.26 +
1.27 +#define __lcd_display_on() \
1.28 +do { \
1.29 + __gpio_set_pin(GPIO_DISP_OFF_N); \
1.30 + __lcd_set_backlight_level(8); \
1.31 +} while (0)
1.32 +
1.33 +#define __lcd_display_off() \
1.34 +do { \
1.35 + __lcd_close_backlight(); \
1.36 + __gpio_clear_pin(GPIO_DISP_OFF_N); \
1.37 +} while (0)
1.38 +
1.39 #endif /* __MINIPC_CLAA070VC01_H__ */