13 #ifndef __IS_SERIALPORT_H 14 #define __IS_SERIALPORT_H 26 #define MAX_SERIAL_PORT_NAME_LENGTH 63 29 #define BAUDRATE_300 300 // 3333 us 30 #define BAUDRATE_600 600 // 1667 us 31 #define BAUDRATE_1200 1200 // 833 us 32 #define BAUDRATE_2400 2400 // 417 us 33 #define BAUDRATE_4800 4800 // 208 us 34 #define BAUDRATE_9600 9600 // 104 us 35 #define BAUDRATE_19200 19200 // 52 us 36 #define BAUDRATE_38400 38400 // 26 us 37 #define BAUDRATE_57600 57600 // 17 us 38 #define BAUDRATE_115200 115200 // 8680 ns 39 #define BAUDRATE_230400 230400 // 4340 ns 40 #define BAUDRATE_460800 460800 // 2170 ns 41 #define BAUDRATE_921600 921600 // 1085 ns 42 #define BAUDRATE_1000000 1000000 // 1000 ns 43 #define BAUDRATE_1220000 1220000 // 820 ns 44 #define BAUDRATE_1440000 1440000 // 794 ns 45 #define BAUDRATE_1500000 1500000 // 667 ns (FTDI 1520, AFR 1500) 46 #define BAUDRATE_2000000 2000000 // 500 ns (FTDI 2080, AVR/ARM 2016) 47 #define BAUDRATE_3000000 3000000 // 333 ns (FTDI 3150, AVR/ARM 3030) 209 #endif // __IS_SERIALPORT_H int serialPortReadLineTimeout(serial_port_t *serialPort, unsigned char *buffer, int bufferLength, int timeoutMilliseconds)
int serialPortClose(serial_port_t *serialPort)
int serialPortReadTimeout(serial_port_t *serialPort, unsigned char *buffer, int readCount, int timeoutMilliseconds)
int serialPortGetByteCountAvailableToRead(serial_port_t *serialPort)
pfnSerialPortIsOpen pfnIsOpen
char port[MAX_SERIAL_PORT_NAME_LENGTH+1]
int serialPortReadLine(serial_port_t *serialPort, unsigned char *buffer, int bufferLength)
int(* pfnSerialPortRead)(serial_port_t *serialPort, unsigned char *buf, int len, int timeoutMilliseconds)
pfnSerialPortAsyncRead pfnAsyncRead
int(* pfnSerialPortWrite)(serial_port_t *serialPort, const unsigned char *buf, int len)
#define MAX_SERIAL_PORT_NAME_LENGTH
int serialPortFlush(serial_port_t *serialPort)
pfnSerialPortGetByteCountAvailableToWrite pfnGetByteCountAvailableToWrite
int serialPortReadAscii(serial_port_t *serialPort, unsigned char *buffer, int bufferLength, unsigned char **asciiData)
int serialPortGetByteCountAvailableToWrite(serial_port_t *serialPort)
int SERIAL_PORT_DEFAULT_TIMEOUT
int(* pfnSerialPortOpen)(serial_port_t *serialPort, const char *port, int baudRate, int blocking)
void serialPortSetPort(serial_port_t *serialPort, const char *port)
pfnSerialPortOpen pfnOpen
void(* pfnSerialPortAsyncReadCompletion)(serial_port_t *serialPort, unsigned char *buf, int len, int errorCode)
int serialPortOpenRetry(serial_port_t *serialPort, const char *port, int baudRate, int blocking)
pfnSerialPortRead pfnRead
int(* pfnSerialPortClose)(serial_port_t *serialPort)
int serialPortWaitFor(serial_port_t *serialPort, const unsigned char *waitFor, int waitForLength)
int serialPortReadTimeoutAsync(serial_port_t *serialPort, unsigned char *buffer, int readCount, pfnSerialPortAsyncReadCompletion callback)
pfnSerialPortFlush pfnFlush
int serialPortWriteAscii(serial_port_t *serialPort, const char *buffer, int bufferLength)
int serialPortReadAsciiTimeout(serial_port_t *serialPort, unsigned char *buffer, int bufferLength, int timeoutMilliseconds, unsigned char **asciiData)
int serialPortRead(serial_port_t *serialPort, unsigned char *buffer, int readCount)
int serialPortReadChar(serial_port_t *serialPort, unsigned char *c)
int(* pfnSerialPortSleep)(int sleepMilliseconds)
int serialPortIsOpen(serial_port_t *serialPort)
pfnSerialPortSleep pfnSleep
int serialPortWaitForTimeout(serial_port_t *serialPort, const unsigned char *waitFor, int waitForLength, int timeoutMilliseconds)
int serialPortWrite(serial_port_t *serialPort, const unsigned char *buffer, int writeCount)
int(* pfnSerialPortFlush)(serial_port_t *serialPort)
int(* pfnSerialPortIsOpen)(serial_port_t *serialPort)
pfnSerialPortClose pfnClose
int(* pfnSerialPortAsyncRead)(serial_port_t *serialPort, unsigned char *buf, int len, pfnSerialPortAsyncReadCompletion completion)
pfnSerialPortGetByteCountAvailableToRead pfnGetByteCountAvailableToRead
int serialPortWriteLine(serial_port_t *serialPort, const unsigned char *buffer, int writeCount)
int(* pfnSerialPortGetByteCountAvailableToRead)(serial_port_t *serialPort)
pfnSerialPortWrite pfnWrite
int serialPortWriteAndWaitForTimeout(serial_port_t *serialPort, const unsigned char *buffer, int writeCount, const unsigned char *waitFor, int waitForLength, const int timeoutMilliseconds)
int serialPortReadCharTimeout(serial_port_t *serialPort, unsigned char *c, int timeoutMilliseconds)
int(* pfnSerialPortGetByteCountAvailableToWrite)(serial_port_t *serialPort)
int serialPortSleep(serial_port_t *serialPort, int sleepMilliseconds)
int serialPortOpen(serial_port_t *serialPort, const char *port, int baudRate, int blocking)
int serialPortWriteAndWaitFor(serial_port_t *serialPort, const unsigned char *buffer, int writeCount, const unsigned char *waitFor, int waitForLength)