This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Data Structures | |
struct | usbpkt |
struct | USBVARS |
Defines | |
#define | AUDIO_ISOC_OUT_EP 0x01 |
#define | MSC_BULK_OUT_ENDPOINT 0x03 |
#define | MSC_BULK_IN_ENDPOINT 0x02 |
#define | ENDPOINT_SIZE_0 64 |
#define | ENDPOINT_SIZE_1 512 |
#define | BRESET_INT 0x8000 |
#define | SOF_INT 0x4000 |
#define | RX_INT 0x2000 |
#define | TX_HOLD_INT 0x1000 |
#define | TX_INT 0x0800 |
#define | NAK_SENT_INT 0x0400 |
#define | SETUP_INFO 0x0080 |
#define | P_SETUP 0x10 |
#define | P_DATA 0x20 |
#define | PID_SOF 0x05 |
#define | PID_SETUP 0x0D |
#define | PID_IN 0x09 |
#define | PID_OUT 0x01 |
#define | PID_DATA0 0x03 |
#define | PID_DATA1 0x0B |
#define | PID_ACK 0x02 |
#define | PID_NACK 0x0A |
#define | PID_STALL 0x0E |
#define | USB_CONFIG (USB_BASE) |
#define | USB_CONTROL (USB_BASE+1) |
#define | USB_STATUS (USB_BASE+2) |
#define | USB_STF_BUS_RESET (1<<15) |
#define | USB_STF_SOF (1<<14) |
#define | USB_STF_RX (1<<13) |
#define | USB_STF_TX_READY (1<<12) |
#define | USB_STF_TX_EMPTY (1<<11) |
#define | USB_STF_NAK (1<<10) |
#define | USB_STF_SETUP (1<<7) |
#define | USB_STM_LAST_EP (15<<0) |
#define | USB_RDPTR (USB_BASE+3) |
#define | USB_WRPTR (USB_BASE+4) |
#define | USB_EP_SEND0 (USB_BASE+8) |
#define | USB_EP_SEND1 (USB_BASE+9) |
#define | USB_EP_SEND2 (USB_BASE+10) |
#define | USB_EP_SEND3 (USB_BASE+11) |
#define | USB_EP_ST0 (USB_BASE+16) |
#define | USB_EP_ST1 (USB_BASE+17) |
#define | USB_EP_ST2 (USB_BASE+18) |
#define | USB_EP_ST3 (USB_BASE+19) |
#define | USB_STF_OUT_BULK (0<<14) |
#define | USB_STF_OUT_INT (1<<14) |
#define | USB_STF_OUT_ISO (3<<14) |
#define | USB_STF_OUT_ENABLE (1<<13) |
#define | USB_STF_OUT_STALL (1<<12) |
#define | USB_STF_OUT_STALL_SENT (1<<11) |
#define | USB_STF_OUT_EP_SIZE (1<<8) |
#define | USB_STF_IN_BULK (0<<6) |
#define | USB_STF_IN_INT (1<<6) |
#define | USB_STF_IN_ISO (3<<6) |
#define | USB_STF_IN_ENABLE (1<<5) |
#define | USB_STF_IN_STALL (1<<4) |
#define | USB_STF_IN_STALL_SENT (1<<3) |
#define | USB_STF_IN_NACK_SENT (1<<2) |
#define | USB_STF_IN_EMPTY (1<<1) |
#define | USB_STF_IN_FORCE_NACK (1<<0) |
#define | RING_BUF_SIZE 1024 |
#define | DT_LANGUAGES 0 |
#define | DT_VENDOR 1 |
#define | DT_MODEL 2 |
#define | DT_SERIAL 3 |
#define | DT_DEVICE 4 |
#define | DT_CONFIGURATION 5 |
#define | USB_MASS_STORAGE 1 |
#define | USB_AUDIO 2 |
#define | AUDIO_DELAY_FRAMES 12 |
#define | AUDIO_DELAY_FRAMES_STR "\x0c" |
Typedefs | |
typedef usbpkt | USBPacket |
Functions | |
auto void | RingBufCopyX (register __i2 u_int16 *d, register __i0 const u_int16 *s, register __a0 u_int16 n) |
int | USBStartTransmission (u_int16 ep, const void *buf, u_int16 length, u_int16 requestedLength) |
void | USBContinueTransmission (u_int16 ep) |
void | InitUSBDescriptors (u_int16 initDescriptors) |
void | RealInitUSBDescriptors (u_int16 initDescriptors) |
void | InitUSB (u_int16 initDescriptors) |
void | USBResetEndpoint (register __c0 int ep) |
u_int16 | USBReceivePacket (USBPacket *packet) |
void | USBSendZeroLengthPacketToEndpoint0 (void) |
void | USBHandler (void) |
void | RealUSBHandler () |
void | DecodeSetupPacket (void) |
void | RealDecodeSetupPacket (void) |
void | USBCheckForSetupPacket (void) |
u_int16 | USBXmitLeft (u_int16 endpoint) |
void | USBSingleStallEndpoint (register __c0 u_int16 ep) |
void | USBStallEndpoint (register __c0 int ep) |
void | USBResetStall (register __c0 int ep) |
u_int16 | USBIsEndpointStalled (register int ep) |
u_int16 | SwapWord (register __a1 u_int16 d) |
auto u_int16 | USBIsAttached (void) |
auto u_int16 | USBIsDetached (void) |
auto u_int16 | USBWantsSuspend (void) |
void | MSCPacketFromPC (USBPacket *setupPacket) |
void | RealMSCPacketFromPC (USBPacket *setupPacket) |
u_int16 | MscSendCsw (u_int16 status) |
void | DiskProtocolError (char errorcode) |
void | AudioPacketFromUSB (u_int16 *data, s_int16 words) |
Variables | |
USBVARS | USB |
Definition in file usblowlib.h.
|
Definition at line 311 of file usblowlib.h. |
|
Definition at line 312 of file usblowlib.h. |
|
OUT endpoint used for audio. Definition at line 8 of file usblowlib.h. |
|
Bus reset interrupt Definition at line 18 of file usblowlib.h. |
|
Definition at line 147 of file usblowlib.h. |
|
Definition at line 146 of file usblowlib.h. |
|
Definition at line 142 of file usblowlib.h. |
|
Definition at line 144 of file usblowlib.h. |
|
Definition at line 145 of file usblowlib.h. |
|
Definition at line 143 of file usblowlib.h. |
|
The endpoint size supported for IN. Definition at line 12 of file usblowlib.h. |
|
The max OUT packet size, mainly for audio. Definition at line 13 of file usblowlib.h. |
|
IN endpoint used for SCSI. Definition at line 10 of file usblowlib.h. |
|
OUT endpoint used for SCSI. Definition at line 9 of file usblowlib.h. |
|
Packet NAKed Definition at line 23 of file usblowlib.h. |
|
Definition at line 30 of file usblowlib.h. |
|
Definition at line 29 of file usblowlib.h. |
|
Definition at line 37 of file usblowlib.h. |
|
Definition at line 35 of file usblowlib.h. |
|
Definition at line 36 of file usblowlib.h. |
|
Definition at line 33 of file usblowlib.h. |
|
Definition at line 38 of file usblowlib.h. |
|
Definition at line 34 of file usblowlib.h. |
|
Definition at line 32 of file usblowlib.h. |
|
Definition at line 31 of file usblowlib.h. |
|
Definition at line 39 of file usblowlib.h. |
|
Definition at line 97 of file usblowlib.h. |
|
OUT packet received Definition at line 20 of file usblowlib.h. |
|
Setup packet Definition at line 24 of file usblowlib.h. |
|
Start of Frame interrupt Definition at line 19 of file usblowlib.h. |
|
Copied packet to IN registers Definition at line 21 of file usblowlib.h. |
|
Successfully transmitted packet Definition at line 22 of file usblowlib.h. |
|
Definition at line 298 of file usblowlib.h. |
|
Definition at line 45 of file usblowlib.h. |
|
Definition at line 46 of file usblowlib.h. |
|
Definition at line 61 of file usblowlib.h. |
|
Definition at line 62 of file usblowlib.h. |
|
Definition at line 63 of file usblowlib.h. |
|
Definition at line 64 of file usblowlib.h. |
|
Definition at line 70 of file usblowlib.h. |
|
Definition at line 71 of file usblowlib.h. |
|
Definition at line 72 of file usblowlib.h. |
|
Definition at line 73 of file usblowlib.h. |
|
Definition at line 297 of file usblowlib.h. |
|
USB receive buffer read pointer. Definition at line 58 of file usblowlib.h. |
|
Definition at line 47 of file usblowlib.h. |
|
Definition at line 49 of file usblowlib.h. |
|
Definition at line 86 of file usblowlib.h. |
|
Definition at line 93 of file usblowlib.h. |
|
Definition at line 89 of file usblowlib.h. |
|
Definition at line 94 of file usblowlib.h. |
|
Definition at line 87 of file usblowlib.h. |
|
Definition at line 88 of file usblowlib.h. |
|
Definition at line 92 of file usblowlib.h. |
|
Definition at line 90 of file usblowlib.h. |
|
Definition at line 91 of file usblowlib.h. |
|
Definition at line 54 of file usblowlib.h. |
|
Definition at line 79 of file usblowlib.h. |
|
Definition at line 82 of file usblowlib.h. |
|
Definition at line 85 of file usblowlib.h. |
|
Definition at line 80 of file usblowlib.h. |
|
Definition at line 81 of file usblowlib.h. |
|
Definition at line 83 of file usblowlib.h. |
|
Definition at line 84 of file usblowlib.h. |
|
Definition at line 51 of file usblowlib.h. |
|
Definition at line 55 of file usblowlib.h. |
|
Definition at line 50 of file usblowlib.h. |
|
Definition at line 53 of file usblowlib.h. |
|
Definition at line 52 of file usblowlib.h. |
|
Definition at line 56 of file usblowlib.h. |
|
USB receive buffer write pointer. Definition at line 59 of file usblowlib.h. |
|
Holding space for one received USB packet. |
|
Called each time a packet is received to the audio endpoint. The function must be provided. |
|
Hook: handles setup packets. Default: DecodeSetupPacket. |
|
|
|
Initializes USB subsystem.
|
|
Hook: Initializes USB descriptor table. Default: RealInitUSBDescriptors.
|
|
Hook: handle a mass storage packet. Default: RealMSCPacketFromPC. |
|
|
|
Processes setup packets. |
|
Initializes USB descriptor table.
|
|
Handles a mass storage packet. |
|
Polled handling of USB packets. Both Mass Storage and Audio are processed, but the descriptor decides which one the host uses. |
|
Copies packet from USB receive memory ring buffer to X memory buffer. The data is in big-endian format, i.e. the high 8 bits of a word are the first byte, the low 8 bits the second byte. Does not touch USB peripheral registers.
|
|
Swaps byte order |
|
Checks if any setup packets are waiting and discards any packets that appear before it in the input queue. |
|
Continues sending a packet.
|
|
Hook: polled handling of USB packets. Default: RealUSBHandler. |
|
Uses USB pull-up enable and USB_DN to detect if USB is attached. USB is attached if the USB pull-up is enabled. USB is not attached if USB_DN is high for every sampling in 20000 clock cycles, and is attached if USB_DN is low for even one sampling.
|
|
Checks USB_DP and USB_DN. If both are high, the unit is probably detached. You MUST also use the USBWantsSuspend() function to see that there has not been SOF's for a while. Otherwise you will get false detections.
|
|
Returns the stall state of an endpoint.
|
|
Fetches a packet from USB receive FIFO. Also clears RX_INT and SETUP_INFO.
|
|
Resets an endpoint. Data toggles are also reset and possible IN packets waiting for transmit are discarded.
|
|
Resets the stall state of an endpoint.
|
|
Sends an empty packet to the control endpoint. Returns when the packet has been sent or a bus reset is received.
|
|
Sends (at least) one STALL to the specified endpoint.
|
|
Sets the endpoint to stall state.
|
|
Starts transmission of data in endpoint-size -sized parts. Internall calls USBContinueTransmission once to start the transfer.
|
|
Checks if there has been no SOF for 10..20ms.
|
|
Checks how many bytes of a packet are waiting to be sent.
|
|
|