Sound Byte Libs
0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
log_output.hpp
Go to the documentation of this file.
1
/**
2
* @file log_output.hpp
3
* @brief Log sinks over the debug UART
4
* @ingroup hal
5
*
6
* Sinks for the logger and the fault handlers (the sink contract is in
7
* <sbl/common/log/sink.hpp>): a type with `static void write(const char*)`.
8
* They sit here, with the driver they write through, so that common/log
9
* includes nothing above it.
10
*/
11
12
#ifndef SBL_HW_HAL_UART_LOG_OUTPUT_HPP_
13
#define SBL_HW_HAL_UART_LOG_OUTPUT_HPP_
14
15
#include <sbl/hw/driver/uart.hpp>
16
17
namespace
sbl::uart
{
18
19
/** Writes to Uart<0>, the debug UART, through its TX ring buffer. */
20
struct
LogOutput
{
21
static
void
write(
const
char
* str) { sbl::driver::Uart<>::write_string(str); }
22
};
23
24
/**
25
* Writes to the debug UART by polling: no ring buffer, and it works with
26
* interrupts off. The sink for fault and panic handlers (SBL_FAULT_OUTPUT).
27
*/
28
struct
FaultOutput
{
29
static
void
write(
const
char
* str) { sbl::driver::Uart<>::write_string_polling(str); }
30
};
31
32
}
// namespace sbl::uart
33
34
#endif
// SBL_HW_HAL_UART_LOG_OUTPUT_HPP_
sbl::uart
Standard baud rates for UART communication.
Definition
driver.hpp:35
sbl::uart::FaultOutput
Definition
log_output.hpp:28
sbl::uart::LogOutput
Definition
log_output.hpp:20
src
sbl
hw
hal
uart
log_output.hpp
Generated by
1.9.8