aboutsummaryrefslogtreecommitdiff
path: root/stm-uart.h
diff options
context:
space:
mode:
authorFredrik Thulin <fredrik@thulin.net>2016-05-13 12:51:31 +0200
committerFredrik Thulin <fredrik@thulin.net>2016-05-13 12:51:31 +0200
commitdb5b2075d6cf51a819c669ca48dc24cd578a625f (patch)
tree6a930cdc84685ea3d63577531bfe47da717d5a0b /stm-uart.h
parent2ddb4f618f34582ea8c9731898651284aec600e7 (diff)
Implement support for the two UARTs on the alpha board.
Diffstat (limited to 'stm-uart.h')
-rw-r--r--stm-uart.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/stm-uart.h b/stm-uart.h
index 1155179..e934068 100644
--- a/stm-uart.h
+++ b/stm-uart.h
@@ -51,11 +51,17 @@ extern UART_HandleTypeDef huart2;
extern HAL_StatusTypeDef uart_send_char(uint8_t ch);
extern HAL_StatusTypeDef uart_recv_char(uint8_t *cp);
+extern HAL_StatusTypeDef uart_send_string(char *s);
+extern HAL_StatusTypeDef uart_send_number(uint32_t num, uint8_t digits, uint8_t radix);
+
extern HAL_StatusTypeDef uart_send_char2(enum stm_uart_port port, uint8_t ch);
extern HAL_StatusTypeDef uart_recv_char2(enum stm_uart_port port, uint8_t *cp, uint32_t timeout);
-extern HAL_StatusTypeDef uart_send_string(char *s);
-extern HAL_StatusTypeDef uart_send_number(uint32_t num, uint8_t digits, uint8_t radix);
+extern HAL_StatusTypeDef uart_send_string2(enum stm_uart_port port, const char *s);
+extern HAL_StatusTypeDef uart_send_number2(enum stm_uart_port port, uint32_t num, uint8_t digits, uint8_t radix);
+
+extern HAL_StatusTypeDef uart_send_bytes(enum stm_uart_port port, uint8_t *buf, size_t len);
+
#define uart_send_binary(num, bits) uart_send_number(num, bits, 2)
#define uart_send_integer(num, digits) uart_send_number(num, digits, 10)
#define uart_send_hex(num, digits) uart_send_number(num, digits, 16)