btnut/btnode/include/suart/btn-suart.h File Reference
Software UART device driver.
- Martin Hinz <email@example.com>
This driver uses an internal counter to produce and read the UART bit stream connected to the pin defined in the btn-hardware.h file. Only low bauds are working reliable (2400baud till 9600baud) because for every bit an interrupt handle has to be called. Interrupts can not be executed if the system is already in a interrupt handle but timing is very important for this driver.
Read and write at the same time is not possible because both use the same internal counter.
See hardware header file btn-hardware.h for connection.
- The NutOS sets threads to sleep if the output buffer is full!
Use this driver like the hardware uart of the nutos:
(default baud is set to 9600)
long sbaud = 2400;
NutRegisterDevice(&S_UART, 0, 0);
uarts = fopen(S_UART.dev_name, "r+");
_ioctl(_fileno(uarts), UART_SETSPEED, &sbaud);
#define ||S_UART devUsartAvrS|
Generated on Wed Apr 29 11:12:29 2009 for BTnut System Software by