afLib 1.3 which is supporting both SPI and UART
Dependencies: vt100 mbed afLib_1_3
af_utils/edgeSerial.h@0:87662653a3c6, 2018-04-23 (annotated)
- Committer:
- Rhyme
- Date:
- Mon Apr 23 06:15:26 2018 +0000
- Revision:
- 0:87662653a3c6
First UART working version
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Rhyme | 0:87662653a3c6 | 1 | #ifndef _EDGESERIAL_H_ |
| Rhyme | 0:87662653a3c6 | 2 | #define _EDGESERIAL_H_ |
| Rhyme | 0:87662653a3c6 | 3 | |
| Rhyme | 0:87662653a3c6 | 4 | #include "mbed.h" |
| Rhyme | 0:87662653a3c6 | 5 | |
| Rhyme | 0:87662653a3c6 | 6 | class edgeSerial : public Serial { |
| Rhyme | 0:87662653a3c6 | 7 | public: |
| Rhyme | 0:87662653a3c6 | 8 | edgeSerial(PinName txPin, PinName rxPin, int baud) ; |
| Rhyme | 0:87662653a3c6 | 9 | |
| Rhyme | 0:87662653a3c6 | 10 | bool edge_available(void) { return Serial::readable() ; } |
| Rhyme | 0:87662653a3c6 | 11 | char edge_peek(void) ; |
| Rhyme | 0:87662653a3c6 | 12 | char edge_read(void) ; |
| Rhyme | 0:87662653a3c6 | 13 | void edge_read(uint8_t *buffer, int len) ; |
| Rhyme | 0:87662653a3c6 | 14 | void edge_write(uint8_t *buffer, int len) ; |
| Rhyme | 0:87662653a3c6 | 15 | private: |
| Rhyme | 0:87662653a3c6 | 16 | bool _is_peeked ; |
| Rhyme | 0:87662653a3c6 | 17 | uint8_t _peeked_byte ; |
| Rhyme | 0:87662653a3c6 | 18 | } ; |
| Rhyme | 0:87662653a3c6 | 19 | |
| Rhyme | 0:87662653a3c6 | 20 | #endif |