Nigel
9c5667c454
* The driver can write to any of the pre-defined serial COM ports * The driver can read from any of the pre-defined serial COM ports (Untested)
29 lines
476 B
C++
29 lines
476 B
C++
#pragma once
|
|
// For now these are the standard
|
|
// serial ports we can talk to
|
|
enum SERIALPORT {
|
|
COM1 = 0x3F8,
|
|
COM2 = 0x2F8,
|
|
COM3 = 0x3E8,
|
|
COM4 = 0x2E8
|
|
};
|
|
|
|
struct SerialConfig {
|
|
SERIALPORT port;
|
|
char baud_rate_lo ;
|
|
char baud_rate_hi;
|
|
};
|
|
|
|
|
|
class Serial {
|
|
|
|
public:
|
|
Serial (SerialConfig config );
|
|
|
|
char read();
|
|
void write(void* data, int length);
|
|
|
|
private:
|
|
SERIALPORT port;
|
|
int is_transmit_empty();
|
|
}; |