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

Defined Constants and Types for the LM4F USB Controller More...

Collaboration diagram for USB Controller:

Macros

#define USB_FADDR   MMIO8(USB_BASE + 0x00)
 
#define USB_POWER   MMIO8(USB_BASE + 0x01)
 
#define USB_TXIS   MMIO16(USB_BASE + 0x02)
 
#define USB_RXIS   MMIO16(USB_BASE + 0x04)
 
#define USB_TXIE   MMIO16(USB_BASE + 0x06)
 
#define USB_RXIE   MMIO16(USB_BASE + 0x08)
 
#define USB_IS   MMIO8(USB_BASE + 0x0A)
 
#define USB_IE   MMIO8(USB_BASE + 0x0B)
 
#define USB_FRAME   MMIO16(USB_BASE + 0x0C)
 
#define USB_EPIDX   MMIO8(USB_BASE + 0x0E)
 
#define USB_TEST   MMIO8(USB_BASE + 0x0F)
 
#define USB_FIFO8(n)   MMIO8(USB_BASE + 0x20 + (n)*0x04)
 
#define USB_FIFO16(n)   MMIO16(USB_BASE + 0x20 + (n)*0x04)
 
#define USB_FIFO32(n)   MMIO32(USB_BASE + 0x20 + (n)*0x04)
 
#define USB_TXFIFOSZ   MMIO8(USB_BASE + 0x62)
 
#define USB_RXFIFOSZ   MMIO8(USB_BASE + 0x63)
 
#define USB_TXFIFOADD   MMIO16(USB_BASE + 0x64)
 
#define USB_RXFIFOADD   MMIO16(USB_BASE + 0x66)
 
#define USB_CONTIM   MMIO8(USB_BASE + 0x7A)
 
#define USB_FSEOF   MMIO8(USB_BASE + 0x7D)
 
#define USB_LSEOF   MMIO8(USB_BASE + 0x7E)
 
#define USB_CSRL0   MMIO8(USB_BASE + 0x102)
 
#define USB_CSRH0   MMIO8(USB_BASE + 0x103)
 
#define USB_COUNT0   MMIO8(USB_BASE + 0x108)
 
#define USB_TXMAXP(n)   MMIO16(USB_BASE + 0x100 + (n)*0x10)
 
#define USB_TXCSRL(n)   MMIO8(USB_BASE + 0x102 + (n)*0x10)
 
#define USB_TXCSRH(n)   MMIO8(USB_BASE + 0x103 + (n)*0x10)
 
#define USB_RXMAXP(n)   MMIO16(USB_BASE + 0x104 + (n)*0x10)
 
#define USB_RXCSRL(n)   MMIO8(USB_BASE + 0x106 + (n)*0x10)
 
#define USB_RXCSRH(n)   MMIO8(USB_BASE + 0x107 + (n)*0x10)
 
#define USB_RXCOUNT(n)   MMIO16(USB_BASE + 0x108 + (n)*0x10)
 
#define USB_RXDPKTBUFDIS   MMIO16(USB_BASE + 0x340)
 
#define USB_TXDPKTBUFDIS   MMIO16(USB_BASE + 0x342)
 
#define USB_DRRIS   MMIO32(USB_BASE + 0x410)
 
#define USB_DRIM   MMIO32(USB_BASE + 0x414)
 
#define USB_DRISC   MMIO32(USB_BASE + 0x418)
 
#define USB_DMASEL   MMIO32(USB_BASE + 0x450)
 
#define USB_PP   MMIO32(USB_BASE + 0xFC0)
 
#define USB_FADDR_FUNCADDR_MASK   (0x3f << 0)
 Function Address. More...
 
#define USB_POWER_ISOUP   (1 << 7)
 Isochronous Update. More...
 
#define USB_POWER_SOFTCONN   (1 << 6)
 Soft Connect/Disconnect. More...
 
#define USB_POWER_RESET   (1 << 3)
 RESET signaling. More...
 
#define USB_POWER_RESUME   (1 << 2)
 RESUME signaling. More...
 
#define USB_POWER_SUSPEND   (1 << 1)
 SUSPEND mode. More...
 
#define USB_POWER_PWRDNPHY   (1 << 0)
 Power down PHY. More...
 
#define USB_EP7   (1 << 7)
 
