Sapphire SoC DS Sapphire SoC UG Sapphire HP SoC DS Sapphire HP SoC UG RISC-V Embedded IDE UG Board Support Package
Loading...
Searching...
No Matches
debug.h File Reference
#include <stdio.h>
#include "userDef.h"

Go to the source code of this file.

Overview

DEBUG driver API definitions.

Author
Efinix Inc

This file provides data structures and APIs for debug, logging and assertion.

Definition in file debug.h.

Macros

#define BSP_ASSERT(cond, msg)
#define LOG_INFO(debug, fmt, ...)
#define LOG_WARN(debug, fmt, ...)
#define LOG_ERR(debug, fmt, ...)
ANSI Colors

ANSI Escape codes for colored terminal output.

#define ANSI_RESET   "\033[0m"
 Reset to default color.
#define ANSI_RED   "\033[31m"
 Red Text.
#define ANSI_GREEN   "\033[32m"
 Green Text.
#define ANSI_YELLOW   "\033[33m"
 Yellow Text.
#define ANSI_BLUE   "\033[34m"
 Blue Text.
#define ANSI_MAGENTA   "\033[35m"
 Magenta Text.
#define ANSI_CYAN   "\033[36m"
 Cyan Text.
#define ANSI_BOLD   "\033[1m"
 Bold Text.
#define ANSI_UNDER   "\033[4m"
 Underlined Text.
Debug Modules

Bitmasks to enable logging for specific peripherals.

Note
Combine these using OR | operator in ACTIVE_DEBUG_MOD.
#define DBG_MOD_SYS   (1 << 0)
 System / Core.
#define DBG_MOD_IRQ   (1 << 1)
 Interrupt Controller.
#define DBG_MOD_FAULT   (1 << 2)
 Hard Faults / Errors.
#define DBG_MOD_UART   (1 << 3)
 UART Driver.
#define DBG_MOD_I2C   (1 << 4)
 I2C Driver.
#define DBG_MOD_SPI   (1 << 5)
 SPI Driver.
#define DBG_MOD_SPI_FLASH   (1 << 6)
 SPI Flash Driver.
#define DBG_MOD_RTC   (1 << 7)
 Real Time Clock.
#define DBG_MOD_CAM   (1 << 8)
 Camera.
#define DBG_MOD_SENSOR   (1 << 9)
 External Sensors.
#define DBG_MOD_ALL
 Enable ALL debug modules.
Debug Levels

Verbosity levels for logging.

Note
Set ACTIVE_MIN_LVL in userDef.h to one of these values.
#define DBG_LVL_ALL   0
 Print Everything (Info, Warn, Error).
#define DBG_LVL_WARN   1
 Print Warning and Error only.
#define DBG_LVL_ERR   2
 Print Error only.
#define DBG_LVL_NONE   3
 Silence (No output).

Functions

void bsp_putChar (char c)

Function Documentation

◆ bsp_putChar()

void bsp_putChar ( char c)
extern