Rev 11 | Go to most recent revision | Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 10 | mjames | 1 | #pragma once |
| 2 | #include "libSerial/serial.h" |
||
| 3 | |||
| 4 | extern void sendString(usart_ctl *ctl, char const *string, int length); |
||
| 5 | |||
| 6 | /// @brief storage for a string reader |
||
| 7 | typedef struct |
||
| 8 | { |
||
| 9 | char *buffer; // pointer to workspace |
||
| 10 | int limit; // string limit |
||
| 11 | int counter; // byte counter |
||
| 12 | char complete; // flag complete |
||
| 13 | char readLines; // true if reading lines with CR at end |
||
| 14 | } editBuffer; |
||
| 15 | |||
| 16 | /// |
||
| 17 | typedef enum |
||
| 18 | { |
||
| 19 | EDIT_NULL = 0, ///< No result |
||
| 20 | EDIT_DONE, ///< All characters read |
||
| 21 | EDIT_CR ///< Characters up to CR read |
||
| 22 | } editBufferReturn; |
||
| 23 | |||
| 24 | // working |
||
| 25 | extern void initReadLine(editBuffer *context, char *buffer, int limit, char readLines); |
||
| 26 | |||
| 27 | extern editBufferReturn readLine(usart_ctl *ctl, editBuffer *context); |