[En-Nut-Discussion] uart configuration

Arnfinn Aas Eielsen eielsen at gmail.com
Mon Jul 11 18:38:51 CEST 2005


Hello,

I did it like this:

#include <dev/usartavr.h>
[...]
int main(void)
{
	[...]
	NutRegisterDevice(&devUsartAvr0, 0, 0);
	freopen("uart0", "r", stdin);
     	freopen("uart0", "w", stdout);
	unsigned long baud = 115200;
	_ioctl(_fileno(stdin), UART_SETSPEED, &baud);
	_ioctl(_fileno(stdout), UART_SETSPEED, &baud);
	fprintf(stdout, "stdout is routed here...\n");
	[...]
}

Don't know if you (and I :)) need both the _ioctl() calls...

And I had to check the jumper configurations, so that the lines were 
connected to the D-Sub plug, I found this in the Hardware Manual that 
came along with the card...

Hope it helps...

Arnfinn

På 11. jul. 2005 kl. 18.06 skrev ChouK:

>
> hi,
>
> i try to configure the uart0 of my ethernut card 2.1b as input and 
> output for the rs232 . how can i do this?
>
> Please help me, that made three days that I test and that I don't find 
> the solution.
>
> Thanks for any answers
>
> Nicolas
>
> 		
> ---------------------------------
>  Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! 
> Messenger
>  Téléchargez le ici !
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
>




More information about the En-Nut-Discussion mailing list