I actually just put up a tutorial for doing this in 
Python: 
http://inspire.logicsupply.com/2014/09/beaglebone-rs-485-communication.html 
It uses GPIO1_16, but of course you can use any GPIO pin, including the one 
that's shared with UART4 RTS.
 

> When I tried to use:
> struct serial_rs485 rs485conf;
> rs485conf.flags |= SER_RS485_USE_GPIO;
> rs485conf.gpio_pin = GPIO0_9;
>
> I got error from gcc that it does not know those macros:
> ‘SER_RS485_USE_GPIO’ was not declared in this scope
>  rs485conf.flags |= SER_RS485_USE_GPIO;
> ‘struct serial_rs485’ has no member named ‘gpio_pin’
>   rs485conf.gpio_pin = GPIO0_9;
> ‘GPIO0_9’ was not declared in this scope
>   rs485conf.gpio_pin = GPIO0_9;
>
>  
That's because you're compiling with the standard libc headers, which don't 
include the modified serial_rs485 struct that uses the GPIO pin. The 
tutorial I linked above uses Python and just defines the same values 
locally, which you could do in C as well. You could also grab the Kernel 
source and include 'include/uapi/linux/serial.h', which has the patched 
serial_rs485 struct 
(https://github.com/RobertCNelson/bb-kernel/blob/am33x-v3.8/patches/fixes/0007-omap-RS485-support-by-Michael-Musset.patch#L201).
 

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to