<div dir="ltr">What BSP are we taking about?<div>I've used the configuration bellow to get a "raw mode" in my customized pc386 BSP:</div><div>Well, the right way... The code bellow has proved good enough to my needs. <br>
</div><div style>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.</div>
<div style><br></div><div style>Does someone have can add comments?</div><div style><br></div><div style><br></div><div style>---BEGIN--- [ the control flow (if... else...) was removed for sake of simplicity) ]-----</div>
<div style><br></div><div style><div><font face="courier new, monospace"><div>#include <fcntl.h></div><div>#include <termios.h></div><div>#include <unistd.h></div><div><br></div></font></div><div><font face="courier new, monospace">struct termios opt;</font></div>
<div><font face="courier new, monospace">int fd = open("/dev/serial0", O_RDWR | O_NOCTTY);</font></div><div><font face="courier new, monospace">tcgetattr(fd, &opt)</font></div><div><font face="courier new, monospace">cfsetispeed(&opt, B115200);<br>
</font></div><div><font face="courier new, monospace">cfsetospeed(&opt, B115200);</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">/*</font></div><div><font face="courier new, monospace"> * Set options for raw-mode (binary) data transfer over serial</font></div>
<div><font face="courier new, monospace"> */</font></div><div><span style="font-family:'courier new',monospace">opt.c_iflag &= ~(IGNBRK | BRKINT | PARMRK |</span><br></div><div><font face="courier new, monospace"> ISTRIP | INLCR | IGNCR |</font></div>
<div><font face="courier new, monospace"> ICRNL | IXON);</font></div><div><font face="courier new, monospace">opt.c_oflag &= ~OPOST;</font></div><div><font face="courier new, monospace">opt.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);</font></div>
<div><font face="courier new, monospace">opt.c_cflag &= ~(CSIZE | PARENB);</font></div><div><font face="courier new, monospace">opt.c_cflag |= CS8;</font></div><div><font face="courier new, monospace"><br></font></div>
<div><font face="courier new, monospace">tcsetattr(fd, TCSANOW, &opt);</font></div><div><br></div><div style>---END---</div><div style><br></div></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
2013/12/23 Nicolás Alvarez <span dir="ltr"><<a href="mailto:nicoalar.22@gmail.com" target="_blank">nicoalar.22@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi all,<div><br></div><div>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?</div>
<div><br></div><div>Regards,</div><div><br></div><div><div><b>Ing. Nicolás Alvarez</b><div><div><span style="line-height:15px;color:rgb(85,85,85);font-size:13px;font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif"><br>
</span></div></div></div>
</div></div>
<br>_______________________________________________<br>
rtems-users mailing list<br>
<a href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a><br>
<a href="http://www.rtems.org/mailman/listinfo/rtems-users" target="_blank">http://www.rtems.org/mailman/listinfo/rtems-users</a><br>
<br></blockquote></div><br></div>