Embedded Xinu Operating System
An ongoing research project and educational operating system.
|
#include <usb_dwc_regs.h>
Data Fields | |
uint32_t | val |
struct { | |
uint32_t max_packet_size: 11 | |
uint32_t endpoint_number: 4 | |
uint32_t endpoint_direction: 1 | |
uint32_t reserved: 1 | |
uint32_t low_speed: 1 | |
uint32_t endpoint_type: 2 | |
uint32_t packets_per_frame: 2 | |
uint32_t device_address: 7 | |
uint32_t odd_frame: 1 | |
uint32_t channel_disable: 1 | |
uint32_t channel_enable: 1 | |
}; | |
Channel Characteristics Register -
Contains various fields that must be set to prepare this channel for a transfer to or from a particular endpoint on a particular USB device.
This register only needs to be programmed one time when doing a transfer, regardless of how many packets it consists of, unless the channel is re-programmed for a different transfer or the transfer is moved to a different channel.
uint32_t dwc_regs::dwc_host_channel::dwc_host_channel_characteristics::channel_disable |
Software can set this to 1 to halt the channel. Not needed during normal operation as the channel halts automatically when a transaction completes or an error occurs.
uint32_t dwc_regs::dwc_host_channel::dwc_host_channel_characteristics::channel_enable |
Software can set this to 1 to enable the channel, thereby actually starting the transaction on the USB. This must only be done after the characteristics, split_control, and transfer registers, and possibly other registers (depending on the transfer) have been programmed.
uint32_t dwc_regs::dwc_host_channel::dwc_host_channel_characteristics::device_address |
USB device address of the device on which the endpoint is located. Must be programmed by software before starting the transfer.
uint32_t dwc_regs::dwc_host_channel::dwc_host_channel_characteristics::endpoint_direction |
Endpoint direction (high bit of bEndpointAddress). Must be programmed by software before starting the transfer.
uint32_t dwc_regs::dwc_host_channel::dwc_host_channel_characteristics::endpoint_number |
Endpoint number (low 4 bits of bEndpointAddress). Must be programmed by software before starting the transfer.
uint32_t dwc_regs::dwc_host_channel::dwc_host_channel_characteristics::endpoint_type |
Endpoint type (low 2 bits of bmAttributes). Must be programmed by software before starting the transfer.
uint32_t dwc_regs::dwc_host_channel::dwc_host_channel_characteristics::low_speed |
1 when the device being communicated with is attached at low speed; 0 otherwise. Must be programmed by software before starting the transfer.
uint32_t dwc_regs::dwc_host_channel::dwc_host_channel_characteristics::max_packet_size |
Maximum packet size the endpoint is capable of sending or receiving. Must be programmed by software before starting the transfer.
uint32_t dwc_regs::dwc_host_channel::dwc_host_channel_characteristics::odd_frame |
Just before enabling the channel (for all transactions), software needs to set this to the opposite of the low bit of the host_frame_number register. Otherwise the hardware will issue frame overrun errors on some transactions. TODO: what exactly does this do?
uint32_t dwc_regs::dwc_host_channel::dwc_host_channel_characteristics::packets_per_frame |
Maximum number of transactions that can be executed per microframe as part of this transfer. Normally 1, but should be set to 1 + (bits 11 and 12 of wMaxPacketSize) for high-speed interrupt and isochronous endpoints. Must be programmed by software before starting the transfer.