I have a project that uses the Tx/Rx pins to transmit through an RS-485 chip. I'm using GPIO18 as a flow control. As it stands when I go to transmit the following sequence occurs.
1 - Calculate transmission time(ms) based on baudrate and buffer size x = f(y)
2 - Set to GPIO 18 to transmit
3 - Send the buffer data to be written
4 - Set GPIO 18 to receive after x time has passed.
This process works, but I would feel better about the resilience of the application if I could somehow check Tx/Rx to confirm that the buffer has been written rather than hoping my timeout processes in the correct amount of time.
Application is written in node using GPIO and serialport libraries.
Any advice would be greatly appreciated. As always, thanks guys.