#define USB_EP6   (1 << 6)
 
#define USB_EP5   (1 << 5)
 
#define USB_EP4   (1 << 4)
 
#define USB_EP3   (1 << 3)
 
#define USB_EP2   (1 << 2)
 
#define USB_EP1   (1 << 1)
 
#define USB_EP0   (1 << 0)
 
#define USB_IM_DISCON   (1 << 5)
 USB disconnect interrupt. More...
 
#define USB_IM_SOF   (1 << 3)
 Start of frame. More...
 
#define USB_IM_RESET   (1 << 2)
 RESET signaling detected. More...
 
#define USB_IM_RESUME   (1 << 1)
 RESUME signaling detected. More...
 
#define USB_IM_SUSPEND   (1 << 0)
 SUSPEND signaling detected. More...
 
#define USB_FRAME_MASK   (0x03FF)
 Frame number. More...
 
#define USB_EPIDX_MASK   (0x0F)
 Endpoint Index. More...
 
#define USB_TEST_FIFOACC   (1 << 6)
 FIFO access. More...
 
#define USB_TEST_FORCEFS   (1 << 5)
 Force full-speed mode. More...
 
#define USB_FIFOSZ_DPB   (1 << 4)
 Double packet buffer support. More...
 
#define USB_FIFOSZ_SIZE_MASK   (0x0F << 0)
 
#define USB_FIFOSZ_SIZE_8   (0x00 << 0)
 
#define USB_FIFOSZ_SIZE_16   (0x01 << 0)
 
#define USB_FIFOSZ_SIZE_32   (0x02 << 0)
 
#define USB_FIFOSZ_SIZE_64   (0x03 << 0)
 
#define USB_FIFOSZ_SIZE_128   (0x04 << 0)
 
#define USB_FIFOSZ_SIZE_256   (0x05 << 0)
 
#define USB_FIFOSZ_SIZE_512   (0x06 << 0)
 
#define USB_FIFOSZ_SIZE_1024   (0x07 << 0)
 
#define USB_FIFOSZ_SIZE_2048   (0x08 << 0)
 
#define USB_CONTIM_WTCON_MASK   (0x0F << 4)
 Connect wait. More...
 
#define USB_CONTIM_WTID_MASK   (0x0F << 0)
 Wait ID. More...
 
#define USB_CSRL0_SETENDC   (1 << 7)
 Setup End Clear. More...
 
#define USB_CSRL0_RXRDYC   (1 << 6)
 RXRDY Clear. More...
 
#define USB_CSRL0_STALL   (1 << 5)
 Send Stall. More...
 
#define USB_CSRL0_SETEND   (1 << 4)
 Setup End. More...
 
#define USB_CSRL0_DATAEND   (1 << 3)
 Data End. More...
 
#define USB_CSRL0_STALLED   (1 << 2)
 Endpoint Stalled. More...
 
#define USB_CSRL0_TXRDY   (1 << 1)
 Transmit Packet Ready. More...
 
#define USB_CSRL0_RXRDY   (1 << 0)
 Receive Packet Ready. More...
 
#define USB_CSRH0_FLUSH   (1 << 0)
 Flush FIFO. More...
 
#define USB_TXCSRL_CLRDT   (1 << 6)
 Clear data toggle. More...
 
#define USB_TXCSRL_STALLED   (1 << 5)
 Endpoint Stalled. More...
 
#define USB_TXCSRL_STALL   (1 << 4)
 Send Stall. More...
 
#define USB_TXCSRL_FLUSH   (1 << 3)
 Flush FIFO. More...
 
#define USB_TXCSRL_UNDRN   (1 << 2)
 Underrun. More...
 
#define USB_TXCSRL_FIFONE   (1 << 1)
 FIFO not empty. More...
 
#define USB_TXCSRL_TXRDY   (1 << 0)
 Transmit Packet Ready. More...
 
#define USB_TXCSRH_AUTOSET   (1 << 7)
 Auto set. More...
 
#define USB_TXCSRH_ISO   (1 << 6)
 Isochronous transfers. More...
 
#define USB_TXCSRH_MODE   (1 << 5)
 Mode. More...
 
#define USB_TXCSRH_DMAEN   (1 << 4)
 DMA request enable. More...
 
#define USB_TXCSRH_FDT   (1 << 3)
 Force data toggle. More...
 
