![]() |
NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
|
RISC-V semihosting header file. More...
#include <stdint.h>
Go to the source code of this file.
Enumerations | |
Host service request IDs | |
See https://developer.arm.com/documentation/dui0203/j/semihosting/semihosting-operations for the description. | |
enum | NEORV32_SEMIHOSTING_SYS_enum { SEMIHOSTING_SYS_OPEN = 0x01 , SEMIHOSTING_SYS_CLOSE = 0x02 , SEMIHOSTING_SYS_WRITEC = 0x03 , SEMIHOSTING_SYS_WRITE0 = 0x04 , SEMIHOSTING_SYS_WRITE = 0x05 , SEMIHOSTING_SYS_READ = 0x06 , SEMIHOSTING_SYS_READC = 0x07 , SEMIHOSTING_SYS_ISTTY = 0x09 , SEMIHOSTING_SYS_SEEK = 0x0A , SEMIHOSTING_SYS_FLEN = 0x0C , SEMIHOSTING_SYS_TMPNAME = 0x0D , SEMIHOSTING_SYS_REMOVE = 0x0E , SEMIHOSTING_SYS_RENAME = 0x0F , SEMIHOSTING_SYS_CLOCK = 0x10 , SEMIHOSTING_SYS_TIME = 0x11 , SEMIHOSTING_SYS_SYSTEM = 0x12 , SEMIHOSTING_SYS_ERRNO = 0x13 , SEMIHOSTING_SYS_GET_CMDLINE = 0x15 , SEMIHOSTING_SYS_HEAPINFO = 0x16 , SEMIHOSTING_SYS_EXCEPTION = 0x18 , SEMIHOSTING_SYS_ELLAPSED = 0x30 , SEMIHOSTING_SYS_TICKFREQ = 0x31 } |
Functions | |
int | neorv32_semihosting_req (int id, void *arg) |
Prototypes | |
void | neorv32_semihosting_putc (char c) |
void | neorv32_semihosting_puts (const char *pnt) |
char | neorv32_semihosting_getc (void) |
int | neorv32_semihosting_open (char *path, int mode) |
int | neorv32_semihosting_close (int file) |
int | neorv32_semihosting_write (int file, char *buffer, int len) |
int | neorv32_semihosting_read (int file, char *buffer, int len) |
int | neorv32_semihosting_istty (int file) |
int | neorv32_semihosting_seek (int file, int pos) |
int | neorv32_semihosting_flen (int file) |
int | neorv32_semihosting_time (void) |
int | neorv32_semihosting_system (char *cmd) |
RISC-V semihosting header file.
int neorv32_semihosting_close | ( | int | file | ) |
Close file on host system.
[in] | file | File handle. |
int neorv32_semihosting_flen | ( | int | file | ) |
Returns the length of a specified file.
[in] | file | File handle. |
char neorv32_semihosting_getc | ( | void | ) |
Read single character from host's STDIN.
int neorv32_semihosting_istty | ( | int | file | ) |
Checks if a host file is connected to an interactive device.
[in] | file | File handle. |
int neorv32_semihosting_open | ( | char * | path, |
int | mode ) |
Open file on host system.
[in] | path | Path/file name (zero-terminated string). |
[in] | mode | File access mode (ISO C). |
void neorv32_semihosting_putc | ( | char | c | ) |
Print single character to host's STDOUT.
[in] | c | Character to print. |
void neorv32_semihosting_puts | ( | const char * | pnt | ) |
Print zero-terminated string to host's STDOUT.
[in] | pnt | Pointer to zero-terminated string. |
int neorv32_semihosting_read | ( | int | file, |
char * | buffer, | ||
int | len ) |
Read data buffer from host's file handle.
[in] | file | File handle (stream; should be 0 = STDIN). |
[in] | buffer | Pointer to data buffer. |
[in] | len | Length of data to read. |
|
inline |
Send a semihosting request to the host.
[in] | id | Service request ID (NEORV32_SEMIHOSTING_SYS_enum). |
[in] | arg | Argument / pointer to data array. |
int neorv32_semihosting_seek | ( | int | file, |
int | pos ) |
Seeks to a specified position in a file.
[in] | file | File handle. |
[in] | pos | Offset specified from the start of the file |
int neorv32_semihosting_system | ( | char * | cmd | ) |
Execute command in host's console.
[in] | cmd | Pointer to zero-terminated command string. |
int neorv32_semihosting_time | ( | void | ) |
Get host's current system time.
int neorv32_semihosting_write | ( | int | file, |
char * | buffer, | ||
int | len ) |
Write data buffer to host's file handle.
[in] | file | File handle (stream; should be 1 = STDOUT). |
[in] | buffer | Pointer to data buffer. |
[in] | len | Length of data to write. |