60 lines
873 B
C++
60 lines
873 B
C++
#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
|