diff options
| author | microDev <70126934+microDev1@users.noreply.github.com> | 2021-02-19 18:36:00 +0530 |
|---|---|---|
| committer | microDev <70126934+microDev1@users.noreply.github.com> | 2021-02-19 18:36:00 +0530 |
| commit | b12ccefbe6afd2c8b1743ce7759880ef3b01e9ed (patch) | |
| tree | 0cad24ebb8551919bddb34822dee87684a2a7393 /ports/raspberrypi/common-hal/busio/UART.h | |
| parent | 1cd4e4552e1a72c61a787c2fa0b8d51a7cf1301f (diff) | |
uart implementation for rp2040
Diffstat (limited to 'ports/raspberrypi/common-hal/busio/UART.h')
| -rw-r--r-- | ports/raspberrypi/common-hal/busio/UART.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/ports/raspberrypi/common-hal/busio/UART.h b/ports/raspberrypi/common-hal/busio/UART.h index 43ed9bee0..03613daeb 100644 --- a/ports/raspberrypi/common-hal/busio/UART.h +++ b/ports/raspberrypi/common-hal/busio/UART.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2021 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2021 microDev * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -27,21 +27,23 @@ #ifndef MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_BUSIO_UART_H #define MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_BUSIO_UART_H +#include "py/obj.h" #include "common-hal/microcontroller/Pin.h" -#include "py/obj.h" +#include "src/rp2_common/hardware_uart/include/hardware/uart.h" typedef struct { mp_obj_base_t base; - // struct usart_async_descriptor usart_desc; - uint8_t rx_pin; uint8_t tx_pin; - uint8_t character_bits; - bool rx_error; + uint8_t rx_pin; + uint8_t cts_pin; + uint8_t rts_pin; uint32_t baudrate; uint32_t timeout_ms; - uint32_t buffer_length; - uint8_t* buffer; + uart_inst_t * uart; } busio_uart_obj_t; +extern void uart_reset(void); +extern void never_reset_uart(uint8_t num); + #endif // MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_BUSIO_UART_H |
