NanoPayload

Annotated stage2/minipc_claa070vc01.h

39:953638e23d05
2015-06-09 Paul Boddie Extended MiniPC board support.
paul@33 1
/*
paul@34 2
 * MiniPC panel-specific definitions
paul@33 3
 *
paul@33 4
 * Copyright (C) Xiangfu Liu <xiangfu@sharism.cc>
paul@33 5
 * Copyright (C) 2015 Paul Boddie <paul@boddie.org.uk>
paul@33 6
 *
paul@33 7
 * This program is free software; you can redistribute it and/or
paul@33 8
 * modify it under the terms of the GNU General Public License as
paul@33 9
 * published by the Free Software Foundation; either version 2 of
paul@33 10
 * the License, or (at your option) any later version.
paul@33 11
 *
paul@33 12
 * This program is distributed in the hope that it will be useful,
paul@33 13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
paul@33 14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
paul@33 15
 * GNU General Public License for more details.
paul@33 16
 *
paul@33 17
 * You should have received a copy of the GNU General Public License
paul@33 18
 * along with this program; if not, write to the Free Software
paul@33 19
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
paul@33 20
 * MA 02111-1307 USA
paul@33 21
 */
paul@33 22
paul@33 23
#ifndef __MINIPC_CLAA070VC01_H__
paul@33 24
#define __MINIPC_CLAA070VC01_H__
paul@33 25
paul@39 26
#define __lcd_set_backlight_level(n) \
paul@39 27
do { \
paul@39 28
	__gpio_as_pwm(); \
paul@39 29
	REG_PWM_DUT(0) = n; \
paul@39 30
	REG_PWM_PER(0) = 7; \
paul@39 31
	REG_PWM_CTR(0) = 0xc1; \
paul@39 32
} while (0)
paul@39 33
paul@39 34
#define __lcd_close_backlight() \
paul@39 35
do { \
paul@39 36
__gpio_as_output(GPIO_PWM0);\
paul@39 37
__gpio_clear_pin(GPIO_PWM0);\
paul@39 38
} while (0)
paul@39 39
paul@39 40
#define __lcd_display_pin_init() \
paul@39 41
do { \
paul@39 42
	__gpio_as_output(GPIO_DISP_OFF_N); \
paul@39 43
	__lcd_set_backlight_level(8); \
paul@39 44
} while (0)
paul@39 45
paul@39 46
#define __lcd_display_on() \
paul@39 47
do { \
paul@39 48
	__gpio_set_pin(GPIO_DISP_OFF_N); \
paul@39 49
	__lcd_set_backlight_level(8); \
paul@39 50
} while (0)
paul@39 51
paul@39 52
#define __lcd_display_off() \
paul@39 53
do { \
paul@39 54
	__lcd_close_backlight(); \
paul@39 55
	__gpio_clear_pin(GPIO_DISP_OFF_N); \
paul@39 56
} while (0)
paul@39 57
paul@33 58
#endif /* __MINIPC_CLAA070VC01_H__ */