aboutsummaryrefslogtreecommitdiff
path: root/stm32/src/usart_ut.c
diff options
context:
space:
mode:
authorAuthor Name <[email protected]>2023-07-07 12:20:59 +0930
committerDavid Rowe <[email protected]>2023-07-07 12:29:06 +0930
commitac7c48b4dee99d4c772f133d70d8d1b38262fcd2 (patch)
treea2d0ace57a9c0e2e5b611c4987f6fed1b38b81e7 /stm32/src/usart_ut.c
shallow zip-file copy from codec2 e9d726bf20
Diffstat (limited to 'stm32/src/usart_ut.c')
-rw-r--r--stm32/src/usart_ut.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/stm32/src/usart_ut.c b/stm32/src/usart_ut.c
new file mode 100644
index 0000000..b8b229f
--- /dev/null
+++ b/stm32/src/usart_ut.c
@@ -0,0 +1,30 @@
+/*
+ usart_ut.c
+ David Rowe May 2019
+
+ Unit test for stm32 USART support.
+
+ tio is useful to receive the serial strings:
+
+ $ tio -m INLCRNL /dev/ttyUSB0
+*/
+
+#include <stm32f4xx.h>
+#include "stm32f4_usart.h"
+
+void Delay(uint32_t nCount)
+{
+ while(nCount--)
+ {
+ }
+}
+
+int main(void){
+
+ usart_init();
+
+ while(1){
+ usart_puts("Hello, World\n");
+ Delay(0x3FFFFF);
+ }
+}