Programmatic serial flow control

Posted by: V99

Programmatic serial flow control - 18/03/2003 17:07

The developer info says that RTS/CTS isn't implemented in the serial driver.. the serial VFD I'm using is occasionally slow and can't keep up with data being sent, so I need a way to read it's "busy" line and not send any more data until it goes low again. Right now the busy line is connected to the Empeg CTS, which the player uses for display dimming, so I can see it flipping on and off.

How do I check the status of the serial control lines from a userland app?
Posted by: wfaulk

Re: Programmatic serial flow control - 18/03/2003 18:30

I could be wrong, but I think that they're simply not attached -- that there's no way to get to them. Can you use software flow control (Ctrl-S/Ctrl-Q) instead?
Posted by: V99

Re: Programmatic serial flow control - 18/03/2003 21:13

At least some of them are attached; CTS is used for dimmer sense, DCD for mute.. it would seem logical to assume that RTS his other friends are connected too. I don't actually use the mute line though so hijacking it would be fine.

empegcar.h defines some useful looking constants:
#define EMPEG_SERIALDSR      (GPIO_GPIO21) /* IN  Serial DSR                 */

#define EMPEG_SERIALCTS (GPIO_GPIO22) /* IN Serial CTS */
#define EMPEG_SERIALDTR (GPIO_GPIO23) /* OUT Serial DTS (also LED) */
and empeg_power.c has some code that would seem to work:
	unsigned int gplr=GPLR;

...
if (!(gplr&EMPEG_SERIALDCD)) bitset|=EMPEG_POWER_FLAG_EXTMUTE; /* Tel mute */
, but doing anything with GPLR seems to cause a segfault (which dumps to the display, and half the chars are dropped because it's not observing the CTS line ). Maybe it's only accessible in kernel space?

Software flow control would require the cooperation of the display firmware, which isn't there.
Posted by: tman

Re: Programmatic serial flow control - 18/03/2003 21:20

You're trying to directly access the hardware from userspace which you can't do. You have change the kernel to support it I'm afraid.

- Trevor
Posted by: mlord

Re: Programmatic serial flow control - 18/03/2003 21:23

The one you are interested in may already be in /proc/empeg_power

-ml