I have a question regarding programming the serial port (under Linux-2.4.2).
I'm working on an application with a (remote) 8051-derived microcontroller.
A 8051 has a nice feature, called "multi-processor mode". In this case,
the wordsize is extended to 9 bit, and an interrupt is generated whenever
this 9th bit is 1. This can be used to flag the beginning of a message
or frame, or whatever. I'd like to use this feature from a Linux-box,
but I'm having some problems with it.
The posix serial API doesn't support a 9N1-data format. However, it would
be possible to have the PC use an 8-bit wordsize, and use the parity
bit to send out the 9th bit. 8S1 would result in the 9th bit being 0,
8M1 would make it 1. On the incoming side (the 8051 sends out 9 bit
as well), the parity could be enabled but ignored (since it's not a parity
bit in the first place).
Since this 9th bit doesn't carry any information (except 'beginning of a
frame'; the data itself is 8-bit wide), the overhead from that would be
acceptible. However, this means that I have to be able to *exactly* control
which bytes are transmitted as 8S1, and which ones as 8M1. This probably
means that I have to disable the FIFO, or a way to *reliably* drain it.
Can I safely use the TCSETSW IOCTL for this task? It doesn't seem like
this can be done with POSIX tc* functions.
Any suggestions / hints would be greatly appreciated.
Geek code: G-- - Visit OuterSpace: mud.stack.nl 3333
Kees J. Bot: The sum of CPU power and user brain power is a constant.