Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hi,
- I bought the RS485 Cap and i'm trying to use it correctly.
- The connection is set to the UART 2 with the switch. ( rx and tx )
- i correctly set the pin mux to enable the uart 2:
- echo 21 > /sys/kernel/debug/omap_mux/spi0_sclk
- echo 1 > /sys/kernel/debug/omap_mux/spi0_d0
- In my code, i'm able to open the connection, but not to initiate it :
- int fd = open ("/dev/ttyO2", O_RDWR);
- if (fd < 0) {
- printf("error\n");
- /* Error handling. See errno. */
- }
- // it works
- struct serial_rs485 rs485conf;
- rs485conf.flags |= SER_RS485_ENABLED;
- rs485conf.delay_rts_before_send = 0x00000004;
- int test = ioctl(fd, TIOCSRS485, &rs485conf);
- if(test<0){
- test=0;
- /// i'm stuck here .........
- }else{
- test=1;
- }
- Would you like to explain me what is wrong with me ?
- Thx you very much,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement