configuration of serial fifo
From: Peter Münster (look_at_signature.invalid)
Date: 11/02/05
- Next message: Alain Mosnier: "Re: configuration of serial fifo"
- Previous message: Marco Cavallini [KOAN]: "Re: StrongARM-based Intrinsyc Cerfboard and Compact Flash craziness"
- Next in thread: Alain Mosnier: "Re: configuration of serial fifo"
- Reply: Alain Mosnier: "Re: configuration of serial fifo"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 2 Nov 2005 18:05:08 +0100
Hello,
after receiving a special character on a UART, I would like to send out
another character in less than 2ms. I can have good latencies of about some
50µs, but often I get 3ms, which is too long. I think, this is because
of the fifo. How could I configure the fifo, to get triggered at every
character?
Here is my setup:
struct termios options;
struct serial_struct serial;
int fd = open("/dev/ttyS0", O_RDWR | O_NOCTTY);
ioctl(fd, TIOCGSERIAL, &serial);
serial.flags |= ASYNC_LOW_LATENCY;
serial.xmit_fifo_size = ???; // a value of 1 here does not change a lot
ioctl(fd, TIOCSSERIAL, &serial);
tcgetattr(fd, &options);
cfsetispeed(&options, B19200);
cfsetospeed(&options, B19200);
options.c_cflag &= ~(CSIZE | PARODD | CSTOPB | CRTSCTS);
options.c_cflag |= CLOCAL | CREAD | CS8 | PARENB;
options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
options.c_iflag |= INPCK | ISTRIP;
options.c_oflag &= ~OPOST;
options.c_cc[VTIME] = 0;
options.c_cc[VMIN] = 1;
tcsetattr(fd, TCSANOW, &options);
I've discovered the file linux/serial_reg.h with a lot of definitions,
for example:
#define UART_FCR_TRIGGER_1 0x00 /* Mask for trigger set at 1 */
But I don't know where I could find some documentation how to use these
defines...
I only know the "Serial Programming Guide for POSIX" but perhaps I need
something more specific to Linux...
Thanks in advance for any help!
Cheers, Peter
-- email: pmrb at free.fr http://pmrb.free.fr/contact/
- Next message: Alain Mosnier: "Re: configuration of serial fifo"
- Previous message: Marco Cavallini [KOAN]: "Re: StrongARM-based Intrinsyc Cerfboard and Compact Flash craziness"
- Next in thread: Alain Mosnier: "Re: configuration of serial fifo"
- Reply: Alain Mosnier: "Re: configuration of serial fifo"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|