aboutsummaryrefslogtreecommitdiff
path: root/stmhal/usart.h
diff options
context:
space:
mode:
Diffstat (limited to 'stmhal/usart.h')
-rw-r--r--stmhal/usart.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/stmhal/usart.h b/stmhal/usart.h
index 02464080b..e7db1db3d 100644
--- a/stmhal/usart.h
+++ b/stmhal/usart.h
@@ -3,13 +3,17 @@ typedef enum {
PYB_USART_1 = 1,
PYB_USART_2 = 2,
PYB_USART_3 = 3,
- PYB_USART_6 = 4,
- PYB_USART_MAX = 4,
+ PYB_USART_4 = 4,
+ PYB_USART_5 = 5,
+ PYB_USART_6 = 6,
- //PYB_USART_XA = // USART4 on X1, X2 = PA0, PA1
+#if defined(PYBV10)
+ PYB_USART_XA = 4, // USART4 on X1, X2 = PA0, PA1
PYB_USART_XB = 1, // USART1 on X9, X10 = PB6, PB7
- PYB_USART_YA = 4, // USART6 on Y1, Y2 = PC6, PC7
+ PYB_USART_YA = 6, // USART6 on Y1, Y2 = PC6, PC7
PYB_USART_YB = 3, // USART3 on Y9, Y10 = PB10, PB11
+#endif
+
} pyb_usart_t;
typedef struct _pyb_usart_obj_t pyb_usart_obj_t;
@@ -17,7 +21,7 @@ typedef struct _pyb_usart_obj_t pyb_usart_obj_t;
extern pyb_usart_obj_t *pyb_usart_global_debug;
extern const mp_obj_type_t pyb_usart_type;
-void usart_init(pyb_usart_obj_t *usart_obj, uint32_t baudrate);
+bool 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);