1 | int
|
2 | main(void)
|
3 | {
|
4 | //unsigned long ulSysClock;
|
5 | FPUEnable();
|
6 | FPULazyStackingEnable();
|
7 |
|
8 | ROM_SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
|
9 | SYSCTL_XTAL_16MHZ);
|
10 |
|
11 | //ulSysClock = ROM_SysCtlClockGet();
|
12 |
|
13 | /***************************** Ausgabe per Display initialisieren *********************/
|
14 | CFAL96x64x16Init();
|
15 | ButtonsInit();
|
16 |
|
17 | GrContextInit(&sContext, &g_sCFAL96x64x16);
|
18 |
|
19 | sRect.sXMin = 0;
|
20 | sRect.sYMin = 0;
|
21 | sRect.sXMax = GrContextDpyWidthGet(&sContext) - 1;
|
22 | sRect.sYMax = GrContextDpyHeightGet(&sContext) - 1;
|
23 | GrContextForegroundSet(&sContext, ClrDimGray);
|
24 | GrRectFill(&sContext, &sRect);
|
25 |
|
26 | GrContextForegroundSet(&sContext, ClrWhite);
|
27 | GrContextBackgroundSet(&sContext, ClrDimGray);
|
28 | GrRectDraw(&sContext, &sRect);
|
29 |
|
30 | GrContextFontSet(&sContext, g_pFontFixed6x8);
|
31 | GrStringDrawCentered(&sContext, "This", -1, GrContextDpyWidthGet(&sContext)/2, 14, 1);
|
32 | GrStringDrawCentered(&sContext, "is", -1, GrContextDpyWidthGet(&sContext)/2, 24, 1);
|
33 | GrStringDrawCentered(&sContext, "a", -1, GrContextDpyWidthGet(&sContext)/2, 36, 1);
|
34 | GrStringDrawCentered(&sContext, "test", -1, GrContextDpyWidthGet(&sContext)/2, 46, 1);
|
35 |
|
36 | /***************************** Ausgabe per LED initialisieren *********************/
|
37 | //
|
38 | // Enable the peripherals used by this example.
|
39 | //
|
40 | ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG);
|
41 |
|
42 | //
|
43 | // Set GPIO PG2 as an output. This drives an LED on the board that will
|
44 | //
|
45 | ROM_GPIOPinTypeGPIOOutput(GPIO_PORTG_BASE, GPIO_PIN_2);
|
46 | ROM_GPIOPinWrite(GPIO_PORTG_BASE, GPIO_PIN_2, ~(0x40));
|
47 |
|
48 | /***************************** Timer initialisieren **************************/
|
49 |
|
50 | // Timer 0 aktivieren
|
51 | ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
|
52 | // Interrupt aktivieren
|
53 | ROM_IntMasterEnable();
|
54 | // Konfiguration
|
55 | ROM_TimerConfigure(TIMER0_BASE, TIMER_CFG_PERIODIC);
|
56 | ROM_TimerLoadSet(TIMER0_BASE, TIMER_A, ROM_SysCtlClockGet());
|
57 | // Interrupt des Timers aktivieren
|
58 | ROM_IntEnable(INT_TIMER0A);
|
59 | ROM_TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
|
60 | // Timer 0 aktivieren
|
61 | ROM_TimerEnable(TIMER0_BASE, TIMER_A);
|
62 | ROM_TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
|
63 |
|
64 | /***************************** SystemTick initialisieren *********************/
|
65 |
|
66 | /*ROM_SysTickPeriodSet(ulSysClock / CLOCK_RATE);
|
67 | ROM_SysTickIntEnable();
|
68 | ROM_SysTickEnable();*/
|
69 |
|
70 |
|
71 | /***************************** Endlosschleife initialisieren **************************/
|
72 |
|
73 | while(1)
|
74 | {
|
75 | }
|
76 | }
|