![ARTERY AT32F435 Series Скачать руководство пользователя страница 486](http://html1.mh-extra.com/html/artery/at32f435-series/at32f435-series_reference-manual_2977592486.webp)
AT32F435/437
Series Reference Manual
2022.11.11
Page 486
Rev 2.03
21.6.5.10 OTGFS device IN endpoint-x control register
(OTGFS_DIEPCTLx) (x=x=1
…
7, where x is endpoint number)
The application uses this register to control the behavior of the endpoints other than endpoint 0.
Bit
Register
Reset value
Type
Description
Bit 31
EPTENA
0x0
rw1s
Endpoint enable
The application sets this bit to start transmitting data on
an endpoint. The controller clears this bit before the
generation one of the following interrupts on this endpoint:
–
SETUP stage done
–
Endpoint disabled
–
Transfer completed
Bit 30
EPTDIS
0x0
rw1s
Endpoint disable
The application sets this bit to stop transmitting data on
an endpoint, even if the transfer on that endpoint is
incomplete.
The application must wait for the endpoint disabled
interrupt before treating the endpoint as disabled. The
controller clears this bit before setting the endpoint
disabled interrupt. The application must set this bit only
when the endpoint enabled set.
Bit 29
SETD1PID/
SETODDFR
0x0
wo
Set DATA1 PID
Applies to interrupt/bulk IN endpoints only. Writing to this
bit sets the endpoint data PID bit in this register to DATA1.
Set odd frame
Applies to synchronous IN endpoints only. Writing to this
bit sets the Even/Odd frame to odd frame.
0: Disabled Set DATA1 PID disabled or Do not force odd
frame
1: Set DATA1 PID enabled or forced odd frame
Bit 28
SETD0PID/
SETEVENFR
0x0
rw
Set DATA0 PID
Applies to interrupt/bulk IN endpoints only. Writing to this
bit sets the endpoint data PID bit in this register to DATA0.
Set Even frame
Applies to synchronous IN endpoints only. Writing to this
bit sets the Even/Odd frame to even frame.
0:Disabled Set DATA0 PID disabled or Do not force
even frame
1: Set DATA0PID or set the EOFRNUM to even frame
Bit 27
SNAK
0x0
wo
Set NAK
A write to this bit sets the NAK bit for the endpoint. The
application uses this bit to control the transmission of NAK
handshakes on an endpoint. The controller sets this bit on
a Transfer completed interrupt or after receiving a SETUP
packet.
Values:
0: Do not set NAK
1: Set NAK
Bit 26
CNAK
0x0
wo
Clear NAK
A write to this bit clears the NAK bit for this endpoint.
0: Not clear NAK
1: Clear NAK
Bit 25: 22 TXFNUM
0x0
rw
TxFIFO number
Allocate FIFO number to the corresponding endpoint. A
separate FIFO number is allocated to each valid IN
endpoint. This bit applies to IN endpoints only.
Bit 21
STALL
0x0
rw
STALL handshake
Applies to non-control, non-synchronous IN and OUT
endpoints.
The application sets this bit to stall all tokens from the
USB host to this endpoint. If a NAK bit, global non-periodic
IN NAK bit or global OUT NAK bit is set along with this bit,
the STALL bit has priority. Only the application can clear
this bit, but the controller never.