-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample.c
75 lines (58 loc) · 2.58 KB
/
sample.c
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
/****************************************Copyright (c)****************************************************
**
** http://www.powermcu.com
**
**--------------File Info---------------------------------------------------------------------------------
** File name: main.c
** Descriptions: The GLCD application function
**
**--------------------------------------------------------------------------------------------------------
** Created by: AVRman
** Created date: 2010-11-7
** Version: v1.0
** Descriptions: The original version
**
**--------------------------------------------------------------------------------------------------------
** Modified by: Paolo Bernardi
** Modified date: 03/01/2020
** Version: v2.0
** Descriptions: basic program for LCD and Touch Panel teaching
**
*********************************************************************************************************/
/* Includes ------------------------------------------------------------------*/
#include "LPC17xx.h"
#include "GLCD/GLCD.h"
#include "TouchPanel/TouchPanel.h"
#include "timer/timer.h"
#include "RIT/RIT.h"
#include "button_EXINT/button.h"
#define SIMULATOR 1
#ifdef SIMULATOR
extern uint8_t ScaleFlag; // <- ScaleFlag needs to visible in order for the emulator to find the symbol (can be placed also inside system_LPC17xx.h but since it is RO, it needs more work)
#endif
int main(void)
{
SystemInit(); /* System Initialization (i.e., PLL) */
LCD_Initialization();
BUTTON_init();
TP_Init();
DrawMatrix();
//TouchPanel_Calibrate();
//LCD_Clear(Red);
//GUI_Text(0, 280, (uint8_t *) " touch here : 1 sec to clear ", Blue, White);
//init_timer(0, 0x1312D0 ); /* 50ms * 25MHz = 1.25*10^6 = 0x1312D0 */
//init_timer(0, 0x6108 ); /* 1ms * 25MHz = 25*10^3 = 0x6108 */
//init_timer(0, 0x4E2 ); /* 500us * 25MHz = 1.25*10^3 = 0x4E2 */
init_timer(0, 0x037D7840); /* 50ms * 25MHz = 1.25*10^6 = 0x1312D0 */
init_RIT(0x004C4B40);
enable_RIT();
LPC_SC->PCON |= 0x1; /* power-down mode */
LPC_SC->PCON &= ~(0x2);
while (1)
{
__ASM("wfi");
}
}
/*********************************************************************************************************
END FILE
*********************************************************************************************************/