MakeBlock Drive Updated Updated library for MakeBlock Ranger

Loading...
Searching...
No Matches
MeSerial.h
Go to the documentation of this file.
1
45#ifndef MeSerial_H
46#define MeSerial_H
47
48#include <stdint.h>
49#include <stdbool.h>
50#include <Arduino.h>
51#include "MeConfig.h"
52
53#ifdef ME_PORT_DEFINED
54#include "MePort.h"
55#endif // ME_PORT_DEFINED
56
62#ifndef ME_PORT_DEFINED
63 class MeSerial
64#else // !ME_PORT_DEFINED
65class MeSerial : public MePort, public SoftwareSerial
66#endif // !ME_PORT_DEFINED
67{
68 public:
75 MeSerial(void);
76
83 MeSerial(uint8_t port);
84
95 MeSerial(uint8_t receivePin, uint8_t transmitPin, bool inverse_logic = false);
96
111 void setHardware(bool mode);
112
129 void begin(long baudrate);
130
145 size_t write(uint8_t byte);
146
161 int read();
162
177 int available();
178
192 int16_t poll(void);
193
206 void end(void);
207
224 bool listen(void);
225
238 bool isListening(void);
239
254 void sendString(char *str);
255
273 void printf(char *fmt,...);
274
275 boolean dataLineAvailable(void);
276 String readDataLine(void);
277 String concatenateWith(String s1,String s2);
278 char letterOf(int i,String s);
279 int stringLength(String s);
280 boolean equalString(String s1,String s2);
281 float getValue(String key);
282
283 protected:
284 bool _hard;
285 bool _polling;
286 bool _scratch;
287 int16_t _bitPeriod;
288 int16_t _byte;
289 long _lastTime;
290 char buffer[64];
291 String lastLine;
292 int bufferIndex;
293
294 private:
295 volatile uint8_t _RxPin;
296 volatile uint8_t _TxPin;
297};
298#endif
299
MeConfig.h
Configuration file of library.
MePort.h
Header for MePort.cpp module.
MePort
Port Mapping for RJ25.
Definition MePort.h:128
MePort::s2
uint8_t s2
Definition MePort.h:444
MePort::s1
uint8_t s1
Definition MePort.h:438
MeSerial
Driver for serial.
Definition MeSerial.h:67
MeSerial::read
int read()
Definition MeSerial.cpp:293
MeSerial::begin
void begin(long baudrate)
Definition MeSerial.cpp:165
MeSerial::printf
void printf(char *fmt,...)
Definition MeSerial.cpp:497
MeSerial::available
int available()
Definition MeSerial.cpp:342
MeSerial::isListening
bool isListening(void)
Definition MeSerial.cpp:416
MeSerial::listen
bool listen(void)
Definition MeSerial.cpp:392
MeSerial::poll
int16_t poll(void)
Definition MeSerial.cpp:441
MeSerial::setHardware
void setHardware(bool mode)
Definition MeSerial.cpp:144
MeSerial::MeSerial
MeSerial(void)
Definition MeSerial.cpp:59
MeSerial::sendString
void sendString(char *str)
Definition MeSerial.cpp:472
MeSerial::end
void end(void)
Definition MeSerial.cpp:207
MeSerial::write
size_t write(uint8_t byte)
Definition MeSerial.cpp:250
SoftwareSerial
Definition SoftwareSerial.h:48