Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
serialBuffer.h@1:985b6f1c7347, 2016-10-04 (annotated)
- Committer:
- UHSLMarcus
- Date:
- Tue Oct 04 09:18:23 2016 +0000
- Revision:
- 1:985b6f1c7347
- Parent:
- 0:dd6d74f39384
- Child:
- 2:6858388a1ff1
working so far
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| UHSLMarcus | 0:dd6d74f39384 | 1 | #ifndef SERIAL_BUFFER_H |
| UHSLMarcus | 0:dd6d74f39384 | 2 | #define SERIAL_BUFFER_H |
| UHSLMarcus | 0:dd6d74f39384 | 3 | |
| UHSLMarcus | 0:dd6d74f39384 | 4 | #include "mbed.h" |
| UHSLMarcus | 1:985b6f1c7347 | 5 | #include "circularBuffer.h" |
| UHSLMarcus | 1:985b6f1c7347 | 6 | |
| UHSLMarcus | 1:985b6f1c7347 | 7 | using namespace utils; |
| UHSLMarcus | 0:dd6d74f39384 | 8 | |
| UHSLMarcus | 1:985b6f1c7347 | 9 | namespace utils { |
| UHSLMarcus | 1:985b6f1c7347 | 10 | |
| UHSLMarcus | 1:985b6f1c7347 | 11 | class SerialBuffer : public RawSerial |
| UHSLMarcus | 1:985b6f1c7347 | 12 | { |
| UHSLMarcus | 1:985b6f1c7347 | 13 | |
| UHSLMarcus | 1:985b6f1c7347 | 14 | public: |
| UHSLMarcus | 1:985b6f1c7347 | 15 | SerialBuffer(PinName tx, PinName rx); |
| UHSLMarcus | 1:985b6f1c7347 | 16 | virtual ~SerialBuffer(void); |
| UHSLMarcus | 1:985b6f1c7347 | 17 | virtual int readable(void); |
| UHSLMarcus | 1:985b6f1c7347 | 18 | virtual char getc(void); |
| UHSLMarcus | 1:985b6f1c7347 | 19 | |
| UHSLMarcus | 1:985b6f1c7347 | 20 | private: |
| UHSLMarcus | 1:985b6f1c7347 | 21 | CircularBuffer<char> rx_buffer; |
| UHSLMarcus | 1:985b6f1c7347 | 22 | void rx_interrupt(void); |
| UHSLMarcus | 1:985b6f1c7347 | 23 | |
| UHSLMarcus | 0:dd6d74f39384 | 24 | |
| UHSLMarcus | 1:985b6f1c7347 | 25 | }; |
| UHSLMarcus | 1:985b6f1c7347 | 26 | |
| UHSLMarcus | 1:985b6f1c7347 | 27 | } |
| UHSLMarcus | 0:dd6d74f39384 | 28 | |
| UHSLMarcus | 0:dd6d74f39384 | 29 | |
| UHSLMarcus | 0:dd6d74f39384 | 30 | #endif /* SERIAL_BUFFER_H */ |