RV32 SoC DS UG
High-Perf RV32 SoC DS UG
RV64 SoC DS UG API and Examples
Embedded IDE UG
Loading...
Searching...
No Matches
API Functions

Overview

Board Support Package API functions.

Macros

#define bsp_uDelay(usec)
 Microsecond delay function using CLINT timer.
#define bsp_putChar(c)
 Map standard character output to the physical UART.
#define bsp_getChar()
 Map standard character input to the physical UART.

Functions

void bsp_init ()
 Initialize Board Support Package Peripherals.

Macro Definition Documentation

◆ bsp_getChar

#define bsp_getChar ( )

#include <bsp.h>

Value:
uart_instance_t uart0
Primary UART instance for standard I/O mapping.
Definition bsp.c:4
u32 uart_read(uart_instance_t *inst)
Read 32-bit UART data.
Definition uart.c:43

Map standard character input to the physical UART.

Note
If hardware UART is present, these macros will use the uart_read functions to perform I/O through the physical UART. If hardware UART is not present, these macros will be defined as safe dummy macros that do nothing return 0 (for getChar).
It is recommended to use standard scanf for better functionality and compatibility with the C library, which are also mapped to the physical UART if it exists.

Definition at line 103 of file bsp.h.

◆ bsp_putChar

#define bsp_putChar ( c)

#include <bsp.h>

Value:
void uart_write(uart_instance_t *inst, char data)
Writes a single character to the UART data register.
Definition uart.c:49

Map standard character output to the physical UART.

Note
If hardware UART is present, these macros will use the uart_write functions to perform I/O through the physical UART. If hardware UART is not present, these macros will be defined as safe dummy macros that do nothing (for putChar).
It is recommended to use standard printf for better functionality and compatibility with the C library, which are also mapped to the physical UART if it exists.

Definition at line 95 of file bsp.h.

◆ bsp_uDelay

#define bsp_uDelay ( usec)

#include <bsp.h>

Value:
clint_uDelay(usec, SYSTEM_CLINT_HZ)
void clint_uDelay(u32 usec, u32 hz)
This function introduces a microsecond delay using the CLINT TIME register.
Definition clint.c:64

Microsecond delay function using CLINT timer.

Definition at line 84 of file bsp.h.

Function Documentation

◆ bsp_init()

void bsp_init ( )

#include <bsp.h>

Initialize Board Support Package Peripherals.

Definition at line 6 of file bsp.c.