I am trying to set a baud rate of 250K for my UARTS.  I have the following 
(using debian):

[code]
               int speed=250000;


                struct serial_struct ser_info; 

                struct termios options; 


 

                ser_info.reserved_char[0] = 0; 

                ioctl(handle, TIOCGSERIAL, &ser_info); 


 

                ser_info.flags = (ser_info.flags & ~ASYNC_SPD_MASK) | 
ASYNC_SPD_CUST; 

                ser_info.custom_divisor = (ser_info.baud_base + (speed/2) ) 
/ speed;

                

                int closestSpeed = ser_info.baud_base / ser_info.
custom_divisor; 

                if (closestSpeed < speed * 98 / 100 || closestSpeed > speed 
* 102 / 100) 

                { 

                        std::cout <<" Cannot set serial port speed to "<<
speed<<" closest possible is " <<closestSpeed<<std::endl; 

                } 

                else 

                        std::cout <<"Setting speed to " << closestSpeed<<std
::endl; 


 

                if (ioctl(handle, TIOCSSERIAL, &ser_info)<0) 

                { 

                       std::cout <<"Error setting serial options: "<< 
strerror(errno) <<std::endl; 

                }



However, this always returns an error on the last ioctl to set the  custom 
divisor (it says invalid parameter).  Any helpful insight?

-- 
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