-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefs.h
78 lines (54 loc) · 1.65 KB
/
defs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#define RGB16(r,g,b) (((uint16_t)(r & 0xF8) << 8) | ((uint16_t)(g & 0xFC) << 3) | (uint16_t)(b >> 3))
#define RGBHTML(color) ((uint16_t)((color & 0xF80000) >> 8) | (uint16_t)((color & 0xFC00) >> 5) | (uint16_t)((color & 0xF8) >> 3))
#define ADC_MEAS_DELAY 10 // this alternates between 'battery' and 'backlight'
#define OUT_CS P12
#define OUT_OSD P16
#define OSD_WIDTH 160
#define OSD_HEIGHT 52
#define OSD_STRIDE (OSD_WIDTH / 2)
#define OSD_CENTER (OSD_WIDTH / 2)
#define OSD_ICON_GAP 70
#define OSD_DIGIT_GAP 18
#define OSD_MAIN_ICON_Y 2
#define OSD_MAIN_TEXT_Y (OSD_HEIGHT - 13)
#define OSD_SIDE_ICON_Y (OSD_HEIGHT - 36)
#define OSD_SIDE_TEXT_Y 1
//
extern __xdata uint16_t tick_ms;
extern __xdata uint8_t tick_tmp;
extern __xdata void (*ticker)();
//
// input
#define IN_LEFT P36
#define IN_RIGHT P33
#define IN_ENTER P32
#define IN_TOUCH_L P17
#define IN_TOUCH_R P37
//
// customization
// hide cartridge logo
//#define CFG_HIDE_CART_LOGO
// show custom logo
#define CFG_SHOW_CUSTOM_LOGO
// custom logo start location
// when > OSD_HEIGHT it also acts as delay
#define CFG_LOGO_START_Y 90
// custom logo scroll speed
// only use (2^x)-1
#define CFG_LOGO_TICK_MASK 0x1F
// custom logo active color (from OSD palette)
#define CFG_LOGO_COLOR 4
// OSD colors
#define OSD_COLOR_BACKGROUND 4
#define OSD_COLOR_TOP 1
#define OSD_COLOR_BOT 1
// low battery raw ADC value
#define ADC_LOW_BAT 0x1A00 // 0x1A00 = ~2.3V
// use ADC for backlight level
//#define ADC_BACKLIGHT 12
#define ADC_BL_RAW_LO 0x6500
#define ADC_BL_RAW_HI 0xDB00
// OSD address offset
// use if your image appears shifted
// NOTE: offset is in bytes and not pixels
//#define SPI_OSDADDR_OFFSET -2