[En-Nut-Discussion] serial UART outpuit / printf

Hugo Simon hugo.simon at gmx.de
Wed Oct 5 17:37:47 CEST 2005


Hi,

as JP said the third parameter must be a pointer, too. Unsigned long works
for me.
I never used parity, so I don't know if '0' is right. If you did not set
anything except baud you get 8,n,1. Try it if the code below does not work.

So you have to code

u_long baud=9600;
u_long stopbits=1;
u_long databits=8;
u_long parity=0;

NutRegisterDevice(&devUart0, 0, 0);
NutRegisterDevice(&devEth0, 0, 0);

rs232 = fopen("uart0", "w");

_ioctl(_fileno(rs232), UART_SETSPEED, &baud);
_ioctl(_fileno(rs232), UART_SETSTOPBITS, &stopbits);
_ioctl(_fileno(rs232), UART_SETDATABITS, &databits);
_ioctl(_fileno(rs232), UART_SETPARITY, &parity);

fprintf(rs232,"\nUART open:\n");





More information about the En-Nut-Discussion mailing list