NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
Loading...
Searching...
No Matches
neorv32_aux.c File Reference

General auxiliary functions source file. More...

#include <neorv32.h>

Functions

uint64_t neorv32_aux_date2unixtime (date_t *date)
 
void neorv32_aux_unixtime2date (uint64_t unixtime, date_t *date)
 
uint64_t neorv32_aux_hexstr2uint64 (char *buffer, unsigned int length)
 
uint32_t neorv32_aux_xorshift32 (void)
 
void neorv32_aux_itoa (char *buffer, uint32_t num, uint32_t base)
 

Detailed Description

General auxiliary functions source file.

See also
https://stnolting.github.io/neorv32/sw/files.html

Function Documentation

◆ neorv32_aux_date2unixtime()

uint64_t neorv32_aux_date2unixtime ( date_t * date)

Convert date to Unix time stamp.

Parameters
[in]datePointer to date and time struct (date_t).
Returns
Unix time since 00:00:00 UTC, January 1, 1970 in seconds.

◆ neorv32_aux_hexstr2uint64()

uint64_t neorv32_aux_hexstr2uint64 ( char * buffer,
unsigned int length )

Helper function to convert up to 16 hex chars string into uint64_t

Parameters
[in,out]bufferPointer to array of chars to convert into number.
[in]lengthLength of the conversion string.
Returns
Converted number (uint64_t).

◆ neorv32_aux_itoa()

void neorv32_aux_itoa ( char * buffer,
uint32_t num,
uint32_t base )

Simplified version of "itoa": convert number to string.

Parameters
[in,out]bufferPointer to array for the result string [33 chars].
[in]numNumber to convert.
[in]baseBase of number representation (2..16).

◆ neorv32_aux_unixtime2date()

void neorv32_aux_unixtime2date ( uint64_t unixtime,
date_t * date )

Convert Unix time stamp to date.

Parameters
[in]unixtimeUnix time since 00:00:00 UTC, January 1, 1970 in seconds.
[in,out]datePointer to date and time struct (date_t).

◆ neorv32_aux_xorshift32()

uint32_t neorv32_aux_xorshift32 ( void )

XORSHIFT pseudo random number generator.

Returns
Random number (uint32_t).