Nut/OS  4.10.3
API Reference
AT91 Debug Device

Debug output driver for AT91 On-Chip UART. More...

Collaboration diagram for AT91 Debug Device:


uint32_t At91BaudRateDiv (uint32_t baud)
 Calculate divisor for a given baud rate.
int At91DevDebugIOCtl (NUTDEVICE *dev, int req, void *conf)
 Handle I/O controls for debug device 2.
int At91DevDebugWrite (NUTFILE *fp, CONST void *buffer, int len)
 Send characters to debug device 0.
NUTFILEAt91DevDebugOpen (NUTDEVICE *dev, CONST char *name, int mode, int acc)
 Open debug device.
int At91DevDebugClose (NUTFILE *fp)
 Close debug device.

Detailed Description

Debug output driver for AT91 On-Chip UART.

This stream device driver writes data to the internal UART. The output is unbuffered and uses polling. Therefore it can be used for standard I/O output even within interrupt routines.

Function Documentation

uint32_t At91BaudRateDiv ( uint32_t  baud)

Calculate divisor for a given baud rate.

baudBaud rate.
Calculated divisor.

Definition at line 64 of file debug_at91.c.

References NUT_HWCLK_PERIPHERAL, and NutClockGet.

Referenced by At91DevDebugIOCtl().

int At91DevDebugIOCtl ( NUTDEVICE dev,
int  req,
void *  conf 

Handle I/O controls for debug device 2.

The debug device supports UART_SETSPEED only.

0 on success, -1 otherwise.

Definition at line 76 of file debug_at91.c.

References At91BaudRateDiv(), _NUTDEVICE::dev_base, outr, UART_SETSPEED, and US_BRGR_OFF.

Here is the call graph for this function:

int At91DevDebugWrite ( NUTFILE fp,
CONST void *  buffer,
int  len 

Send characters to debug device 0.

A newline character will be automatically prepended by a carriage return.

Number of characters sent.

Definition at line 109 of file debug_at91.c.

References CONST, and _NUTFILE::nf_dev.

NUTFILE* At91DevDebugOpen ( NUTDEVICE dev,
CONST char *  name,
int  mode,
int  acc 

Open debug device.

Pointer to a static NUTFILE structure.

Definition at line 195 of file debug_at91.c.

References _NUTDEVICE::dev_dcb, _NUTFILE::nf_dev, _NUTFILE::nf_fcb, and _NUTFILE::nf_next.

int At91DevDebugClose ( NUTFILE fp)

Close debug device.

Always 0.

Definition at line 211 of file debug_at91.c.