BEEP-8 SDK 1.0.0
|
System utility functions for the BEEP-8 system. More...
#include <b8/type.h>
Go to the source code of this file.
Macros | |
#define | B8_SYS_ASSERT(expr_, comment_) |
Assert macro for system checks. | |
Functions | |
void | b8SysHalt (void) |
Halt the system. | |
void | b8SysReset (void) |
Reset the system. | |
void | b8SysPuts (const char *str) |
Output a string. | |
void | b8SysPutHex (u32 data) |
Output a hexadecimal number. | |
void | b8SysPutNum (s32 data) |
Output a decimal number. | |
void | b8SysPutCR (void) |
Output a carriage return. | |
u32 | b8SysGetCpuClock (void) |
Get the CPU clock speed. | |
int | b8SysSetupIrqWait (u32 irq) |
Set up an IRQ wait handler. | |
int | b8SysIrqWait (u32 irq) |
Wait for an IRQ. | |
System utility functions for the BEEP-8 system.
This file provides various system utility functions and macros for the BEEP-8 system. It includes functions for system halt, reset, outputting strings and numbers, and handling interrupts.
Functions provided:
b8SysHalt
: Halt the systemb8SysReset
: Reset the systemb8SysPuts
: Output a stringb8SysPutHex
: Output a hexadecimal numberb8SysPutNum
: Output a decimal numberb8SysPutCR
: Output a carriage returnb8SysGetCpuClock
: Get the CPU clock speedb8SysSetupIrqWait
: Set up an IRQ wait handlerb8SysIrqWait
: Wait for an IRQThese functions are intended for use under special conditions, such as in the bootloader, operating system, or for handling exceptional halts. They should not be used in regular application code.
#define B8_SYS_ASSERT | ( | expr_, | |
comment_ ) |
Assert macro for system checks.
This macro checks the given expression and if it evaluates to false, it outputs an assertion message and halts the system.
expr_ | The expression to evaluate. |
comment_ | A custom comment to include in the assertion message. |
|
extern |
Get the CPU clock speed.
This function returns the current CPU clock speed.
|
extern |
Halt the system.
This function outputs a halt message and then halts the system.
|
extern |
Wait for an IRQ.
This function waits for the specified IRQ to occur.
irq | The IRQ number to wait for. |
|
extern |
Output a carriage return.
This function outputs a newline character to the system console.
|
extern |
Output a hexadecimal number.
This function outputs the given 32-bit hexadecimal number to the system console.
data | The hexadecimal number to output. |
|
extern |
Output a decimal number.
This function outputs the given 32-bit decimal number to the system console.
data | The decimal number to output. |
|
extern |
Output a string.
This function outputs the given string to the system console.
str | The string to output. |
|
extern |
Reset the system.
This function resets the system by calling the b8rst
function.
|
extern |
Set up an IRQ wait handler.
This function sets up an IRQ wait handler for the specified IRQ.
irq | The IRQ number to set up. |