diff options
| author | Damien George <damien.p.george@gmail.com> | 2014-03-17 10:22:51 +0000 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2014-03-17 10:22:51 +0000 |
| commit | 6b144f62befe160d00ecd57d2b06d6ae3c8d60f0 (patch) | |
| tree | 66e1494fcc576a5546dccfdf4dd8915f5e95b812 /stmhal/usart.h | |
| parent | 51bbf6a006901fd3877c6abe3d5d67de74401310 (diff) | |
| parent | 9c122029ec1f230296c049da1792348c2d67165b (diff) | |
Merge pull request #347 from dhylands/stmhal-usart
stmhal - Add usart support
Diffstat (limited to 'stmhal/usart.h')
| -rw-r--r-- | stmhal/usart.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/stmhal/usart.h b/stmhal/usart.h index acb6762d7..c7119c833 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 |
