From 93b063fedfcf7409a67df035170ea5670cad22e1 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Tue, 24 Nov 2020 13:46:41 -0700 Subject: Moved action to top level. Removed old iterations of the project and moved the files from 02-usart to the root directory since that's the sole place where the action is and that subproject has outgrown its initial title. --- tests/test_usart.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/test_usart.c (limited to 'tests/test_usart.c') diff --git a/tests/test_usart.c b/tests/test_usart.c new file mode 100644 index 0000000..b19d687 --- /dev/null +++ b/tests/test_usart.c @@ -0,0 +1,22 @@ +#include "test_harness.h" +#include "arch/stm32l4xxx/peripherals/usart.h" + +#include + +TEST(usart, enable_dma) +{ + __IO usart_t* usart = &USART1; + + usart->c_r3 = 0; + + usart_enable_dma(usart, USART_ENABLE_TX); + ASSERT_EQ(usart->c_r3, 128); + + usart_enable_dma(usart, USART_ENABLE_RX); + ASSERT_EQ(usart->c_r3, 192); + + usart_enable_dma(usart, USART_ENABLE_DISABLED); + ASSERT_EQ(usart->c_r3, 0); + + return 0; +} -- cgit