I am developing an application on a BeagleBoneBlack. Embedded linux is quite new for me =/
The problem I am facing is that I want to implement a RS485 communication, I wrote a piece of C++-Code by using the SeriaLib-Library, for the moment a dedicated GPIO is used to toggle the direction of the RS485 interface. All has been fine till this point.
To write a message the function write is used a below
write(fd,Message,Lenght);
The only problem is to toggle the DIRECTION-Pin immediately after the last byte is written on the BUS =(
While developing on microcontrollers its no problem to react on various interrupts and so on.
Is there any solution - deep in the kernel? - to toggle a pin DIRECT after the succesful transmit of the message?