@@ -71,10 +71,12 @@ void uart_reset(void) {
7171 uart_clock_disable (ALL_UARTS );
7272}
7373
74- void common_hal_busio_uart_construct (busio_uart_obj_t * self ,
75- const mcu_pin_obj_t * tx , const mcu_pin_obj_t * rx , uint32_t baudrate ,
76- uint8_t bits , uart_parity_t parity , uint8_t stop , mp_float_t timeout ,
77- uint16_t receiver_buffer_size ) {
74+ void common_hal_busio_uart_construct (busio_uart_obj_t * self ,
75+ const mcu_pin_obj_t * tx , const mcu_pin_obj_t * rx ,
76+ const mcu_pin_obj_t * rts , const mcu_pin_obj_t * cts ,
77+ const mcu_pin_obj_t * rs485_dir , bool rs485_invert ,
78+ uint32_t baudrate , uint8_t bits , uart_parity_t parity , uint8_t stop ,
79+ mp_float_t timeout , uint16_t receiver_buffer_size ) {
7880
7981 //match pins to UART objects
8082 USART_TypeDef * USARTx ;
@@ -84,6 +86,10 @@ void common_hal_busio_uart_construct(busio_uart_obj_t* self,
8486 bool uart_taken = false;
8587 uint8_t uart_index = 0 ; //origin 0 corrected
8688
89+ if ((rts != mp_const_none ) || (cts != mp_const_none ) || (rs485_dir != mp_const_none ) || (rs485_invert == true)) {
90+ mp_raise_ValueError (translate ("RTS/CTS/RS485 Not yet supported on this device" ));
91+ }
92+
8793 //Can have both pins, or either
8894 if ((tx != mp_const_none ) && (rx != mp_const_none )) {
8995 //normal find loop if both pins exist
0 commit comments