This powers down the UART logic on request.
Signed-off-by: Keith Packard <keithp@keithp.com>
ao_serial3_set_speed(uint8_t speed);
#endif
ao_serial3_set_speed(uint8_t speed);
#endif
+void
+ao_serial_shutdown(void);
+
void
ao_serial_init(void);
void
ao_serial_init(void);
+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)
{
void
ao_serial_init(void)
{