summaryrefslogtreecommitdiff
path: root/uart
diff options
context:
space:
mode:
Diffstat (limited to 'uart')
-rw-r--r--uart/stm32_uart.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/uart/stm32_uart.h b/uart/stm32_uart.h
index 08f93d1..c4ba582 100644
--- a/uart/stm32_uart.h
+++ b/uart/stm32_uart.h
@@ -44,4 +44,10 @@ template <typename T>
class STM32_UART_t : public mmio_ptr<T> {
public:
using mmio_ptr<T>::ptr;
+
+ void write_blocking(uint8_t data) const {
+ // wait for TXE/TXFNF
+ while (!(ptr()->ISR & (1<<7)));
+ ptr()->TDR = data;
+ }
};