Debug output driver for ATmega On-Chip UART. More...
Variables | |
| NUTDEVICE | devDebug0 |
| Debug device 0 information structure. | |
| NUTDEVICE | devDebug1 |
| UART 1 Device information structure. | |
Debug output driver for ATmega On-Chip UART.
This stream device driver writes data to the internal UART of the ATmega128/103 chip. The output is unbuffered and uses polling. Therefore it can be used for standard I/O output even within interrupt routines.
{
0,
{'u', 'a', 'r', 't', '0', 0, 0, 0, 0},
0,
0,
0,
0,
0,
DebugInit,
DebugIOCtl,
NULL,
DebugWrite,
DebugWrite_P,
DebugOpen,
DebugClose,
NULL
}
Debug device 0 information structure.
Debug device 0 information structure.
Usually, the device structure is the only public symbol that may be referenced by the application code using
#include <dev/debug.h> { ... NutRegisterDevice(&devDebug0, 0, 0); ... }
If not referenced, the driver code (and this structure) will not be included in the final binary.
The name of the structure may differ among platforms. Portable applications should avoid it and instead make use of dev/board.h.
#include <dev/board.h> { ... NutRegisterDevice(&DEV_DEBUG, 0, 0); ... }
While output is supported by default, input may be not. If input is required, applications may replace DEV_DEBUG by DEV_CONSOLE. In this case the debug driver is selected only, if it has input capability (see NUT_DEV_DEBUG_READ). Otherwise an interrupt driven UART driver will be used.
Note, that this polling driver has certain advantages
but also some disadvantages
When used with Harvard architectures, additional functions may be offered to access data in program space.
{
0,
{'u', 'a', 'r', 't', '1', 0, 0, 0, 0},
0,
0,
0,
0,
0,
DebugInit,
DebugIOCtl,
0,
DebugWrite,
DebugWrite_P,
DebugOpen,
DebugClose,
0
}
UART 1 Device information structure.
Debug device 1 information structure.