snickerdoodle UART to USB bridge functions
More...
snickerdoodle UART to USB bridge functions
◆ sd_uart_usb_bridge_init()
#include <Src/sd_platform.c>
UART to USB Bridge Initialization Initialize UART device structure, UART to USB bridge buffer and set the UART device to use the (previously initialized) UART peripheral and newly initialized buffer.
- Return values
-
State | of UART USB bridge after initialization |
Definition: sd_platform.h:137
◆ sd_uart_usb_transmit()
#include <Src/sd_platform.c>
UART to USB Bridge Transmission Transmit the buffer that has been recieved on the bridged UART over USB communications device.
- Parameters
-
uart_dev | UART device structure that is bridged |
- Return values
-
SD_UART_USB_SUCCESS | on success, error state otherwise |
398 if (rxbuff->
out >= rxbuff->
size)
402 txbuff[idx++] = rxbuff->
buff[rxbuff->
out++];
405 if (rxbuff->
out >= rxbuff->
size)
408 if (--rxbuff->
len <= 0)
412 if ((__HAL_UART_GET_IT(dev->
uart, UART_IT_RXNE) != RESET) &&
413 (__HAL_UART_GET_IT_SOURCE(dev->
uart, UART_IT_RXNE) != RESET))
419 state = sd_cdc_get_state();
421 if (
state == USBD_STATE_CONFIGURED) {
uint32_t size
Definition: sd_buffer.h:107
struct sd_cbuf * rx_buff
Definition: sd_uart.h:142
uint8_t * buff
Definition: sd_buffer.h:103
enum sd_buff_state state
Definition: sd_buffer.h:108
Character buffer structure.
Definition: sd_buffer.h:102
Definition: sd_platform.h:137
UART_HandleTypeDef * uart
Definition: sd_uart.h:140
uint8_t sd_cdc_transmit(uint8_t *buf, uint16_t len)
USB Communications Class Device Transmit Data send over USB IN endpoint are sent over CDC interface t...
Definition: sd_usbd_cdc_if.c:265
uint32_t out
Definition: sd_buffer.h:105
uint32_t len
Definition: sd_buffer.h:106