blob: 8e6e0a4e2628cc2cf0091d152a97b2bb9a5b9450 (
plain)
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
|
#ifndef _DISPLAY_H
#define _DISPLAY_H
#include "stdafx.h"
class Display : public IO_Module
{
public:
Display()
{
this->parent = NULL;
this->moduleId = 0;
}
Display(uint32 displayId)
{
this->parent = NULL;
this->moduleId = displayId;
switch(displayId)
{
case IO_DISPLAY_MAIN:
msleep(500);
uart1_init(103);//9600 BAUD at 16MHz Atmel
sleep(2);
break;
default:
break;
}
}
protected:
//Hardware
volatile uint8* hardwarePort;
volatile uint16* pwmSpeed;
uint8 pinForward;
uint8 pinReverse;
public:
void Print(char* newString)
{
switch(moduleId)
{
case IO_DISPLAY_MAIN:
uart1_puts(newString);
break;
default:
break;
}
}
void Print(int32 newInteger)
{
char buffer[12];
ltoa(newInteger, buffer, 10);
Print(buffer);
}
};
#endif
|