简体   繁体   中英

Confused about PySerial with USB Full-speed half-duplex talking priority

I am working on my personal project for an oscilloscope, where I send bulk data from MCU(STM32) to PC through USB Full-Speed (12 Mbits). I would like to communicate with the device(STM32) by using PySerial. I found out that USB is half-duplex, where the host (PC) sets talking privileges with the device - "speak when you're spoken to". What I don't understand is how does the host set the talking privileges - Does my computer or pyserial automatically handle this, or do I have to do some handshaking protocol that needs to be implemented in code in both the host and device? I'm wondering since in the event both device and host are sending data, what happens to the data? Thank you!

On your PC you do not have to worry about the USB protocol. That is the responsibility of the USB stack in your OS and the associated USB device drivers.

So you just use PySerial to send and receive your data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM