RAW UART
Nicolás Alvarez
nicoalar.22 at gmail.com
Mon Dec 23 18:52:18 UTC 2013
Wendell, I'm using the Gaisler BSP for leon3. I understand, the thing is
that I'll be unable to use the console. My SOC has four APBUART, I need to
use one like a console and the other three in raw mode, I wasn't very clear
in the previous email (sorry!).
*Ing. Nicolás Alvarez*
cel: 03548-15638454
http://ar.linkedin.com/in/ingalvarez/en
On Mon, Dec 23, 2013 at 3:40 PM, Wendell Silva <silvawp at gmail.com> wrote:
> What BSP are we taking about?
> I've used the configuration bellow to get a "raw mode" in my customized
> pc386 BSP:
> Well, the right way... The code bellow has proved good enough to my needs.
> I guess the only way to avoid this is to implement your own driver (based
> on UART driver) and not register it a termios pseudo-driver for it, but you
> will need to consider ring-buffers, multi-task access, etc.
>
> Does someone have can add comments?
>
>
> ---BEGIN--- [ the control flow (if... else...) was removed for sake of
> simplicity) ]-----
>
> #include <fcntl.h>
> #include <termios.h>
> #include <unistd.h>
>
> struct termios opt;
> int fd = open("/dev/serial0", O_RDWR | O_NOCTTY);
> tcgetattr(fd, &opt)
> cfsetispeed(&opt, B115200);
> cfsetospeed(&opt, B115200);
>
> /*
> * Set options for raw-mode (binary) data transfer over serial
> */
> opt.c_iflag &= ~(IGNBRK | BRKINT | PARMRK |
> ISTRIP | INLCR | IGNCR |
> ICRNL | IXON);
> opt.c_oflag &= ~OPOST;
> opt.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
> opt.c_cflag &= ~(CSIZE | PARENB);
> opt.c_cflag |= CS8;
>
> tcsetattr(fd, TCSANOW, &opt);
>
> ---END---
>
>
>
>
> 2013/12/23 Nicolás Alvarez <nicoalar.22 at gmail.com>
>
>> Hi all,
>>
>> I'm trying to use the raw uart driver interface, but it looks like that
>> the bsp is initializing the console driver. How can I avoid this? I have
>> read that someone use the console driver in "raw mode", is it the right way?
>>
>> Regards,
>>
>> *Ing. Nicolás Alvarez*
>>
>>
>> _______________________________________________
>> rtems-users mailing list
>> rtems-users at rtems.org
>> http://www.rtems.org/mailman/listinfo/rtems-users
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20131223/49c20d13/attachment-0001.html>
More information about the users
mailing list