# drivers/console/debug.c File Reference

Debug console implementation. More...

`#include <debug.h>`
`#include <console/core.h>`
`#include <console/serial.h>`

Include dependency graph for debug.c:

Go to the source code of this file.

## Functions
int | dbg_priv_vprintf (const char *format, va_list ap)
| Formatted output conversion to the debug console.
int | dbg_priv_printf (const char *format,...)
| Formatted output conversion to the debug console.
int | dbg_priv_putstr (const char *str)
| Write a string to the debug console.
int | dbg_priv_putchar (int c)
| Write a single character to the debug console.
void | dbg_init (void)
| Initialize the debug console.
## Variables
static struct console | debug_console
| The debug console.

## Detailed Description

Debug console implementation.

This file implements a simple debug console which can be used to dump information over a serial line when debugging a new application or driver.

- Compiler: IAR EWAVR32 and GNU GCC for AVR32
- Supported devices: All devices
- AppNote:

Author:
  Atmel Corporation: http://www.atmel.com
  Support and FAQ: http://support.atmel.no/

Definition in file debug.c.

## Function Documentation

void dbg_init | ( | void |  | ) |

Initialize the debug console.

This function must be called before any of the other debug console functions may be called. If the debug console is disabled, this function does nothing.

Definition at line 130 of file debug.c.

References debug_console, serial_console_init(), and SERIAL_ENABLE_TX.

Here is the call graph for this function:

int dbg_priv_printf | ( | const char * | format,
|  |  | ... |
| ) |  |  |

Formatted output conversion to the debug console.

For internal use only.

Produce output according to format on the debug console. format is interpreted as a regular printf()-style format string with a few limitations (some specifiers are accepted but ignored.)

Parameters:

  | format | Format specification.

Returns:
  The number of characters printed.

Definition at line 85 of file debug.c.

References dbg_priv_vprintf().

Here is the call graph for this function:

int dbg_priv_putchar | ( | int | c | ) |

Write a single character to the debug console.

For internal use only.

Parameters:

  | c | The character to write.

Returns:
  c as an unsigned char cast to an int.

Definition at line 118 of file debug.c.

References console_putchar(), and debug_console.

Here is the call graph for this function:

int dbg_priv_putstr | ( | const char * | str | ) |

Write a string to the debug console.

For internal use only.

Parameters:

  | str | NUL-terminated string.

Returns:
  The number of characters written.

Definition at line 105 of file debug.c.

References console_putstr(), and debug_console.

Here is the call graph for this function:

int dbg_priv_vprintf | ( | const char * | format,
|  | va_list | ap |
| ) |  |  |

Formatted output conversion to the debug console.

For internal use only.

Produce output according to format on the debug console. format is interpreted as a regular printf()-style format string with a few limitations (some specifiers are accepted but ignored.)

Parameters:

  | format | Format specification.
  | ap | Format arguments.

Returns:
  The number of characters printed.

Definition at line 68 of file debug.c.

References console_vprintf(), and debug_console.

Referenced by dbg_priv_printf().

Here is the call graph for this function:

## Variable Documentation

struct console debug_console`[static]`

The debug console.

For internal use only.

Definition at line 53 of file debug.c.

Referenced by dbg_init(), dbg_priv_putchar(), dbg_priv_putstr(), and dbg_priv_vprintf().