XDK API  3.6.0
Documentation
BCDS_HAL_Mutex.h File Reference

API to support Mutual Exclusion to protect a code segments in HAL and BSPs. More...

#include "BCDS_Basics.h"
#include "BCDS_Assert.h"
+ Include dependency graph for BCDS_HAL_Mutex.h:
#define HAL_MUTEX_UNINITIALIZED   NULL
 
typedef void * HAL_Mutex_T
 
typedef Retcode_T(* HAL_Mutex_Hook_T )(HAL_Mutex_T *mutex)
 
Retcode_T HAL_Mutex_SetHooks (HAL_Mutex_Hook_T lockHook, HAL_Mutex_Hook_T unlockHook)
 a function to set RTOS hooks More...
 
Retcode_T HAL_Mutex_Lock (HAL_Mutex_T *mutex)
 Lock the HAL mutex. More...
 
Retcode_T HAL_Mutex_Unlock (HAL_Mutex_T *mutex)
 Unlock the HAL mutex. More...
 

Detailed Description

The original state of the mutex is unlocked.

Note
This mutex must not be used in the ISR context.

By default, the mutex functions are empty because the mutex is only needed if the RTOS is active. In this case, RTOS hooks should be set using the function HAL_Lock_SetHooks() to provide a proper mutex implementation.

Macro Definition Documentation

#define HAL_MUTEX_UNINITIALIZED   NULL

Typedef Documentation

typedef Retcode_T(* HAL_Mutex_Hook_T)(HAL_Mutex_T *mutex)
typedef void* HAL_Mutex_T

Function Documentation

Retcode_T HAL_Mutex_Lock ( HAL_Mutex_T mutex)
Return values
RETCODE_OKwhen successful
RETCODE_NULL_POINTERwhen HAL_Mutex_SetHooks() is not initialized.
Retcode_T HAL_Mutex_SetHooks ( HAL_Mutex_Hook_T  lockHook,
HAL_Mutex_Hook_T  unlockHook 
)

If an RTOS is used, then hooks should be set to provide proper mutex functions based on RTOS mechanisms such as mutexSemaphores.

Parameters
[in]lockHookthe hook for the lock function
[in]unlockHookthe hook for the unlock function
Return values
RETCODE_OKwhen successful
RETCODE_NULL_POINTERwhen any one of the param has been NULL
Note
a new wait Function Hook must implement a initialization or the used resource at first call
Retcode_T HAL_Mutex_Unlock ( HAL_Mutex_T mutex)
Return values
RETCODE_OKwhen successful
RETCODE_NULL_POINTERwhen HAL_Mutex_SetHooks() is not initialized.

All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:48 by doxygen 1.8.8