28 USB on-the-go full-speed (OTG_FS)

Started by tha, June 06, 2022, 07:51:11 AM

Previous topic - Next topic

tha

28.5.2 Peripheral states

Powered state

The VBUS input ตรวจพบ the B-Session valid voltage โดยที่ the USB peripheral ถูกอนุญาตให้เข้าสู่ the powered state (see USB2.0 par9.1). จากนั้น The OTG_FS จะเชื่อมต่อโดยอัตโนมัติ the DP pull-up resistor เพื่อให้สัญญาน full-speed device connection ไปยัง the host และสร้าง the session request interrupt (SRQINT bit ใน OTG_FS_GINTSTS) เพื่อแจ้งให้ทราบ the powered state.

The VBUS input ยังช่วยให้แน่ใจว่า valid VBUS levels ถูกจ่ายไฟโดย the host ในระหว่าง USB operations. ถ้าการลดลงของ VBUS ต่ำกว่า B-session valid ที่เกิดขึ้นถูกตรวจพบ (ตัวอย่างเช่นเนื่องจาก a power disturbance หรือ the host port ถูก switched off), the OTG_FS จะตัดการเชื่อมต่อโดยอัตโนมัติและ the session end detected (SEDET bit ใน OTG_FS_GOTGINT) interrupt จะถูกสร้างเพื่อแจ้งให้ทราบว่า the OTG_FS ได้ออกจาก the powered state แล้ว.

ใน the powered state, the OTG_FS คาดว่าจะได้รับ some reset signaling จาก the host. ไม่มี other USB operation สามารถเป็นได้. เมื่อ a reset signaling ถูกรับ the reset detected interrupt (USBRST in OTG_FS_GINTSTS) จะถูกสร้าง. เมื่อ the reset signaling เสร็จสมบูรณ์, the enumeration done interrupt (ENUMDNE bit in OTG_FS_GINTSTS) จะถูกสร้างและ the OTG_FS เข้าสู่ the Default state.

tha

Soft disconnect

The powered state สามารถถูกออกโดย software ด้วย the soft disconnect feature. The DP pullup resistor จะถูกเอาออกโดยการเซ็ต the soft disconnect bit ใน the device control register (SDIS bit ใน OTG_FS_DCTL), เป็นเหตุให้ a device disconnect detection interrupt บน the host side ถึงแม้ว่า the USB cable ไม่ได้ถูกถอดออกจาก the host port จริงๆ.

tha

Default state

ใน the Default state the OTG_FS คาดว่าจะได้รับ a SET_ADDRESS command จาก the host. ไม่มี other USB operation สามารถเป็นไปได้. เมื่อ a valid SET_ADDRESS command ถูกถอดระหัสบน the USB, the application เขียน the corresponding number ลงใน the device address field ใน the device configuration register (DAD bit in OTG_FS_DCFG). จากนั้น The OTG_FS เข้าสู่ the address state และพร้อมที่จะตอบรับ host transactions ที่ theconfigured USB address.


tha

Suspended state

The OTG_FS peripheral ตรวจสอบกิจกรรม USB อย่างต่อเนื่อง. หลังจากการนับ 3 ms of USB idleness, the early suspend interrupt (ESUSP bit ใน OTG_FS_GINTSTS) จะถูกปล่อยออก, และยืนยัน 3 ms ต่อมา, ถ้าเหมาะสม, โดย the suspend interrupt (USBSUSP bit ใน OTG_FS_GINTSTS). จากนั้น The device suspend bit จะถูกเซ็ตโดยอัตโนมัติใน the device status register (SUSPSTS bit in OTG_FS_DSTS) และ the OTG_FS เข้าสู่ the suspended state.

The suspended state อาจมีทางเลือกถูกออกโดย the device ตัวมันเอง. ในกรณีนี้ the application เซ็ต the remote wakeup signaling bit ใน the device control register (RWUSIG bit ใน OTG_FS_DCTL) และเคลียร์มันหลังจาก 1 ถึง 15 ms.

เมื่อ a resume signaling ถูกตรวจพบจาก the host, the resume interrupt (WKUPINT bit ใน OTG_FS_GINTSTS) จะถูกสร้างและ the device suspend bit จะถูกเคลียร์โดยอัตโนมัติ.