Is there a way to set a custom serial baud rate on COM1 (/dev/ttySAC1) on Picomod7 ?
What I tried:
Code
- struct serial_struct new_serdrvinfo;
- ioctl(fd, TIOCGSERIAL, &new_serdrvinfo); // read driver settings
- new_serdrvinfo.flags = (new_serdrvinfo.flags & ~ASYNC_SPD_MASK) | ASYNC_SPD_CUST; // activate custom baudrate
- printf("BaudBase: %i - Divisor: %i\n",new_serdrvinfo.baud_base,new_serdrvinfo.custom_divisor);
- // new_serdrvinfo.baud_base=3000000;
- // new_serdrvinfo.custom_divisor = 6; // set custom divisor
- ioctl(fd, TIOCSSERIAL, &new_serdrvinfo); // write new driver settings
The baud_base and custom_divisor parameters both are zero. When I try to set some values the ioctl(fd, TIOSSERIAL, xxx) blocks or the hole program hangs up.
Calling #setserial -a /dev/ttySAC1 returns zero for the two parameters also. The UART IC is "undefined" and Port ist returned as 0x0000.
It's possible to use some additional defined values like B460800 or B500000 (they are working) but I need 520000.
Any idea? Thanks.