libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
st_usbfs_v1.c File Reference
#include <libopencm3/cm3/common.h>
#include <libopencm3/stm32/rcc.h>
#include <libopencm3/stm32/tools.h>
#include <libopencm3/stm32/st_usbfs.h>
#include <libopencm3/usb/usbd.h>
#include "../usb/usb_private.h"
#include "common/st_usbfs_core.h"
Include dependency graph for st_usbfs_v1.c:

Go to the source code of this file.

Functions

static usbd_devicest_usbfs_v1_usbd_init (void)
 Initialize the USB device controller hardware of the STM32. More...
 
void st_usbfs_copy_to_pm (volatile void *vPM, const void *buf, uint16_t len)
 
void st_usbfs_copy_from_pm (void *buf, const volatile void *vPM, uint16_t len)
 Copy a data buffer from packet memory. More...
 

Variables

const struct _usbd_driver st_usbfs_v1_usb_driver
 

Function Documentation

◆ st_usbfs_copy_from_pm()

void st_usbfs_copy_from_pm ( void *  buf,
const volatile void *  vPM,
uint16_t  len 
)

Copy a data buffer from packet memory.

Parameters
bufSource pointer to data buffer.
vPMDestination pointer into packet memory.
lenNumber of bytes to copy.

Definition at line 73 of file st_usbfs_v1.c.

Referenced by st_usbfs_ep_read_packet().

Here is the caller graph for this function:

◆ st_usbfs_copy_to_pm()

void st_usbfs_copy_to_pm ( volatile void *  vPM,
const void *  buf,
uint16_t  len 
)

Definition at line 57 of file st_usbfs_v1.c.

Referenced by st_usbfs_ep_write_packet().

Here is the caller graph for this function:

◆ st_usbfs_v1_usbd_init()

static usbd_device * st_usbfs_v1_usbd_init ( void  )
static

Initialize the USB device controller hardware of the STM32.

Definition at line 44 of file st_usbfs_v1.c.

References rcc_periph_clock_enable(), RCC_USB, SET_REG, st_usbfs_dev, USB_BTABLE_REG, USB_CNTR_CTRM, USB_CNTR_REG, USB_CNTR_RESETM, USB_CNTR_SUSPM, USB_CNTR_WKUPM, and USB_ISTR_REG.

Here is the call graph for this function: