29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

USB on-the-go full-speed (OTG_FS)<br />

RM0008<br />

same time. If more than 8 transfer requests are pending from the application, the host<br />

controller driver (HCD) must re-allocate channels when they become available from<br />

previous duty, that is, after receiving the transfer completed <strong>and</strong> channel halted interrupts.<br />

Each host channel can be configured to support in/out <strong>and</strong> any type of periodic/nonperiodic<br />

transaction. Each host channel makes us of proper control (HCCHARx), transfer<br />

configuration (HCTSIZx) <strong>and</strong> status/interrupt (HCINTx) registers with associated mask<br />

(HCINTMSKx) registers.<br />

Host channel control<br />

●<br />

The following host channel controls are available to the application through the host<br />

channel-x characteristics register (HCCHARx):<br />

– channel enable/disable<br />

– program the FS/LS speed of target USB peripheral<br />

– program the address of target USB peripheral<br />

– program the endpoint number of target USB peripheral<br />

– program the transfer IN/OUT direction<br />

– program the USB transfer type (control, bulk, interrupt, isochronous)<br />

– program the maximum packet size (MPS)<br />

– program the periodic transfer to be executed during odd/even frames<br />

Host channel transfer<br />

The host channel transfer size registers (HCTSIZx) allow the application to program the<br />

transfer size parameters, <strong>and</strong> read the transfer status. Programming must be done before<br />

setting the channel enable bit in the host channel characteristics register. Once the endpoint<br />

is enabled the packet count field is read-only as the OTG FS core updates it according to the<br />

current transfer status.<br />

● The following transfer parameters can be programmed:<br />

– transfer size in bytes<br />

– number of packets constituting the overall transfer size<br />

– initial data PID<br />

Host channel status/interrupt<br />

The host channel-x interrupt register (HCINTx) indicates the status of an endpoint with<br />

respect to USB- <strong>and</strong> AHB-related events. The application must read these register when the<br />

host channels interrupt bit in the core interrupt register (HCINT bit in OTG_FS_GINTSTS) is<br />

set. Before the application can read these registers, it must first read the host all channels<br />

interrupt (HCAINT) register to get the exact channel number for the host channel-x interrupt<br />

register. The application must clear the appropriate bit in this register to clear the<br />

706/995 Doc ID 13902 Rev 9

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!