#define USB_TXCSRH_DMAMOD   (1 << 2)
 DMA request mode. More...
 
#define USB_RXCSRL_CLRDT   (1 << 7)
 Clear data toggle. More...
 
#define USB_RXCSRL_STALLED   (1 << 6)
 Endpoint Stalled. More...
 
#define USB_RXCSRL_STALL   (1 << 5)
 Send Stall. More...
 
#define USB_RXCSRL_FLUSH   (1 << 4)
 Flush FIFO. More...
 
#define USB_RXCSRL_DATAERR   (1 << 2)
 Data error. More...
 
#define USB_RXCSRL_OVER   (1 << 2)
 Overrun. More...
 
#define USB_RXCSRL_FULL   (1 << 1)
 FIFO full. More...
 
#define USB_RXCSRL_RXRDY   (1 << 0)
 Receive Packet Ready. More...
 
#define USB_RXCSRH_AUTOCL   (1 << 7)
 Auto clear. More...
 
#define USB_RXCSRH_ISO   (1 << 6)
 Isochronous transfers. More...
 
#define USB_RXCSRH_DMAEN   (1 << 5)
 DMA request enable. More...
 
#define USB_RXCSRH_PIDERR   (1 << 4)
 Disable NYET / PID error. More...
 
#define USB_RXCSRH_DMAMOD   (1 << 3)
 DMA request mode. More...
 
#define USB_DRRIS_RESUME   (1 << 0)
 RESUME interrupt status. More...
 
#define USB_DRIM_RESUME   (1 << 0)
 RESUME interrupt mask. More...
 
#define USB_DRISC_RESUME   (1 << 0)
 RESUME interrupt status and clear. More...
 
#define USB_PP_ECNT_MASK   (0xFF << 8)
 Endpoint count. More...
 
#define USB_PP_USB_MASK   (0x03 << 6)
 USB capability. More...
 
#define USB_PP_USB_NA   (0x00 << 6)
 
#define USB_PP_USB_DEVICE   (0x01 << 6)
 
#define USB_PP_USB_HOST   (0x02 << 6)
 
#define USB_PP_USB_OTG   (0x03 << 6)
 
#define USB_PP_PHY   (1 << 4)
 PHY present. More...
 
#define USB_PP_TYPE_MASK   (0x0F << 0)
 Controller type. More...
 

Enumerations

enum  usb_interrupt {
  USB_INT_DISCON = USB_IM_DISCON , USB_INT_SOF = USB_IM_SOF , USB_INT_RESET = USB_IM_RESET , USB_INT_RESUME = USB_IM_RESUME ,
  USB_INT_SUSPEND = USB_IM_SUSPEND
}
 
enum  usb_ep_interrupt {
  USB_EP0_INT = USB_EP0 , USB_EP1_INT = USB_EP1 , USB_EP2_INT = USB_EP2 , USB_EP3_INT = USB_EP3 ,
  USB_EP4_INT = USB_EP4 , USB_EP5_INT = USB_EP5 , USB_EP6_INT = USB_EP6 , USB_EP7_INT = USB_EP7
}
 

Functions

void usb_enable_interrupts (enum usb_interrupt ints, enum usb_ep_interrupt rx_ints, enum usb_ep_interrupt tx_ints)
 Enable Specific USB Interrupts. More...
 
void usb_disable_interrupts (enum usb_interrupt ints, enum usb_ep_interrupt rx_ints, enum usb_ep_interrupt tx_ints)
 Disable Specific USB Interrupts. More...
 

Detailed Description

Defined Constants and Types for the LM4F USB Controller

Version
1.0.0
Author
© 2013 Alexandru Gagniuc mr.nu.nosp@m.ke.m.nosp@m.e@gma.nosp@m.il.c.nosp@m.om
Date
15 May 2013

LGPL License Terms libopencm3 License

Macro Definition Documentation

◆ USB_CONTIM

#define USB_CONTIM   MMIO8(USB_BASE + 0x7A)

Definition at line 99 of file usb.h.

◆ USB_CONTIM_WTCON_MASK

#define USB_CONTIM_WTCON_MASK   (0x0F << 4)

Connect wait.

Definition at line 253 of file usb.h.

◆ USB_CONTIM_WTID_MASK

#define USB_CONTIM_WTID_MASK   (0x0F << 0)

