Author Topic: changing serial settings..  (Read 8588 times)

Offline neil

  • Sr. Member
  • ****
  • Posts: 438
    • View Profile
changing serial settings..
« on: September 19, 2009, 11:54:42 AM »
Hi Mark,
  I change the settings of the serial port using fnOpen( TYPE_TTY, MODIFY_CONFIG, &tInterfaceParameters ) command, but sometimes I have to change the handshaking. After fnOpen(..) is called  with the MODIFY_CONFIG, can I simply use the below to switch on CTS and RTS?

            fnDriver( PortID, (MODIFY_INTERRUPT | ENABLE_CTS_CHANGE), 0 );
            fnDriver( PortID, (MODIFY_CONTROL | SET_RTS), 0 );   

When changing back to non handshaking mode, how do I disable the above?

Regards
Neil

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: changing serial settings..
« Reply #1 on: September 19, 2009, 11:48:36 PM »
Hi Neil

Yes, the method of enabling CTS is correct (this enables the CTS interrupt which controls flow control). The RTS output control is in fact independent of the CTS control so can be always changed as desired.

To disable the mode you can then use
            fnDriver( PortID, (MODIFY_INTERRUPT | DISABLE_CTS_CHANGE), 0 );

Regards

Mark