hsw-nbt 1.2.0
OPTIGA Authenticate NBT Host Library for C
Data Fields | Related Symbols
ifx_timer_t Struct Reference

Generic struct for joinable timers. More...

#include <infineon/ifx-timer.h>

Data Fields

void * _start
 Private member for start of timer as void* to be as generic as possible.
 
uint64_t _duration
 Private member for duration of timer in [us].
 

Related Symbols

(Note that these are not member symbols.)

ifx_status_t ifx_timer_set (ifx_timer_t *timer, uint64_t time_us)
 Sets Timer for given amount of [us].
 
bool ifx_timer_has_elapsed (const ifx_timer_t *timer)
 Checks if Timer has elapsed.
 
ifx_status_t ifx_timer_join (const ifx_timer_t *timer)
 Waits for Timer to finish.
 
void ifx_timer_destroy (ifx_timer_t *timer)
 Frees memory associated with Timer object (but not object itself).
 

Detailed Description

Generic struct for joinable timers.

Definition at line 47 of file ifx-timer.h.

Friends And Related Symbol Documentation

◆ ifx_timer_destroy()

void ifx_timer_destroy ( ifx_timer_t * timer)
related

Frees memory associated with Timer object (but not object itself).

Timer objects may contain dynamically allocated data that needs special functionality to be freed. Users would need to know the concrete type based on the linked implementation. This would negate all benefits of having a generic interface. Calling this function will ensure that all dynamically allocated members have been freed.

Parameters
[in]timerTimer object whose data shall be freed.

◆ ifx_timer_has_elapsed()

bool ifx_timer_has_elapsed ( const ifx_timer_t * timer)
related

Checks if Timer has elapsed.

Per definition timers that have not previously been set are considered elapsed.

Parameters
[in]timerTimer object to be checked.
Returns
bool true if timer has elapsed.

◆ ifx_timer_join()

ifx_status_t ifx_timer_join ( const ifx_timer_t * timer)
related

Waits for Timer to finish.

Parameters
[in]timerTimer to be joined (wait until finished).
Returns
ifx_status_t IFX_SUCCESS if successful, any other value in case of error.

◆ ifx_timer_set()

ifx_status_t ifx_timer_set ( ifx_timer_t * timer,
uint64_t time_us )
related

Sets Timer for given amount of [us].

Parameters
[in]timerTimer object to be set.
[in]time_usus Timer duration in [us].
Returns
ifx_status_t IFX_SUCCESS if successful, any other value in case of error.

Field Documentation

◆ _duration

uint64_t ifx_timer_t::_duration

Private member for duration of timer in [us].

Set by ifx_timer_set(), do NOT set manually!

Definition at line 62 of file ifx-timer.h.

◆ _start

void* ifx_timer_t::_start

Private member for start of timer as void* to be as generic as possible.

Set by ifx_timer_set(), do NOT set manually!

Definition at line 55 of file ifx-timer.h.


The documentation for this struct was generated from the following file: