µTasker Forum

µTasker Forum => µTasker general => Topic started by: neil on June 17, 2014, 03:16:30 PM

Title: Enabling/Disabling Serial port
Post by: neil on June 17, 2014, 03:16:30 PM
Hi Mark,
   Throughout my application I wish to simply switch off/on the RX side of a serial port, but also keep all settings as before (baud rate,handshaking etc..).  Can I simply use the lines:
   fnDriver( SerialPortID,RX_ON, 0 );   
            and
   fnDriver( SerialPortID,RX_OFF, 0 );   

  Regards
   Neil
Title: Re: Enabling/Disabling Serial port
Post by: mark on June 17, 2014, 03:44:33 PM
Hi Neil

fnDriver( SerialPortID,RX_OFF, 0 );  will disable the receiver and its interrupts and
fnDriver( SerialPortID,RX_ON, 0 );  will configure teh RX pins, enable its interrupts and enable receptiopn.

That means that you should be abel to use the two to alternate between Rx on/off.

It may also be possible to do the same by directly controlling the pin function of the RXD pin and switch it between GPIO and RXD - when set to GPIO it will not receive any data, which would have the same result the same as disabling the Rx.

Regards

Mark