EasyManuals Logo

ST STM32F446 Series User Manual

ST STM32F446 Series
1328 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #1205 background imageLoading...
Page #1205 background image
RM0390 Rev 4 1205/1328
RM0390 USB on-the-go full-speed/high-speed (OTG_FS/OTG_HS)
1264
31.16.4 DMA mode
The OTG host uses the AHB master interface to fetch the transmit packet data (AHB to
USB) and receive the data update (USB to AHB). The AHB master uses the programmed
DMA address (OTG_HCDMAx register in host mode and
OTG_DIEPDMAx/OTG_DOEPDMAx register in peripheral mode) to access the data
buffers.
31.16.5 Host programming model
Channel initialization
The application must initialize one or more channels before it can communicate with
connected devices. To initialize and enable a channel, the application must perform the
following steps:
1. Program the OTG_GINTMSK register to unmask the following:
2. Channel interrupt
Non-periodic transmit FIFO empty for OUT transactions (applicable when
operating in pipelined transaction-level with the packet count field programmed
with more than one).
Non-periodic transmit FIFO half-empty for OUT transactions (applicable when
operating in pipelined transaction-level with the packet count field programmed
with more than one).
3. Program the OTG_HAINTMSK register to unmask the selected channels’ interrupts.
4. Program the OTG_HCINTMSK register to unmask the transaction-related interrupts of
interest given in the host channel interrupt register.
5. Program the selected channel’s OTG_HCTSIZx register with the total transfer size, in
bytes, and the expected number of packets, including short packets. The application
must program the PID field with the initial data PID (to be used on the first OUT
transaction or to be expected from the first IN transaction).
6. Program the OTG_HCCHARx register of the selected channel with the device’s
endpoint characteristics, such as type, speed, direction, and so forth. (The channel can
be enabled by setting the channel enable bit to 1 only when the application is ready to
transmit or receive any packet).
7. Program the selected channels in the OTG_HCSPLTx register(s) with the hub and port
addresses (split transactions only).
8. Program the selected channels in the OTG_HCDMAx register(s) with the buffer start
address (DMA transactions only).
Halting a channel
The application can disable any channel by programming the OTG_HCCHARx register with
the CHDIS and CHENA bits set to 1. This enables the OTG_FS/OTG_HS host to flush the
posted requests (if any) and generates a channel halted interrupt. The application must wait
for the CHH interrupt in OTG_HCINTx before reallocating the channel for other transactions.
The OTG_FS/OTG_HS host does not interrupt the transaction that has already been started
on the USB.
To disable a channel in DMA mode operation, the application does not need to check for
space in the request queue. The OTG_HS host checks for space to write the disable

Table of Contents

Other manuals for ST STM32F446 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the ST STM32F446 Series and is the answer not in the manual?

ST STM32F446 Series Specifications

General IconGeneral
BrandST
ModelSTM32F446 Series
CategoryMicrocontrollers
LanguageEnglish

Related product manuals