mikroSDK Reference Manual
|
Data Structures | |
struct | log_t |
LOG context structure. More... | |
struct | log_cfg_t |
LOG init configuration structure. More... | |
Macros | |
#define | LOG_MAP_USB_UART(cfg) cfg.level = LOG_LEVEL_DEBUG; |
LOG MAP to the USB UART configuration. | |
#define | LOG_MAP_MIKROBUS(cfg, mikrobus) cfg.level = LOG_LEVEL_DEBUG; |
LOG MAP to the MikroBUS configuration. | |
#define | LOG_MAP_USB_UART(cfg) |
LOG MAP to the USB UART configuration NOTE If USB_UART_RX and USB_UART_TX are not defined (defined as HAL_PIN_NC) define them manually. Pins are defined as Pxy where: | |
#define | LOG_MAP_MIKROBUS(cfg, mikrobus) |
LOG MAP to the MikroBUS configuration. | |
Enumerations | |
enum | log_level_t { LOG_LEVEL_DEBUG = 0x00 , LOG_LEVEL_INFO = 0x01 , LOG_LEVEL_WARNING = 0x02 , LOG_LEVEL_ERROR = 0x03 , LOG_LEVEL_FATAL = 0x04 } |
Log level values. | |
enum | log_level_t { LOG_LEVEL_DEBUG = 0x00 , LOG_LEVEL_INFO = 0x01 , LOG_LEVEL_WARNING = 0x02 , LOG_LEVEL_ERROR = 0x03 , LOG_LEVEL_FATAL = 0x04 } |
Log level values. | |
Functions list | |
void | log_init (log_t *log, log_cfg_t *cfg) |
Initializes LOG module. | |
void | log_printf (log_t *log, const code char *__generic_ptr f,...) |
Printf function. | |
void | log_clear (log_t *log) |
Empty wrapper API. | |
int8_t | log_read (log_t *log, uint8_t *rx_data_buf, uint8_t max_len) |
Empty wrapper API. | |
void | log_info (log_t *log, const code char *__generic_ptr f,...) |
INFO printf function. | |
void | log_error (log_t *log, const code char *__generic_ptr f,...) |
ERROR printf function. | |
void | log_fatal (log_t *log, const code char *__generic_ptr f,...) |
FATAL printf function. | |
void | log_debug (log_t *log, const code char *__generic_ptr f,...) |
DEBUG printf function. | |
void | log_warning (log_t *log, const code char *__generic_ptr f,...) |
WARNING printf function. | |
void | log_log (log_t *log, char *prefix, const code char *__generic_ptr f,...) |
Printf function with a variable prefix. | |
#define LOG_MAP_MIKROBUS | ( | cfg, | |
mikrobus ) cfg.level = LOG_LEVEL_DEBUG; |
#define LOG_MAP_MIKROBUS | ( | cfg, | |
mikrobus ) |
#define LOG_MAP_USB_UART | ( | cfg | ) | cfg.level = LOG_LEVEL_DEBUG; |
LOG MAP to the USB UART configuration NOTE If USB_UART_RX and USB_UART_TX are not defined (defined as HAL_PIN_NC) define them manually. Pins are defined as Pxy where:
x
represents port name ( A, B, C ... )y
represents pin ( 1,2,3...15...31 ) Example: #define USB_UART_RX PA14 #define USB_UART_TX PC0 #define LOG_MAP_USB_UART | ( | cfg | ) |
x
represents port name ( A, B, C ... )y
represents pin ( 1,2,3...15...31 ) Example: #define USB_UART_RX PA14 #define USB_UART_TX PC0 void log_clear | ( | log_t * | log | ) |
Discards all characters from the output and input buffer.
[in] | log | LOG context object. |
[in] | log | LOG context object. |
void log_debug | ( | log_t * | log, |
const code char *__generic_ptr | f, | ||
... ) |
This function is used print a message on the std_out terminal. This function uses the prefix [DEBUG] and checks for log level.
[in] | log | LOG context object. |
[in] | *f | pointer to the string |
[in] | ... | Other parameters |
This function uses to be a print message on the UART. This function uses the prefix [DEBUG] and check for log level
[in] | log | LOG context object. |
[in] | *f | pointer to the string |
[in] | ... | Other parameters |
void log_error | ( | log_t * | log, |
const code char *__generic_ptr | f, | ||
... ) |
This function is used print a message on the std_out terminal. This function uses the prefix [ERROR] and checks for log level.
[in] | log | LOG context object. |
[in] | *f | pointer to the string |
[in] | ... | Other parameters |
This function uses to be a print message on the UART. This function uses the prefix [ERROR] and check for log level
[in] | log | LOG context object. |
[in] | *f | pointer to the string |
[in] | ... | Other parameters |
void log_fatal | ( | log_t * | log, |
const code char *__generic_ptr | f, | ||
... ) |
This function is used print a message on the std_out terminal. This function uses the prefix [FATAL] and checks for log level.
[in] | log | LOG context object. |
[in] | *f | pointer to the string |
[in] | ... | Other parameters |
This function uses to be a print message on the UART. This function uses the prefix [FATAL] and check for log level
[in] | log | LOG context object. |
[in] | *f | pointer to the string |
[in] | ... | Other parameters |
void log_info | ( | log_t * | log, |
const code char *__generic_ptr | f, | ||
... ) |
This function is used print a message on the std_out terminal. This function uses the prefix [INFO] and checks for log level.
[in] | log | LOG context object. |
[in] | *f | pointer to the string |
[in] | ... | Other parameters |
This function uses to be a print message on the UART. This function uses the prefix [INFO] and check for log level
[in] | log | LOG context object. |
[in] | *f | pointer to the string |
[in] | ... | Other parameters |
Initializes LOG driver. This function needs to be called before other driver functions.
[in] | log | LOG context object. |
[in] | cfg | LOG configuration structure. |
void log_log | ( | log_t * | log, |
char * | prefix, | ||
const code char *__generic_ptr | f, | ||
... ) |
This function is used print a message on the std_out terminal. This function uses a variable prefix.
[in] | log | LOG context object. |
[in] | prefix | Prefix. |
[in] | *f | pointer to the string |
[in] | ... | Other parameters |
This function uses to be a print message on the UART. This function uses a variable prefix.
[in] | log | LOG context object. |
[in] | prefix | Prefix. |
[in] | *f | pointer to the string |
[in] | ... | Other parameters |
void log_printf | ( | log_t * | log, |
const code char *__generic_ptr | f, | ||
... ) |
This function is used to print a message on the std_out terminal.
[in] | log | LOG context object. |
[in] | *f | pointer to the string |
[in] | ... | Other parameters |
This function uses to be a print message on the UART.
[in] | log | LOG context object. |
[in] | *f | pointer to the string |
[in] | ... | Other parameters |
int8_t log_read | ( | log_t * | log, |
uint8_t * | rx_data_buf, | ||
uint8_t | max_len ) |
Reads at most size
bytes of data from the device into buffer
.
[in] | log | LOG context object. |
[out] | rx_data_buf | Array to place read data in. |
[in] | max_len | Maximal length |
void log_warning | ( | log_t * | log, |
const code char *__generic_ptr | f, | ||
... ) |
This function is used print a message on the std_out terminal. This function uses the prefix [WARNING] and checks for log level.
[in] | log | LOG context object. |
[in] | *f | pointer to the string |
[in] | ... | Other parameters |
This function uses to be a print message on the UART. This function uses the prefix [WARNING] and check for log level
[in] | log | LOG context object. |
[in] | *f | pointer to the string |
[in] | ... | Other parameters |