Wait ID.

Definition at line 255 of file usb.h.

◆ USB_COUNT0

#define USB_COUNT0   MMIO8(USB_BASE + 0x108)

Definition at line 114 of file usb.h.

◆ USB_CSRH0

#define USB_CSRH0   MMIO8(USB_BASE + 0x103)

Definition at line 111 of file usb.h.

◆ USB_CSRH0_FLUSH

#define USB_CSRH0_FLUSH   (1 << 0)

Flush FIFO.

Definition at line 281 of file usb.h.

◆ USB_CSRL0

#define USB_CSRL0   MMIO8(USB_BASE + 0x102)

Definition at line 108 of file usb.h.

◆ USB_CSRL0_DATAEND

#define USB_CSRL0_DATAEND   (1 << 3)

Data End.

Definition at line 269 of file usb.h.

◆ USB_CSRL0_RXRDY

#define USB_CSRL0_RXRDY   (1 << 0)

Receive Packet Ready.

Definition at line 275 of file usb.h.

◆ USB_CSRL0_RXRDYC

#define USB_CSRL0_RXRDYC   (1 << 6)

RXRDY Clear.

Definition at line 263 of file usb.h.

◆ USB_CSRL0_SETEND

#define USB_CSRL0_SETEND   (1 << 4)

Setup End.

Definition at line 267 of file usb.h.

◆ USB_CSRL0_SETENDC

#define USB_CSRL0_SETENDC   (1 << 7)

Setup End Clear.

Definition at line 261 of file usb.h.

◆ USB_CSRL0_STALL

#define USB_CSRL0_STALL   (1 << 5)

Send Stall.

Definition at line 265 of file usb.h.

◆ USB_CSRL0_STALLED

#define USB_CSRL0_STALLED   (1 << 2)

Endpoint Stalled.

Definition at line 271 of file usb.h.

◆ USB_CSRL0_TXRDY

#define USB_CSRL0_TXRDY   (1 << 1)

Transmit Packet Ready.

Definition at line 273 of file usb.h.

◆ USB_DMASEL

#define USB_DMASEL   MMIO32(USB_BASE + 0x450)

Definition at line 153 of file usb.h.

◆ USB_DRIM

#define USB_DRIM   MMIO32(USB_BASE + 0x414)

Definition at line 147 of file usb.h.

◆ USB_DRIM_RESUME

#define USB_DRIM_RESUME   (1 << 0)

RESUME interrupt mask.

Definition at line 361 of file usb.h.

◆ USB_DRISC

#define USB_DRISC   MMIO32(USB_BASE + 0x418)

Definition at line 150 of file usb.h.

◆ USB_DRISC_RESUME

#define USB_DRISC_RESUME   (1 << 0)

RESUME interrupt status and clear.

Definition at line 367 of file usb.h.

◆ USB_DRRIS

#define USB_DRRIS   MMIO32(USB_BASE + 0x410)

Definition at line 144 of file usb.h.

◆ USB_DRRIS_RESUME

#define USB_DRRIS_RESUME   (1 << 0)

RESUME interrupt status.

Definition at line 355 of file usb.h.

◆ USB_EP0

#define USB_EP0   (1 << 0)

Definition at line 193 of file usb.h.

◆ USB_EP1

#define USB_EP1   (1 << 1)

Definition at line 192 of file usb.h.

◆ USB_EP2

#define USB_EP2   (1 << 2)

Definition at line 191 of file usb.h.

◆ USB_EP3

#define USB_EP3   (1 << 3)

Definition at line 190 of file usb.h.

◆ USB_EP4

#define USB_EP4   (1 << 4)

Definition at line 189 of file usb.h.

◆ USB_EP5

#define USB_EP5   (1 << 5)

Definition at line 188 of file usb.h.

◆ USB_EP6

#define USB_EP6   (1 << 6)

Definition at line 187 of file usb.h.

◆ USB_EP7

#define USB_EP7   (1 << 7)

Definition at line 186 of file usb.h.

◆ USB_EPIDX

#define USB_EPIDX   MMIO8(USB_BASE + 0x0E)

Definition at line 76 of file usb.h.

◆ USB_EPIDX_MASK

#define USB_EPIDX_MASK   (0x0F)

Endpoint Index.

Definition at line 221 of file usb.h.

