This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
rc2007-soccer/source/Concept/Framework/modules/wireless.h
2007-02-22 21:22:02 +00:00

58 lines
850 B
C++
Executable file

#ifndef _WIRELESS_H
#define _WIRELESS_H
#include "../../stdafx.h"
class Wireless : public IO_Module
{
public:
Wireless()
{
this->parent = NULL;
this->moduleId = 0;
}
Wireless(uint32 wirelessId)
{
this->parent = NULL;
this->moduleId = wirelessId;
switch(wirelessId)
{
case IO_WIRELESS_MAIN:
uart_init(51); // 19200 Baud at 16MHz Atmel
break;
default:
break;
}
}
protected:
uint8 transmitPower;
public:
void SetTransmitPower(uint8 newTransmitPower)
{
this->transmitPower = newTransmitPower;
char buffer[12];
ltoa(this->transmitPower-1, buffer, 10);
uart_puts(buffer);
}
void Send(char* message)
{
uart_puts(message);
}
void Send(uint8 message)
{
uart_putc(message);
}
int16 Recieve()
{
return uart_getc();
}
};
#endif