diff options
author | Fredrik Thulin <fredrik@thulin.net> | 2016-05-15 10:42:23 +0200 |
---|---|---|
committer | Fredrik Thulin <fredrik@thulin.net> | 2016-05-15 10:43:03 +0200 |
commit | 9b73356f2831800d2328827998e1e5b2a1994b68 (patch) | |
tree | 194357028a78b8ef92e4914074c2b3c51df5b17b /stm-uart.c | |
parent | cc07ee6bfcf4721254145ef388196be82532fd4a (diff) |
add simple filetransfer poc
Diffstat (limited to 'stm-uart.c')
-rw-r--r-- | stm-uart.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -115,6 +115,17 @@ HAL_StatusTypeDef uart_send_bytes(enum stm_uart_port port, uint8_t *buf, size_t return HAL_ERROR; } +/* receive raw bytes */ +HAL_StatusTypeDef uart_receive_bytes(enum stm_uart_port port, uint8_t *buf, size_t len, uint32_t timeout) +{ + UART_HandleTypeDef *uart = _which_uart(port); + + if (uart) + return HAL_UART_Receive(uart, (uint8_t *) buf, (uint32_t) len, timeout); + + return HAL_ERROR; +} + /* Generalized routine to send binary, decimal, and hex integers. * This code is adapted from Chris Giese's printf.c */ |