◆ USB_FADDR

#define USB_FADDR   MMIO8(USB_BASE + 0x00)

Definition at line 49 of file usb.h.

◆ USB_FADDR_FUNCADDR_MASK

#define USB_FADDR_FUNCADDR_MASK   (0x3f << 0)

Function Address.

Definition at line 163 of file usb.h.

◆ USB_FIFO16

#define USB_FIFO16 (   n)    MMIO16(USB_BASE + 0x20 + (n)*0x04)

Definition at line 83 of file usb.h.

◆ USB_FIFO32

#define USB_FIFO32 (   n)    MMIO32(USB_BASE + 0x20 + (n)*0x04)

Definition at line 84 of file usb.h.

◆ USB_FIFO8

#define USB_FIFO8 (   n)    MMIO8(USB_BASE + 0x20 + (n)*0x04)

Definition at line 82 of file usb.h.

◆ USB_FIFOSZ_DPB

#define USB_FIFOSZ_DPB   (1 << 4)

Double packet buffer support.

Definition at line 235 of file usb.h.

◆ USB_FIFOSZ_SIZE_1024

#define USB_FIFOSZ_SIZE_1024   (0x07 << 0)

Definition at line 245 of file usb.h.

◆ USB_FIFOSZ_SIZE_128

#define USB_FIFOSZ_SIZE_128   (0x04 << 0)

Definition at line 242 of file usb.h.

◆ USB_FIFOSZ_SIZE_16

#define USB_FIFOSZ_SIZE_16   (0x01 << 0)

Definition at line 239 of file usb.h.

◆ USB_FIFOSZ_SIZE_2048

#define USB_FIFOSZ_SIZE_2048   (0x08 << 0)

Definition at line 246 of file usb.h.

◆ USB_FIFOSZ_SIZE_256

#define USB_FIFOSZ_SIZE_256   (0x05 << 0)

Definition at line 243 of file usb.h.

◆ USB_FIFOSZ_SIZE_32

#define USB_FIFOSZ_SIZE_32   (0x02 << 0)

Definition at line 240 of file usb.h.

◆ USB_FIFOSZ_SIZE_512

#define USB_FIFOSZ_SIZE_512   (0x06 << 0)

Definition at line 244 of file usb.h.

◆ USB_FIFOSZ_SIZE_64

#define USB_FIFOSZ_SIZE_64   (0x03 << 0)

Definition at line 241 of file usb.h.

◆ USB_FIFOSZ_SIZE_8

#define USB_FIFOSZ_SIZE_8   (0x00 << 0)

Definition at line 238 of file usb.h.

◆ USB_FIFOSZ_SIZE_MASK

#define USB_FIFOSZ_SIZE_MASK   (0x0F << 0)

Definition at line 237 of file usb.h.

◆ USB_FRAME

#define USB_FRAME   MMIO16(USB_BASE + 0x0C)

Definition at line 73 of file usb.h.

◆ USB_FRAME_MASK

#define USB_FRAME_MASK   (0x03FF)

Frame number.

Definition at line 215 of file usb.h.

◆ USB_FSEOF

#define USB_FSEOF   MMIO8(USB_BASE + 0x7D)

Definition at line 102 of file usb.h.

◆ USB_IE

#define USB_IE   MMIO8(USB_BASE + 0x0B)

Definition at line 70 of file usb.h.

◆ USB_IM_DISCON

#define USB_IM_DISCON   (1 << 5)

USB disconnect interrupt.

Definition at line 201 of file usb.h.

◆ USB_IM_RESET

#define USB_IM_RESET   (1 << 2)

RESET signaling detected.

Definition at line 205 of file usb.h.

◆ USB_IM_RESUME

#define USB_IM_RESUME   (1 << 1)

RESUME signaling detected.

Definition at line 207 of file usb.h.

◆ USB_IM_SOF

#define USB_IM_SOF   (1 << 3)

Start of frame.

Definition at line 203 of file usb.h.

◆ USB_IM_SUSPEND

#define USB_IM_SUSPEND   (1 << 0)

SUSPEND signaling detected.

Definition at line 209 of file usb.h.

◆ USB_IS

#define USB_IS   MMIO8(USB_BASE + 0x0A)

Definition at line 67 of file usb.h.

◆ USB_LSEOF

