no-OS
Macros | Functions | Variables
stm32_usb_uart.c File Reference

UART over USB driver for stm32 as a no_os_uart implementation. More...

#include <errno.h>
#include <stdlib.h>
#include "no_os_util.h"
#include "stm32_usb_uart.h"
#include "no_os_lf256fifo.h"
#include "no_os_alloc.h"
#include "usbd_cdc.h"
Include dependency graph for stm32_usb_uart.c:

Macros

#define STM32_USB_CDC_ACM_RXBUF_LEN   512
 
#define STM32_USB_CDC_ACM_TXBUF_LEN   512
 

Functions

void stm32_on_usb_cdc_acm_rx (uint8_t *buf, uint32_t len)
 

Variables

USBD_HandleTypeDef * gusbdevice
 
USBD_CDC_ItfTypeDef USBD_Interface_fops
 
const struct no_os_uart_platform_ops stm32_usb_uart_ops
 STM32 platform specific UART platform ops structure. More...
 

Detailed Description

UART over USB driver for stm32 as a no_os_uart implementation.

Author
Darius Berghe (dariu.nosp@m.s.be.nosp@m.rghe@.nosp@m.anal.nosp@m.og.co.nosp@m.m)

Copyright 2024(c) Analog Devices, Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

◆ STM32_USB_CDC_ACM_RXBUF_LEN

#define STM32_USB_CDC_ACM_RXBUF_LEN   512

◆ STM32_USB_CDC_ACM_TXBUF_LEN

#define STM32_USB_CDC_ACM_TXBUF_LEN   512

Function Documentation

◆ stm32_on_usb_cdc_acm_rx()

void stm32_on_usb_cdc_acm_rx ( uint8_t *  buf,
uint32_t  len 
)

Variable Documentation

◆ gusbdevice

USBD_HandleTypeDef* gusbdevice

◆ stm32_usb_uart_ops

const struct no_os_uart_platform_ops stm32_usb_uart_ops
Initial value:
= {
.init = &stm32_usb_uart_init,
.read = &stm32_usb_uart_read,
.write = &stm32_usb_uart_write,
.remove = &stm32_usb_uart_remove
}

STM32 platform specific UART platform ops structure.

stm32 specific UART over USB platform ops structure.

◆ USBD_Interface_fops

USBD_CDC_ItfTypeDef USBD_Interface_fops
Initial value:
= {
CDC_Init,
CDC_DeInit,
CDC_Control,
CDC_Receive,
CDC_TransmitCplt
}