mirror of
https://github.com/jscrane/r65emu.git
synced 2024-12-22 03:30:02 +00:00
30 lines
584 B
C++
30 lines
584 B
C++
#ifndef __SERIAL_FILER_H__
|
|
#define __SERIAL_FILER_H__
|
|
|
|
class HardwareSerial;
|
|
|
|
// see https://playground.arduino.cc/Interfacing/LinuxTTY
|
|
// FIXME: do this in minicom config file
|
|
class serial_filer: public filer {
|
|
public:
|
|
serial_filer(HardwareSerial &serial): _serial(serial) {}
|
|
|
|
const char *advance();
|
|
const char *rewind() { _currsp = 0; return advance(); }
|
|
|
|
const char *checkpoint();
|
|
void restore(const char *);
|
|
|
|
bool start() { return true; }
|
|
void stop() {}
|
|
|
|
uint8_t read();
|
|
bool more();
|
|
void write(uint8_t);
|
|
|
|
private:
|
|
HardwareSerial &_serial;
|
|
unsigned _currsp;
|
|
};
|
|
#endif
|