#define USB_LSEOF   MMIO8(USB_BASE + 0x7E)

Definition at line 105 of file usb.h.

◆ USB_POWER

#define USB_POWER   MMIO8(USB_BASE + 0x01)

Definition at line 52 of file usb.h.

◆ USB_POWER_ISOUP

#define USB_POWER_ISOUP   (1 << 7)

Isochronous Update.

Definition at line 169 of file usb.h.

◆ USB_POWER_PWRDNPHY

#define USB_POWER_PWRDNPHY   (1 << 0)

Power down PHY.

Definition at line 179 of file usb.h.

◆ USB_POWER_RESET

#define USB_POWER_RESET   (1 << 3)

RESET signaling.

Definition at line 173 of file usb.h.

◆ USB_POWER_RESUME

#define USB_POWER_RESUME   (1 << 2)

RESUME signaling.

Definition at line 175 of file usb.h.

◆ USB_POWER_SOFTCONN

#define USB_POWER_SOFTCONN   (1 << 6)

Soft Connect/Disconnect.

Definition at line 171 of file usb.h.

◆ USB_POWER_SUSPEND

#define USB_POWER_SUSPEND   (1 << 1)

SUSPEND mode.

Definition at line 177 of file usb.h.

◆ USB_PP

#define USB_PP   MMIO32(USB_BASE + 0xFC0)

Definition at line 156 of file usb.h.

◆ USB_PP_ECNT_MASK

#define USB_PP_ECNT_MASK   (0xFF << 8)

Endpoint count.

Definition at line 373 of file usb.h.

◆ USB_PP_PHY

#define USB_PP_PHY   (1 << 4)

PHY present.

Definition at line 381 of file usb.h.

◆ USB_PP_TYPE_MASK

#define USB_PP_TYPE_MASK   (0x0F << 0)

Controller type.

Definition at line 383 of file usb.h.

◆ USB_PP_USB_DEVICE

#define USB_PP_USB_DEVICE   (0x01 << 6)

Definition at line 377 of file usb.h.

◆ USB_PP_USB_HOST

#define USB_PP_USB_HOST   (0x02 << 6)

Definition at line 378 of file usb.h.

◆ USB_PP_USB_MASK

#define USB_PP_USB_MASK   (0x03 << 6)

USB capability.

Definition at line 375 of file usb.h.

◆ USB_PP_USB_NA

#define USB_PP_USB_NA   (0x00 << 6)

Definition at line 376 of file usb.h.

◆ USB_PP_USB_OTG

#define USB_PP_USB_OTG   (0x03 << 6)

Definition at line 379 of file usb.h.

◆ USB_RXCOUNT

#define USB_RXCOUNT (   n)    MMIO16(USB_BASE + 0x108 + (n)*0x10)

Definition at line 135 of file usb.h.

◆ USB_RXCSRH

#define USB_RXCSRH (   n)    MMIO8(USB_BASE + 0x107 + (n)*0x10)

Definition at line 132 of file usb.h.

◆ USB_RXCSRH_AUTOCL

#define USB_RXCSRH_AUTOCL   (1 << 7)

Auto clear.

Definition at line 341 of file usb.h.

◆ USB_RXCSRH_DMAEN

#define USB_RXCSRH_DMAEN   (1 << 5)

DMA request enable.

Definition at line 345 of file usb.h.

◆ USB_RXCSRH_DMAMOD

#define USB_RXCSRH_DMAMOD   (1 << 3)

DMA request mode.

Definition at line 349 of file usb.h.

◆ USB_RXCSRH_ISO

#define USB_RXCSRH_ISO   (1 << 6)

Isochronous transfers.

Definition at line 343 of file usb.h.

◆ USB_RXCSRH_PIDERR

#define USB_RXCSRH_PIDERR   (1 << 4)

Disable NYET / PID error.

Definition at line 347 of file usb.h.

◆ USB_RXCSRL

#define USB_RXCSRL (   n)    MMIO8(USB_BASE + 0x106 + (n)*0x10)

Definition at line 129 of file usb.h.

◆ USB_RXCSRL_CLRDT

#define USB_RXCSRL_CLRDT   (1 << 7)

Clear data toggle.

Definition at line 321 of file usb.h.

◆ USB_RXCSRL_DATAERR

#define USB_RXCSRL_DATAERR   (1 << 2)

