diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/uart_driver.md | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/docs/uart_driver.md b/docs/uart_driver.md index 4d1716975..340b64818 100644 --- a/docs/uart_driver.md +++ b/docs/uart_driver.md | |||
| @@ -60,30 +60,56 @@ Initialize the UART driver. This function must be called only once, before any o | |||
| 60 | 60 | ||
| 61 | --- | 61 | --- |
| 62 | 62 | ||
| 63 | ### `void uart_putchar(uint8_t c)` | 63 | ### `void uart_write(uint8_t data)` |
| 64 | 64 | ||
| 65 | Transmit a single byte. | 65 | Transmit a single byte. |
| 66 | 66 | ||
| 67 | #### Arguments | 67 | #### Arguments |
| 68 | 68 | ||
| 69 | - `uint8_t c` | 69 | - `uint8_t data` |
| 70 | The byte (character) to send, from 0 to 255. | 70 | The byte to write. |
| 71 | 71 | ||
| 72 | --- | 72 | --- |
| 73 | 73 | ||
| 74 | ### `uint8_t uart_getchar(void)` | 74 | ### `uint8_t uart_read(void)` |
| 75 | 75 | ||
| 76 | Receive a single byte. | 76 | Receive a single byte. |
| 77 | 77 | ||
| 78 | #### Return Value | 78 | #### Return Value |
| 79 | 79 | ||
| 80 | The byte read from the receive buffer. | 80 | The byte read from the receive buffer. This function will block if the buffer is empty (ie. no data to read). |
| 81 | |||
| 82 | --- | ||
| 83 | |||
| 84 | ### `void uart_transmit(const uint8_t *data, uint16_t length)` | ||
| 85 | |||
| 86 | Transmit multiple bytes. | ||
| 87 | |||
| 88 | #### Arguments | ||
| 89 | |||
| 90 | - `const uint8_t *data` | ||
| 91 | A pointer to the data to write from. | ||
| 92 | - `uint16_t length` | ||
| 93 | The number of bytes to write. Take care not to overrun the length of `data`. | ||
| 94 | |||
| 95 | --- | ||
| 96 | |||
| 97 | ### `void uart_receive(char *data, uint16_t length)` | ||
| 98 | |||
| 99 | Receive multiple bytes. | ||
| 100 | |||
| 101 | #### Arguments | ||
| 102 | |||
| 103 | - `uint8_t *data` | ||
| 104 | A pointer to the buffer to read into. | ||
| 105 | - `uint16_t length` | ||
| 106 | The number of bytes to read. Take care not to overrun the length of `data`. | ||
| 81 | 107 | ||
| 82 | --- | 108 | --- |
| 83 | 109 | ||
| 84 | ### `bool uart_available(void)` | 110 | ### `bool uart_available(void)` |
| 85 | 111 | ||
| 86 | Return whether the receive buffer contains data. Call this function to determine if `uart_getchar()` will return meaningful data. | 112 | Return whether the receive buffer contains data. Call this function to determine if `uart_read()` will return data immediately. |
| 87 | 113 | ||
| 88 | #### Return Value | 114 | #### Return Value |
| 89 | 115 | ||
