unleashed-firmware/applications/main/gpio/usb_uart_bridge.h
Skorpionm 17b122990f
USART Bridge: added support for software control of DE/RE pins (#3280)
* USART Bridge: added support for software control of DE/RE pins
* USART Bridge: fix syntax
* UsbUsartBridge: add TODO ticket
* UsbUsartBridge: add second TODO ticket
* GpioUartBridge: human readable configuration
* GpioUartBridge: rename `Soft DE/RE` to `DE/RE Pin`
* GpioUartBridge: push pull for DE/RE pin

Co-authored-by: あく <alleteam@gmail.com>
2023-12-19 14:13:37 +00:00

31 lines
695 B
C

#pragma once
#include <stdint.h>
#include <stdbool.h>
typedef struct UsbUartBridge UsbUartBridge;
typedef struct {
uint8_t vcp_ch;
uint8_t uart_ch;
uint8_t flow_pins;
uint8_t baudrate_mode;
uint32_t baudrate;
uint8_t software_de_re;
} UsbUartConfig;
typedef struct {
uint32_t rx_cnt;
uint32_t tx_cnt;
uint32_t baudrate_cur;
} UsbUartState;
UsbUartBridge* usb_uart_enable(UsbUartConfig* cfg);
void usb_uart_disable(UsbUartBridge* usb_uart);
void usb_uart_set_config(UsbUartBridge* usb_uart, UsbUartConfig* cfg);
void usb_uart_get_config(UsbUartBridge* usb_uart, UsbUartConfig* cfg);
void usb_uart_get_state(UsbUartBridge* usb_uart, UsbUartState* st);