Data error.

Definition at line 329 of file usb.h.

◆ USB_RXCSRL_FLUSH

#define USB_RXCSRL_FLUSH   (1 << 4)

Flush FIFO.

Definition at line 327 of file usb.h.

◆ USB_RXCSRL_FULL

#define USB_RXCSRL_FULL   (1 << 1)

FIFO full.

Definition at line 333 of file usb.h.

◆ USB_RXCSRL_OVER

#define USB_RXCSRL_OVER   (1 << 2)

Overrun.

Definition at line 331 of file usb.h.

◆ USB_RXCSRL_RXRDY

#define USB_RXCSRL_RXRDY   (1 << 0)

Receive Packet Ready.

Definition at line 335 of file usb.h.

◆ USB_RXCSRL_STALL

#define USB_RXCSRL_STALL   (1 << 5)

Send Stall.

Definition at line 325 of file usb.h.

◆ USB_RXCSRL_STALLED

#define USB_RXCSRL_STALLED   (1 << 6)

Endpoint Stalled.

Definition at line 323 of file usb.h.

◆ USB_RXDPKTBUFDIS

#define USB_RXDPKTBUFDIS   MMIO16(USB_BASE + 0x340)

Definition at line 138 of file usb.h.

◆ USB_RXFIFOADD

#define USB_RXFIFOADD   MMIO16(USB_BASE + 0x66)

Definition at line 96 of file usb.h.

◆ USB_RXFIFOSZ

#define USB_RXFIFOSZ   MMIO8(USB_BASE + 0x63)

Definition at line 90 of file usb.h.

◆ USB_RXIE

#define USB_RXIE   MMIO16(USB_BASE + 0x08)

Definition at line 64 of file usb.h.

◆ USB_RXIS

#define USB_RXIS   MMIO16(USB_BASE + 0x04)

Definition at line 58 of file usb.h.

◆ USB_RXMAXP

#define USB_RXMAXP (   n)    MMIO16(USB_BASE + 0x104 + (n)*0x10)

Definition at line 126 of file usb.h.

◆ USB_TEST

#define USB_TEST   MMIO8(USB_BASE + 0x0F)

Definition at line 79 of file usb.h.

◆ USB_TEST_FIFOACC

#define USB_TEST_FIFOACC   (1 << 6)

FIFO access.

Definition at line 227 of file usb.h.

◆ USB_TEST_FORCEFS

#define USB_TEST_FORCEFS   (1 << 5)

Force full-speed mode.

Definition at line 229 of file usb.h.

◆ USB_TXCSRH

#define USB_TXCSRH (   n)    MMIO8(USB_BASE + 0x103 + (n)*0x10)

Definition at line 123 of file usb.h.

◆ USB_TXCSRH_AUTOSET

#define USB_TXCSRH_AUTOSET   (1 << 7)

Auto set.

Definition at line 305 of file usb.h.

◆ USB_TXCSRH_DMAEN

#define USB_TXCSRH_DMAEN   (1 << 4)

DMA request enable.

Definition at line 311 of file usb.h.

◆ USB_TXCSRH_DMAMOD

#define USB_TXCSRH_DMAMOD   (1 << 2)

DMA request mode.

Definition at line 315 of file usb.h.

◆ USB_TXCSRH_FDT

#define USB_TXCSRH_FDT   (1 << 3)

Force data toggle.

Definition at line 313 of file usb.h.

◆ USB_TXCSRH_ISO

#define USB_TXCSRH_ISO   (1 << 6)

Isochronous transfers.

Definition at line 307 of file usb.h.

◆ USB_TXCSRH_MODE

#define USB_TXCSRH_MODE   (1 << 5)

Mode.

Definition at line 309 of file usb.h.

◆ USB_TXCSRL

#define USB_TXCSRL (   n)    MMIO8(USB_BASE + 0x102 + (n)*0x10)

Definition at line 120 of file usb.h.

◆ USB_TXCSRL_CLRDT

#define USB_TXCSRL_CLRDT   (1 << 6)

Clear data toggle.

Definition at line 287 of file usb.h.

◆ USB_TXCSRL_FIFONE

#define USB_TXCSRL_FIFONE   (1 << 1)

FIFO not empty.

Definition at line 297 of file usb.h.

