|
HomeCore 0.1.3 (07b5544)
Bare-metal personal computer firmware for Cortex-M
|
Board-specific clock policy, pin wiring, console, and panic output. More...
Macros | |
| #define | BOARD_STRINGIFY(x) #x |
Stringify x without macro-expanding it first. | |
| #define | BOARD DT_BOARD_NAME |
Board name string from board.yaml, such as "STM32VLDISCOVERY". | |
Functions | |
| void | board_init (void) |
| Initialize board clocks, pins, and the console UART. | |
| uint32_t | board_cpu_clock_hz (void) |
| Report the core clock frequency. | |
| void | board_uart_putc (char c) |
| Write one byte to the console UART by polling. | |
| int | board_uart_getc (void) |
| Read one byte from the console UART, blocking until one arrives. | |
| int | board_uart_has_data (void) |
| Check without blocking whether the console UART has received data. | |
| void | board_panic (const char *msg) |
| Report a fatal error and halt. | |
Board-specific clock policy, pin wiring, console, and panic output.
Each board implements board_init(), board_cpu_clock_hz(), and board_panic() in src/board/<name>/board.c, and describes its hardware in board.yaml. The board_uart_* functions are implemented once, in src/drivers/console.c, on the console chosen by the description.
| void board_init | ( | void | ) |
Initialize board clocks, pins, and the console UART.
main() calls it once, after soc_init() and before k_init(). The board may call board_panic() if clock setup fails.
| uint32_t board_cpu_clock_hz | ( | void | ) |
Report the core clock frequency.
| void board_uart_putc | ( | char | c | ) |
Write one byte to the console UART by polling.
May block indefinitely. Call from foreground code or the fatal panic path.
| c | Byte to transmit. |
| int board_uart_getc | ( | void | ) |
Read one byte from the console UART, blocking until one arrives.
Call from foreground code only. There is no end-of-file condition.
| int board_uart_has_data | ( | void | ) |
Check without blocking whether the console UART has received data.
| void board_panic | ( | const char * | msg | ) |
Report a fatal error and halt.
Callable from fault handlers. Output is best effort: an early fault may halt silently if the console is not yet initialized. Does not return on hardware.
| msg | NUL-terminated message. The pointer is not retained. |