forked from waveshareteam/ugv_base_general
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathSCSerial.h
More file actions
38 lines (32 loc) · 788 Bytes
/
SCSerial.h
File metadata and controls
38 lines (32 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* SCSerial.h
* FIT serial servo hardware interface layer program
*/
#ifndef _SCSERIAL_H
#define _SCSERIAL_H
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include "SCS.h"
class SCSerial : public SCS
{
public:
SCSerial();
SCSerial(u8 End);
SCSerial(u8 End, u8 Level);
protected:
virtual int writeSCS(unsigned char *nDat, int nLen); // Output nLen bytes
virtual int readSCS(unsigned char *nDat, int nLen); // Input nLen bytes
virtual int writeSCS(unsigned char bDat); // Output 1 byte
virtual void rFlushSCS();
virtual void wFlushSCS();
public:
unsigned long int IOTimeOut; // Input and output timeout
HardwareSerial *pSerial; // Serial port pointer
int Err;
public:
virtual int getErr(){ return Err; }
};
#endif