09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>RM0090</strong> USB on-the-go high-speed (OTG_HS)<br />

FIFO and queue status register (HNPTXSTS) are read-only registers which can be used by<br />

the application to read the status of each request queue. They contain:<br />

● The number of free entries currently available in the periodic (nonperiodic) request<br />

queue (8 max)<br />

● Free space currently available in the periodic (nonperiodic) Tx-FIFO (out-transactions)<br />

● IN/OUT token, host channel number and other status information.<br />

As request queues can hold a maximum of 8 entries each, the application can push to<br />

schedule host transactions in advance with respect to the moment they physically reach the<br />

USB for a maximum of 8 pending periodic transactions plus 8 pending nonperiodic<br />

transactions.<br />

To post a transaction request to the host scheduler (queue) the application must check that<br />

there is at least 1 entry available in the periodic (nonperiodic) request queue by reading the<br />

PTXQSAV bits in the OTG_HS_HNPTXSTS register or NPTQXSAV bits in the<br />

OTG_HS_HNPTXSTS register.<br />

31.7 SOF trigger<br />

The OTG FS core allows to monitor, track and configure SOF framing in the host and<br />

peripheral. It also features an SOF pulse output connectivity.<br />

These capabilities are particularly useful to implement adaptive audio clock generation<br />

techniques, where the audio peripheral needs to synchronize to the isochronous stream<br />

provided by the PC, or the host needs trimming its framing rate according to the<br />

requirements of the audio peripheral.<br />

31.7.1 Host SOFs<br />

In host mode the number of PHY clocks occurring between the generation of two<br />

consecutive SOF (FS) or keep-alive (LS) tokens is programmable in the host frame interval<br />

register (OTG_HS_HFIR), thus providing application control over the SOF framing period.<br />

An interrupt is generated at any start of frame (SOF bit in OTG_HS_GINTSTS). The current<br />

frame number and the time remaining until the next SOF are tracked in the host frame<br />

number register (OTG_HS_HFNUM).<br />

An SOF pulse signal is generated at any SOF starting token and with a width of 12 system<br />

clock cycles. It can be made available externally on the SOF pin using the SOFOUTEN bit in<br />

the global control and configuration register. The SOF pulse is also internally connected to<br />

the input trigger of timer 2 (TIM2), so that the input capture feature, the output compare<br />

feature and the timer can be triggered by the SOF pulse. The TIM2 connection is enabled<br />

through ITR1_RMP bits of TIM2_OR register.<br />

Doc ID 018909 Rev 3 1168/1416

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

Saved successfully!

Ooh no, something went wrong!