26#include "../usb/usb_private.h"
27#include "common/st_usbfs_core.h"
50 const uint8_t *lbuf = buf;
51 volatile uint16_t *PM = vPM;
53 for (i = 0; i < len; i += 2) {
54 *PM++ = (uint16_t)lbuf[i+1] << 8 | lbuf[i];
67 const volatile uint16_t *PM = vPM;
68 uint8_t odd = len & 1;
71 if (((uintptr_t) buf) & 0x01) {
72 for (; len; PM++, len--) {
74 *(uint8_t *) buf++ = value;
75 *(uint8_t *) buf++ = value >> 8;
78 for (; len; PM++, buf += 2, len--) {
79 *(uint16_t *) buf = *PM;
84 *(uint8_t *) buf = *(uint8_t *) PM;
void rcc_periph_clock_enable(enum rcc_periph_clken clken)
Enable Peripheral Clock in running mode.
const struct _usbd_driver st_usbfs_v2_usb_driver
struct _usbd_device usbd_device
void st_usbfs_poll(usbd_device *dev)
void st_usbfs_ep_nak_set(usbd_device *dev, uint8_t addr, uint8_t nak)
uint16_t st_usbfs_ep_write_packet(usbd_device *dev, uint8_t addr, const void *buf, uint16_t len)
struct _usbd_device st_usbfs_dev
void st_usbfs_ep_setup(usbd_device *dev, uint8_t addr, uint8_t type, uint16_t max_size, void(*callback)(usbd_device *usbd_dev, uint8_t ep))
uint8_t st_usbfs_ep_stall_get(usbd_device *dev, uint8_t addr)
void st_usbfs_endpoints_reset(usbd_device *dev)
uint16_t st_usbfs_ep_read_packet(usbd_device *dev, uint8_t addr, void *buf, uint16_t len)
void st_usbfs_ep_stall_set(usbd_device *dev, uint8_t addr, uint8_t stall)
void st_usbfs_set_address(usbd_device *dev, uint8_t addr)
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.
static usbd_device * st_usbfs_v2_usbd_init(void)
Initialize the USB device controller hardware of the STM32.
static void st_usbfs_v2_disconnect(usbd_device *usbd_dev, bool disconnected)
static struct _usbd_device usbd_dev