OPTIGA Trust M  1.1.0
C++ library for Optiga Trust M Chip Security Controller
pal_os_event_arduino.cpp File Reference

This file implements the platform abstraction layer APIs for os event/scheduler. More...

#include <Arduino.h>
#include "pal_os_event.h"
#include "pal_os_event_timer.h"
#include "../simple_timer/SimpleTimer.h"
Include dependency graph for pal_os_event_arduino.cpp:
LIBRARY_EXPORTS pal_os_event_tpal_os_event_create (register_callback callback, void *callback_args)
 Create an os event. More...
 
LIBRARY_EXPORTS void pal_os_event_destroy (pal_os_event_t *pal_os_event)
 Destroys an os event. More...
 
LIBRARY_EXPORTS void pal_os_event_register_callback_oneshot (pal_os_event_t *p_pal_os_event, register_callback callback, void *callback_args, uint32_t time_us)
 Callback registration function to trigger once when timer expires. More...
 
void pal_os_event_trigger_registered_callback (void)
 Timer callback handler. More...
 
LIBRARY_EXPORTS void pal_os_event_start (pal_os_event_t *p_pal_os_event, register_callback callback, void *callback_args)
 Start an os event. More...
 
LIBRARY_EXPORTS void pal_os_event_stop (pal_os_event_t *p_pal_os_event)
 Stops an os event. More...
 
LIBRARY_EXPORTS void pal_os_event_process (void)
 

Detailed Description

This file implements the platform abstraction layer APIs for os event/scheduler.

Copyright (c) 2019 Infineon Technologies AG

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE

\endcopyright

Author
Infineon Technologies AG

Function Documentation

◆ pal_os_event_create()

LIBRARY_EXPORTS pal_os_event_t* pal_os_event_create ( register_callback  callback,
void *  callback_args 
)

Create an os event.

Starts an OS event.

Precondition
  • None
Note
  • None
Parameters
[in]callbackCallback function to be registered internally
[in]callback_argsArguement to be passed to registered callback
Here is the call graph for this function:

◆ pal_os_event_destroy()

LIBRARY_EXPORTS void pal_os_event_destroy ( pal_os_event_t pal_os_event)

Destroys an os event.

Starts an OS event.

Precondition
  • None
Note
  • None
Parameters
[in]pal_os_eventpal_os_event to be destroyed

◆ pal_os_event_process()

LIBRARY_EXPORTS void pal_os_event_process ( void  )

◆ pal_os_event_register_callback_oneshot()

LIBRARY_EXPORTS void pal_os_event_register_callback_oneshot ( pal_os_event_t p_pal_os_event,
register_callback  callback,
void *  callback_args,
uint32_t  time_us 
)

Callback registration function to trigger once when timer expires.

Platform specific event call back registration function to trigger once when timer expires.

  • This function registers the callback function supplied by the caller.
  • It triggers a timer with the supplied time interval in microseconds.
  • Once the timer expires, the registered callback function gets called.
Precondition
  • None
Note
  • None
Parameters
[in]p_pal_os_eventPointer to pal_os_event
[in]callbackCallback function pointer
[in]callback_argsCallback arguments
[in]time_ustime in micro seconds to trigger the call back

◆ pal_os_event_start()

LIBRARY_EXPORTS void pal_os_event_start ( pal_os_event_t p_pal_os_event,
register_callback  callback,
void *  callback_args 
)

Start an os event.

Starts an OS event.

Precondition
  • None
Note
  • None
Parameters
[in]p_pal_os_eventPointer to os event
[in]callbackCallback function to be registered internally
[in]callback_argsArguement to be passed to registered callback
Here is the call graph for this function:

◆ pal_os_event_stop()

LIBRARY_EXPORTS void pal_os_event_stop ( pal_os_event_t p_pal_os_event)

Stops an os event.

Stops an OS event.

Precondition
  • None
Note
  • None
Parameters
[in]p_pal_os_eventPointer to os event

◆ pal_os_event_trigger_registered_callback()

void pal_os_event_trigger_registered_callback ( void  )

Timer callback handler.

Timer callback handler.

  • This gets called from the TIMER elapse event.
  • Once the timer expires, the registered callback function gets called from the timer event handler, if the call back is not NULL.
Precondition
  • None
Note
  • None