inital version
This commit is contained in:
37
serial.h
Normal file
37
serial.h
Normal file
@ -0,0 +1,37 @@
|
||||
#ifndef SERIAL_H
|
||||
#define SERIAL_H
|
||||
|
||||
#define BAUD 38400
|
||||
#define SERIAL_BUFFER_SIZE 256
|
||||
|
||||
#include <util/setbaud.h>
|
||||
#include <avr/io.h>
|
||||
#include <avr/interrupt.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
const bool serialFlowControl = false;
|
||||
|
||||
class Serial
|
||||
{
|
||||
private:
|
||||
char _terminator = '\n';
|
||||
|
||||
public:
|
||||
Serial();
|
||||
void putChar(const char c);
|
||||
void write(const char* in, const unsigned int length);
|
||||
void write(const char in[]);
|
||||
void write_p(const char in[]); //for flash space strigns
|
||||
void write(const int32_t in);
|
||||
unsigned int read( char* buffer, const unsigned int length );
|
||||
bool dataIsWaiting();
|
||||
char getChar();
|
||||
unsigned int getString(char* buffer, const int bufferLength);
|
||||
void flush();
|
||||
void setTerminator(const char terminator);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user