#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <types.h>
#include <timer.h>
#include <sys-uart.h>
#include "xformat.h"
Go to the source code of this file.
|
| #define | LOG_LEVEL_MUTE 0 |
| |
| #define | LOG_LEVEL_ERROR 1 |
| |
| #define | LOG_LEVEL_WARNING 2 |
| |
| #define | LOG_LEVEL_INFO 3 |
| |
| #define | LOG_LEVEL_DEBUG 4 |
| |
| #define | LOG_LEVEL_TRACE 5 |
| |
| #define | LOG_LEVEL_BACKTRACE 6 |
| |
| #define | LOG_LEVEL_DEFAULT LOG_LEVEL_INFO |
| |
| #define | printk_trace(fmt, ...) ((void) 0) |
| |
| #define | printk_debug(fmt, ...) ((void) 0) |
| |
| #define | printk_info(fmt, ...) printk(LOG_LEVEL_INFO, fmt, ##__VA_ARGS__) |
| |
| #define | printk_warning(fmt, ...) printk(LOG_LEVEL_WARNING, fmt, ##__VA_ARGS__) |
| |
| #define | printk_error(fmt, ...) printk(LOG_LEVEL_ERROR, fmt, ##__VA_ARGS__) |
| |
|
| void | set_timer_count () |
| | Set timer count.
|
| |
| void | printk (int level, const char *fmt,...) |
| | Print message to kernel log.
|
| |
| void | uart_printf (const char *fmt,...) |
| | Print message via UART.
|
| |
| int | printf (const char *fmt,...) |
| | Print message via UART.
|
| |
| void | dump_hex (uint32_t start_addr, uint32_t count) |
| | Dumps memory content in hexadecimal format.
|
| |
◆ LOG_LEVEL_BACKTRACE
| #define LOG_LEVEL_BACKTRACE 6 |
◆ LOG_LEVEL_DEBUG
| #define LOG_LEVEL_DEBUG 4 |
◆ LOG_LEVEL_DEFAULT
◆ LOG_LEVEL_ERROR
| #define LOG_LEVEL_ERROR 1 |
◆ LOG_LEVEL_INFO
◆ LOG_LEVEL_MUTE
◆ LOG_LEVEL_TRACE
| #define LOG_LEVEL_TRACE 5 |
◆ LOG_LEVEL_WARNING
| #define LOG_LEVEL_WARNING 2 |
◆ printk_debug
| #define printk_debug |
( |
|
fmt, |
|
|
|
... |
|
) |
| ((void) 0) |
◆ printk_error
◆ printk_info
◆ printk_trace
| #define printk_trace |
( |
|
fmt, |
|
|
|
... |
|
) |
| ((void) 0) |
◆ printk_warning
◆ dump_hex()
Dumps memory content in hexadecimal format.
This function dumps the content of memory starting from the specified address in hexadecimal format. It prints the hexadecimal values of memory contents and ASCII characters corresponding to printable characters.
- Parameters
-
| start_addr | The starting address of the memory region to dump. |
| count | The number of bytes to dump. |
◆ printf()
| int printf |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| |
Print message via UART.
This function is used to print formatted message to the terminal via UART serial port.
- Parameters
-
| fmt | Format string describing the format of the message to print. |
| ... | Variable argument list used to fill placeholders in the format string. |
- Note
- This function is typically used in embedded systems for debugging and outputting system status information.
◆ printk()
| void printk |
( |
int |
level, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |
Print message to kernel log.
This function is used to print the message with specified level to the kernel log.
- Parameters
-
| level | Information level, typically used to specify the importance or type of the message. |
| fmt | Format string describing the format of the message to print. |
| ... | Variable argument list used to fill placeholders in the format string. |
- Note
- This function should be used within the kernel to record important system information or debug messages.
◆ set_timer_count()
Set timer count.
This function is used to set the count value of the timer.
- Note
- Before calling this function, timer-related hardware configuration should be initialized.
Set timer count.
This function calls the frequency detection routine and initializes the timestamp based on the current time in microseconds.
◆ uart_printf()
| void uart_printf |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| |
Print message via UART.
This function is used to print formatted message to the terminal via UART serial port.
- Parameters
-
| fmt | Format string describing the format of the message to print. |
| ... | Variable argument list used to fill placeholders in the format string. |
- Note
- This function is typically used in embedded systems for debugging and outputting system status information.