◆ USB_TXCSRL_FLUSH

#define USB_TXCSRL_FLUSH   (1 << 3)

Flush FIFO.

Definition at line 293 of file usb.h.

◆ USB_TXCSRL_STALL

#define USB_TXCSRL_STALL   (1 << 4)

Send Stall.

Definition at line 291 of file usb.h.

◆ USB_TXCSRL_STALLED

#define USB_TXCSRL_STALLED   (1 << 5)

Endpoint Stalled.

Definition at line 289 of file usb.h.

◆ USB_TXCSRL_TXRDY

#define USB_TXCSRL_TXRDY   (1 << 0)

Transmit Packet Ready.

Definition at line 299 of file usb.h.

◆ USB_TXCSRL_UNDRN

#define USB_TXCSRL_UNDRN   (1 << 2)

Underrun.

Definition at line 295 of file usb.h.

◆ USB_TXDPKTBUFDIS

#define USB_TXDPKTBUFDIS   MMIO16(USB_BASE + 0x342)

Definition at line 141 of file usb.h.

◆ USB_TXFIFOADD

#define USB_TXFIFOADD   MMIO16(USB_BASE + 0x64)

Definition at line 93 of file usb.h.

◆ USB_TXFIFOSZ

#define USB_TXFIFOSZ   MMIO8(USB_BASE + 0x62)

Definition at line 87 of file usb.h.

◆ USB_TXIE

#define USB_TXIE   MMIO16(USB_BASE + 0x06)

Definition at line 61 of file usb.h.

◆ USB_TXIS

#define USB_TXIS   MMIO16(USB_BASE + 0x02)

Definition at line 55 of file usb.h.

◆ USB_TXMAXP

#define USB_TXMAXP (   n)    MMIO16(USB_BASE + 0x100 + (n)*0x10)

Definition at line 117 of file usb.h.

Enumeration Type Documentation

◆ usb_ep_interrupt

Enumerator
USB_EP0_INT 
USB_EP1_INT 
USB_EP2_INT 
USB_EP3_INT 
USB_EP4_INT 
USB_EP5_INT 
USB_EP6_INT 
USB_EP7_INT 

Definition at line 396 of file usb.h.

◆ usb_interrupt

Enumerator
USB_INT_DISCON 
USB_INT_SOF 
USB_INT_RESET 
USB_INT_RESUME 
USB_INT_SUSPEND 

Definition at line 388 of file usb.h.

Function Documentation

◆ usb_disable_interrupts()

void usb_disable_interrupts ( enum usb_interrupt  ints,
enum usb_ep_interrupt  rx_ints,
enum usb_ep_interrupt  tx_ints 
)

Disable Specific USB Interrupts.

Disable any combination of interrupts. Interrupts may be OR'ed together to enable them with one call. For example, to disable both the RESUME and RESET interrupts, pass (USB_INT_RESUME | USB_INT_RESET)

Note that the NVIC must be enabled and properly configured for the interrupt to be routed to the CPU.

Parameters
[in]intsInterrupts which to disable. Any combination of interrupts may be specified by OR'ing then together
[in]rx_intsEndpoints for which to stop generating an interrupt when a packet packet is received.
[in]tx_intsEndpoints for which to stop generating an interrupt when a packet packet is finished transmitting.

Definition at line 158 of file usb_lm4f.c.

References USB_IE, USB_RXIE, and USB_TXIE.

◆ usb_enable_interrupts()

void usb_enable_interrupts ( enum usb_interrupt  ints,
enum usb_ep_interrupt  rx_ints,
enum usb_ep_interrupt  tx_ints 
)

Enable Specific USB Interrupts.

Enable any combination of interrupts. Interrupts may be OR'ed together to enable them with one call. For example, to enable both the RESUME and RESET interrupts, pass (USB_INT_RESUME | USB_INT_RESET)

Note that the NVIC must be enabled and properly configured for the interrupt to be routed to the CPU.

Parameters
[in]intsInterrupts which to enable. Any combination of interrupts may be specified by OR'ing then together
[in]rx_intsEndpoints for which to generate an interrupt when a packet packet is received.
[in]tx_intsEndpoints for which to generate an interrupt when a packet packet is finished transmitting.

Definition at line 132 of file usb_lm4f.c.

References USB_IE, USB_RXIE, and USB_TXIE.