afLib 1.3 which is supporting both SPI and UART
Dependencies: vt100 mbed afLib_1_3
Diff: af_utils/mbedUART.h
- Revision:
- 0:87662653a3c6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/af_utils/mbedUART.h Mon Apr 23 06:15:26 2018 +0000
@@ -0,0 +1,35 @@
+#ifndef _MBEDUART_H_
+#define _MBEDUART_H_
+#include "mbed.h"
+#include "afTransport.h"
+#include "edgeSerial.h"
+
+#define INT_CHAR 0x32
+
+class mbedUART : public afTransport {
+public:
+ mbedUART(PinName rxPin, PinName txPin, Serial *theLog) ;
+ ~mbedUART(void) ;
+
+ virtual void checkForInterrupt(volatile int *interrupts_pending, bool idle);
+ virtual int exchangeStatus(StatusCommand *tx, StatusCommand *rx);
+ virtual int writeStatus(StatusCommand *c);
+ virtual void sendBytes(char *bytes, int len);
+ virtual void recvBytes(char *bytes, int len);
+ virtual void sendBytesOffset(char *bytes, uint16_t *bytesToSend, uint16_t *offset);
+ virtual void recvBytesOffset(char **bytes, uint16_t *bytesLen, uint16_t *bytesToRecv, uint16_t *offset);
+// virtual void recvBytesOffset(char *bytes, uint16_t *bytesLen, uint16_t *bytesToRecv, uint16_t *offset);
+private:
+ edgeSerial *_uart ;
+// Serial *_uart ;
+// Stream *_uart ;
+ Serial *_theLog ;
+ uint8_t *_buf ;
+
+ int available(void);
+ char peek(void);
+ void read(uint8_t *buffer, int len);
+ char read(void);
+ void write(uint8_t *buffer, int len);
+};
+#endif /* _MBEDUART_H_ */
\ No newline at end of file