summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/usart.h
diff options
context:
space:
mode:
Diffstat (limited to 'stmhal/usart.h')
-rw-r--r--stmhal/usart.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/stmhal/usart.h b/stmhal/usart.h
index acb6762d73..c7119c833e 100644
--- a/stmhal/usart.h
+++ b/stmhal/usart.h
@@ -12,15 +12,17 @@ typedef enum {
PYB_USART_YB = 3, // USART3 on Y9, Y10 = PB10, PB11
} pyb_usart_t;
-extern pyb_usart_t pyb_usart_global_debug;
+typedef struct _pyb_usart_obj_t pyb_usart_obj_t;
-void usart_init(pyb_usart_t usart_id, uint32_t baudrate);
-bool usart_rx_any(pyb_usart_t usart_id);
-int usart_rx_char(pyb_usart_t usart_id);
-void usart_tx_str(pyb_usart_t usart_id, const char *str);
-void usart_tx_strn(pyb_usart_t usart_id, const char *str, uint len);
-void usart_tx_strn_cooked(pyb_usart_t usart_id, const char *str, uint len);
+extern pyb_usart_obj_t *pyb_usart_global_debug;
+
+void usart_init(pyb_usart_obj_t *usart_obj, uint32_t baudrate);
+bool usart_rx_any(pyb_usart_obj_t *usart_obj);
+int usart_rx_char(pyb_usart_obj_t *usart_obj);
+void usart_tx_str(pyb_usart_obj_t *usart_obj, const char *str);
+void usart_tx_strn(pyb_usart_obj_t *usart_obj, const char *str, uint len);
+void usart_tx_strn_cooked(pyb_usart_obj_t *usart_obj, const char *str, uint len);
+
+mp_obj_t pyb_Usart(mp_obj_t usart_id, mp_obj_t baudrate);
-#if 0
MP_DECLARE_CONST_FUN_OBJ(pyb_Usart_obj);
-#endif