ODeV framework  v2
Macros | Functions
sysdebug.h File Reference

Debug Log. More...

#include <stdint.h>
#include "sysdebug_config.h"
+ Include dependency graph for sysdebug.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SYS_DBG_LEVEL_ALL   0x00
 All debug message are sent to the debug channel. More...
 
#define SYS_DBG_LEVEL_VERBOSE   0x01
 A general message for system developers.
 
#define SYS_DBG_LEVEL_LLA   0x02
 A message for system developers generated by a Low Level API function.
 
#define SYS_DBG_LEVEL_SL   0x03
 A message for system developers generated by a Service Layer function.
 
#define SYS_DBG_LEVEL_DEFAULT   0x04
 A message generated by application code.
 
#define SYS_DBG_LEVEL_WARNING   0x05
 A message generated when a minor error occurs. The system is probably able to auto-recovers.
 
#define SYS_DBG_LEVEL_SEVERE   0x06
 A message generated when a critical error occurs. The system probably hangs.
 
#define SYS_DBG_ON   0x80U
 Flag for SYS_DEBUGF control byte to enable the debug message for that module.
 
#define SYS_DBG_OFF   0x00U
 Flag for SYS_DEBUGF control byte to disable the debug message for that module.
 
#define SYS_DBG_HALT   0x08U
 Flag for SYS_DEBUGF control byte to halt after printing a debug message for that module.
 

Functions

int SysDebugHardwareInit ()
 
int SysDebugInit ()
 
void SysDebugStartRunTimeStatsTimer ()
 
void SysDebugToggleLed (uint8_t nLed)
 
void SysDebugLedOn (uint8_t nLed)
 
void SysDebugLedOff (uint8_t nLed)
 

Detailed Description

Debug Log.

Author
STMicroelectronics - ST-Korea - MCD Team
Version
1.2.0
Date
Oct 10, 2016 This file implement a set of macro in order to provide a simple way to create a log when the application is compiled in DEBUG.
Attention

© COPYRIGHT 2016 STMicroelectronics

Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at:

   http://www.st.com/software_license_agreement_liberty_v2

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Macro Definition Documentation

◆ SYS_DBG_LEVEL_ALL

#define SYS_DBG_LEVEL_ALL   0x00

All debug message are sent to the debug channel.

The lower three bits of the debug control byte specifies debug level according to the following convention:

  • 0 all
  • 1 verbose: a general message for system developers.
  • 2 low level api: a message for system developers generated by a Low Level API function.
  • 3 service layer: a message for system developers generated by a Service Layer function.
  • 4 default: a message generated by application code.
  • 5 warning: a message generated when a minor error occurs. The system is probably able to auto-recovers.
  • 6 severe: a message generated when a critical error occurs. The system probably hangs.

Function Documentation

◆ SysDebugHardwareInit()

int SysDebugHardwareInit ( )

Initialize the hardware of the debug communication port.

Returns
0 if success, an error code otherwise.

◆ SysDebugInit()

int SysDebugInit ( )

Initialize the debug support.

Returns
0 if success, an error code otherwise.

◆ SysDebugLedOff()

void SysDebugLedOff ( uint8_t  nLed)

Set low a PIN used as test point.

Parameters
nLed[IN] specifies the PIN number (stating from 0).

◆ SysDebugLedOn()

void SysDebugLedOn ( uint8_t  nLed)

Set high a PIN used as test point.

Parameters
nLed[IN] specifies the PIN number (stating from 0).

◆ SysDebugStartRunTimeStatsTimer()

void SysDebugStartRunTimeStatsTimer ( )

Enable the IRQ for the timer used as timebase in order to compute the FreeRTOS statistics about the MCU usage on per task basis.

◆ SysDebugToggleLed()

void SysDebugToggleLed ( uint8_t  nLed)

Toggle a PIN used as test point.

Parameters
nLed[IN] specifies the PIN number (stating from 0).