summaryrefslogtreecommitdiff
path: root/src/stmf0/ao_serial_stm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stmf0/ao_serial_stm.c')
-rw-r--r--src/stmf0/ao_serial_stm.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/stmf0/ao_serial_stm.c b/src/stmf0/ao_serial_stm.c
index 5097041a..ef35394a 100644
--- a/src/stmf0/ao_serial_stm.c
+++ b/src/stmf0/ao_serial_stm.c
@@ -376,6 +376,17 @@ ao_serial_set_sw_rts_cts(struct ao_stm_usart *usart,
#endif
void
+ao_serial_shutdown(void)
+{
+#if HAS_SERIAL_1
+ stm_rcc.apb2enr &= ~(1 << STM_RCC_APB2ENR_USART1EN);
+#endif
+#if HAS_SERIAL_2
+ stm_rcc.apb1enr &= ~(1 << STM_RCC_APB1ENR_USART2EN);
+#endif
+}
+
+void
ao_serial_init(void)
{
#if HAS_SERIAL_1