Customize Serial Driver
Kye
Posts: 2,200
I need to be able to force the TX line low for periods of 100 ms to generate line break conditions for the PC. How should I do this?
I know how to do this in SPIN, since I can control the life time of the serial cog... but, how would I go about it in C?
I know how to do this in SPIN, since I can control the life time of the serial cog... but, how would I go about it in C?
Comments
It depends on which serial driver you're using. If you're using SimpleSerial then it's very easy -- the serial code is running on the same COG as the C code, so you can just force the pin low yourself. For FullDuplexSerial it's a bit trickier. One way would be to close all the file handles associated with the serial device -- this will cause the COG to be stopped. It will be re-started when you re-open the files.
Eric