libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
USB peripheral API

USB Peripheral for Happy Gecko. More...

Collaboration diagram for USB peripheral API:

Macros

#define RX_FIFO_SIZE   256
 
#define ENDPOINT_COUNT   4
 

Functions

static usbd_deviceefm32hg_usbd_init (void)
 Initialize the USB device controller hardware of the EFM32HG. More...
 

Variables

static struct _usbd_device _usbd_dev
 
const struct _usbd_driver efm32hg_usb_driver
 

Detailed Description

USB Peripheral for Happy Gecko.

The Happy Gecko uses the "standard" usb_dwc_otg core.

See also
USB Defines

Macro Definition Documentation

◆ ENDPOINT_COUNT

#define ENDPOINT_COUNT   4

Definition at line 49 of file usb_efm32hg.c.

◆ RX_FIFO_SIZE

#define RX_FIFO_SIZE   256

Definition at line 44 of file usb_efm32hg.c.

Function Documentation

◆ efm32hg_usbd_init()

Variable Documentation

◆ _usbd_dev

struct _usbd_device _usbd_dev
static

Definition at line 51 of file usb_efm32hg.c.

Referenced by efm32hg_usbd_init().

◆ efm32hg_usb_driver

const struct _usbd_driver efm32hg_usb_driver
Initial value:
= {
.set_address = dwc_set_address,
.ep_setup = dwc_ep_setup,
.ep_reset = dwc_endpoints_reset,
.ep_stall_set = dwc_ep_stall_set,
.ep_stall_get = dwc_ep_stall_get,
.ep_nak_set = dwc_ep_nak_set,
.ep_write_packet = dwc_ep_write_packet,
.ep_read_packet = dwc_ep_read_packet,
.poll = dwc_poll,
.disconnect = dwc_disconnect,
.base_address = USB_OTG_FS_BASE,
.set_address_before_status = 1,
.rx_fifo_size = RX_FIFO_SIZE,
}
#define USB_OTG_FS_BASE
static usbd_device * efm32hg_usbd_init(void)
Initialize the USB device controller hardware of the EFM32HG.
Definition: usb_efm32hg.c:54
#define RX_FIFO_SIZE
Definition: usb_efm32hg.c:44
uint8_t dwc_ep_stall_get(usbd_device *usbd_dev, uint8_t addr)
void dwc_disconnect(usbd_device *usbd_dev, bool disconnected)
void dwc_endpoints_reset(usbd_device *usbd_dev)
uint16_t dwc_ep_write_packet(usbd_device *usbd_dev, uint8_t addr, const void *buf, uint16_t len)
uint16_t dwc_ep_read_packet(usbd_device *usbd_dev, uint8_t addr, void *buf, uint16_t len)
void dwc_set_address(usbd_device *usbd_dev, uint8_t addr)
void dwc_ep_nak_set(usbd_device *usbd_dev, uint8_t addr, uint8_t nak)
void dwc_ep_stall_set(usbd_device *usbd_dev, uint8_t addr, uint8_t stall)
void dwc_ep_setup(usbd_device *usbd_dev, uint8_t addr, uint8_t type, uint16_t max_size, void(*callback)(usbd_device *usbd_dev, uint8_t ep))
void dwc_poll(usbd_device *usbd_dev)

Definition at line 123 of file usb_efm32hg.c.

Referenced by efm32hg_usbd_init().