Nut/OS  4.10.3
API Reference
debug_lpc2xxx.c File Reference
#include <string.h>
#include <arch/arm/lpc2xxx.h>
#include <dev/debug.h>
#include <sys/device.h>
#include <sys/file.h>
Include dependency graph for debug_lpc2xxx.c:

Go to the source code of this file.

Functions

int DebugIOCtl (NUTDEVICE *dev, int req, void *conf)
 Handle I/O controls for debug device.
int DebugInit (NUTDEVICE *dev)
 Initialize debug device.
void DebugPut0 (char ch)
 Send a single character to debug device 0.
void DebugPut1 (char ch)
 Send a single character to debug device 1.
int DebugWrite (NUTFILE *fp, CONST void *buffer, int len)
 Send characters to debug device.
NUTFILEDebugOpen (NUTDEVICE *dev, CONST char *name, int mode, int acc)
 Open debug device.
int DebugClose (NUTFILE *fp)
 Close debug device.

Variables

NUTDEVICE devDebug0
 Debug device 0 information structure.
NUTDEVICE devDebug1
 Debug device 1 information structure.

Function Documentation

int DebugIOCtl ( NUTDEVICE dev,
int  req,
void *  conf 
)

Handle I/O controls for debug device.

The debug device doesn't support any.

Returns:
Always -1.

Definition at line 57 of file debug_lpc2xxx.c.

int DebugInit ( NUTDEVICE dev)

Initialize debug device.

Simply enable the device. 115.2 kBaud at 14.7456 MHz.

Returns:
Always 0.

Definition at line 69 of file debug_lpc2xxx.c.

References _BV, and _NUTDEVICE::dev_name.

void DebugPut0 ( char  ch)

Send a single character to debug device 0.

A carriage return character will be automatically appended to any linefeed.

Definition at line 101 of file debug_lpc2xxx.c.

Referenced by DebugWrite().

void DebugPut1 ( char  ch)

Send a single character to debug device 1.

A carriage return character will be automatically appended to any linefeed.

Definition at line 117 of file debug_lpc2xxx.c.

Referenced by DebugWrite().

int DebugWrite ( NUTFILE fp,
CONST void *  buffer,
int  len 
)

Send characters to debug device.

A carriage return character will be automatically appended to any linefeed.

Returns:
Number of characters sent.

Definition at line 135 of file debug_lpc2xxx.c.

References CONST, DebugPut0(), DebugPut1(), _NUTDEVICE::dev_name, and _NUTFILE::nf_dev.

Here is the call graph for this function:

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

Open debug device.

Returns:
Pointer to a static NUTFILE structure.

Definition at line 157 of file debug_lpc2xxx.c.

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

int DebugClose ( NUTFILE fp)

Close debug device.

Returns:
Always 0.

Definition at line 171 of file debug_lpc2xxx.c.