ChibiOS 21.11.5
Safety Subsystem

HAL Safety Module. More...

Detailed Description

HAL Safety Module.

Collaboration diagram for Safety Subsystem:

Function variants

#define halRegSet8X(p, s, v)
 Sets bits into an 8 bits register.
#define halRegSet16X(p, s, v)
 Sets bits into a 16 bits register.
#define halRegSet32X(p, s, v)
 Sets bits into a 32 bits register.
#define halRegClear8X(p, c, v)
 Clears bits into an 8 bits register.
#define halRegClear16X(p, c, v)
 Clears bits into a 16 bits register.
#define halRegClear32X(p, c, v)
 Clears bits into a 32 bits register.

Macros

#define HAL_US2RTC(freq, usec)
#define HAL_USE_SAFETY   FALSE
 Enables the safety-related features in HAL.

Typedefs

typedef unsigned halcnt_t

Functions

static uint32_t get_frequency (void)
static halcnt_t get_counter (void)
static bool is_counter_within (halcnt_t start, halcnt_t end)
CC_NO_RETURN void halSftFail (const char *message)
 Common safety fault handler.
bool halRegWaitMatch8X (volatile uint8_t *p, uint8_t mask, uint8_t match, uint32_t tmo, uint8_t *valp)
 Waits for masked bits to match or a timeout.
bool halRegWaitMatch16X (volatile uint16_t *p, uint16_t mask, uint16_t match, uint32_t tmo, uint16_t *valp)
 Waits for masked bits to match or a timeout.
bool halRegWaitMatch32X (volatile uint32_t *p, uint32_t mask, uint32_t match, uint32_t tmo, uint32_t *valp)
 Waits for masked bits to match or a timeout.
bool halRegWaitAllSet8X (volatile uint8_t *p, uint8_t mask, uint32_t tmo, uint8_t *valp)
 Waits for all specified bits to be set or a timeout.
bool halRegWaitAllSet16X (volatile uint16_t *p, uint16_t mask, uint32_t tmo, uint16_t *valp)
 Waits for all specified bits to be set or a timeout.
bool halRegWaitAllSet32X (volatile uint32_t *p, uint32_t mask, uint32_t tmo, uint32_t *valp)
 Waits for all specified bits to be set or a timeout.
bool halRegWaitAnySet8X (volatile uint8_t *p, uint8_t mask, uint32_t tmo, uint8_t *valp)
 Waits for any of specified bits to be set or a timeout.
bool halRegWaitAnySet16X (volatile uint16_t *p, uint16_t mask, uint32_t tmo, uint16_t *valp)
 Waits for any of specified bits to be set or a timeout.
bool halRegWaitAnySet32X (volatile uint32_t *p, uint32_t mask, uint32_t tmo, uint32_t *valp)
 Waits for any of specified bits to be set or a timeout.
bool halRegWaitAllClear8X (volatile uint8_t *p, uint8_t mask, uint32_t tmo, uint8_t *valp)
 Waits for all specified bits to be cleared or a timeout.
bool halRegWaitAllClear16X (volatile uint16_t *p, uint16_t mask, uint32_t tmo, uint16_t *valp)
 Waits for all specified bits to be cleared or a timeout.
bool halRegWaitAllClear32X (volatile uint32_t *p, uint32_t mask, uint32_t tmo, uint32_t *valp)
 Waits for all specified bits to be cleared or a timeout.
bool halRegWaitAnyClear8X (volatile uint8_t *p, uint8_t mask, uint32_t tmo, uint8_t *valp)
 Waits for any of specified bits to be cleared or a timeout.
bool halRegWaitAnyClear16X (volatile uint16_t *p, uint16_t mask, uint32_t tmo, uint16_t *valp)
 Waits for any of specified bits to be cleared or a timeout.
bool halRegWaitAnyClear32X (volatile uint32_t *p, uint32_t mask, uint32_t tmo, uint32_t *valp)
 Waits for any of specified bits to be cleared or a timeout.
static void halSftFailOnError (bool result, const char *message)
 Enters a common safety fault handler on error.
static void halRegWrite8X (volatile uint8_t *p, uint8_t value, bool verify)
 Writes an 8 bits register.
static void halRegWrite16X (volatile uint16_t *p, uint16_t value, bool verify)
 Writes a 16 bits register.
static void halRegWrite32X (volatile uint32_t *p, uint32_t value, bool verify)
 Writes a 32 bits register.
static void halRegModify8X (volatile uint8_t *p, uint8_t setmask, uint8_t clrmask, bool verify)
 Modifies a 8 bits register.
static void halRegModify16X (volatile uint16_t *p, uint16_t setmask, uint16_t clrmask, bool verify)
 Modifies a 16 bits register.
static void halRegModify32X (volatile uint32_t *p, uint32_t setmask, uint32_t clrmask, bool verify)
 Modifies a 32 bits register.
static void halRegMaskedWrite8X (volatile uint8_t *p, uint8_t mask, uint8_t value, bool verify)
 Writes a field into an 8 bits register.
static void halRegMaskedWrite16X (volatile uint16_t *p, uint16_t mask, uint16_t value, bool verify)
 Writes a field into a 16 bits register.
static void halRegMaskedWrite32X (volatile uint32_t *p, uint32_t mask, uint32_t value, bool verify)
 Writes a field into a 32 bits register.

Macro Definition Documentation

◆ HAL_US2RTC

◆ HAL_USE_SAFETY

#define HAL_USE_SAFETY   FALSE

Enables the safety-related features in HAL.

Note
Disabling this option saves both code and data space.

Definition at line 41 of file hal_safety.h.

◆ halRegSet8X

#define halRegSet8X ( p,
s,
v )
Value:
halRegModify8X(p, s, (uint8_t)0, v)
static void halRegModify8X(volatile uint8_t *p, uint8_t setmask, uint8_t clrmask, bool verify)
Modifies a 8 bits register.
Definition hal_safety.h:341

Sets bits into an 8 bits register.

Note
There is a strong assumption for memory-mapped I/O, this is not necessarily true on all architectures.
Verification failure results in entering the fault handler.
Parameters
[in]ppointer to the register
[in]smask of bits to be set
[in]vverification flag, register is read back if true, this flag only has effect if HAL_USE_SAFETY is set to TRUE
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 74 of file hal_safety.h.

◆ halRegSet16X

#define halRegSet16X ( p,
s,
v )
Value:
halRegModify16X(p, s, (uint16_t)0, v)
static void halRegModify16X(volatile uint16_t *p, uint16_t setmask, uint16_t clrmask, bool verify)
Modifies a 16 bits register.
Definition hal_safety.h:381

Sets bits into a 16 bits register.

Note
There is a strong assumption for memory-mapped I/O, this is not necessarily true on all architectures.
Verification failure results in entering the fault handler.
Parameters
[in]ppointer to the register
[in]smask of bits to be set
[in]vverification flag, register is read back if true, this flag only has effect if HAL_USE_SAFETY is set to TRUE
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 90 of file hal_safety.h.

◆ halRegSet32X

#define halRegSet32X ( p,
s,
v )
Value:
halRegModify32X(p, s, (uint32_t)0, v)
static void halRegModify32X(volatile uint32_t *p, uint32_t setmask, uint32_t clrmask, bool verify)
Modifies a 32 bits register.
Definition hal_safety.h:421

Sets bits into a 32 bits register.

Note
There is a strong assumption for memory-mapped I/O, this is not necessarily true on all architectures.
Verification failure results in entering the fault handler.
Parameters
[in]ppointer to the register
[in]smask of bits to be set
[in]vverification flag, register is read back if true, this flag only has effect if HAL_USE_SAFETY is set to TRUE
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 106 of file hal_safety.h.

◆ halRegClear8X

#define halRegClear8X ( p,
c,
v )
Value:
halRegModify8X(p, (uint8_t)0, c, v)

Clears bits into an 8 bits register.

Note
There is a strong assumption for memory-mapped I/O, this is not necessarily true on all architectures.
Verification failure results in entering the fault handler.
Parameters
[in]ppointer to the register
[in]cmask of bits to be cleared
[in]vverification flag, register is read back if true, this flag only has effect if HAL_USE_SAFETY is set to TRUE
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 122 of file hal_safety.h.

◆ halRegClear16X

#define halRegClear16X ( p,
c,
v )
Value:
halRegModify16X(p, (uint16_t)0, c, v)

Clears bits into a 16 bits register.

Note
There is a strong assumption for memory-mapped I/O, this is not necessarily true on all architectures.
Verification failure results in entering the fault handler.
Parameters
[in]ppointer to the register
[in]cmask of bits to be cleared
[in]vverification flag, register is read back if true, this flag only has effect if HAL_USE_SAFETY is set to TRUE
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 138 of file hal_safety.h.

◆ halRegClear32X

#define halRegClear32X ( p,
c,
v )
Value:
halRegModify32X(p, (uint32_t)0, c, v)

Clears bits into a 32 bits register.

Note
There is a strong assumption for memory-mapped I/O, this is not necessarily true on all architectures.
Verification failure results in entering the fault handler.
Parameters
[in]ppointer to the register
[in]cmask of bits to be cleared
[in]vverification flag, register is read back if true, this flag only has effect if HAL_USE_SAFETY is set to TRUE
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 154 of file hal_safety.h.

Typedef Documentation

◆ halcnt_t

typedef unsigned halcnt_t

Definition at line 47 of file hal_safety.c.

Function Documentation

◆ get_frequency()

◆ get_counter()

◆ is_counter_within()

◆ halSftFail()

void halSftFail ( const char * message)

Common safety fault handler.

This function does not return, any recovery strategy, at this level, is meant to be destructive.

Parameters
[in]messagefault reason string
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 89 of file hal_safety.c.

References osalSysHalt().

Referenced by halRegMaskedWrite16X(), halRegMaskedWrite32X(), halRegMaskedWrite8X(), halRegModify16X(), halRegModify32X(), halRegModify8X(), halRegWrite16X(), halRegWrite32X(), halRegWrite8X(), and halSftFailOnError().

Here is the call graph for this function:

◆ halRegWaitMatch8X()

bool halRegWaitMatch8X ( volatile uint8_t * p,
uint8_t mask,
uint8_t match,
uint32_t tmo,
uint8_t * valp )

Waits for masked bits to match or a timeout.

Note
The timeout feature only works if the HAL LLD implements the required counter functionality.
Parameters
[in]paddress of the register
[in]maskmask of bits to be checked
[in]matchvalue to be matched
[in]tmotimeout in microseconds
[in]valppointer to where to store the last read value or NULL
Returns
The final result.
Return values
falseif the condition has been verified.
trueif a timeout occurred.
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 116 of file hal_safety.c.

References get_counter(), get_frequency(), HAL_US2RTC, and is_counter_within().

Here is the call graph for this function:

◆ halRegWaitMatch16X()

bool halRegWaitMatch16X ( volatile uint16_t * p,
uint16_t mask,
uint16_t match,
uint32_t tmo,
uint16_t * valp )

Waits for masked bits to match or a timeout.

Note
The timeout feature only works if the HAL LLD implements the required counter functionality.
Parameters
[in]paddress of the register
[in]maskmask of bits to be checked
[in]matchvalue to be matched
[in]tmotimeout in microseconds
[in]valppointer to where to store the last read value or NULL
Returns
The final result.
Return values
falseif the condition has been verified.
trueif a timeout occurred.
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 159 of file hal_safety.c.

References get_counter(), get_frequency(), HAL_US2RTC, and is_counter_within().

Here is the call graph for this function:

◆ halRegWaitMatch32X()

bool halRegWaitMatch32X ( volatile uint32_t * p,
uint32_t mask,
uint32_t match,
uint32_t tmo,
uint32_t * valp )

Waits for masked bits to match or a timeout.

Note
The timeout feature only works if the HAL LLD implements the required counter functionality.
Parameters
[in]paddress of the register
[in]maskmask of bits to be checked
[in]matchvalue to be matched
[in]tmotimeout in microseconds
[in]valppointer to where to store the last read value or NULL
Returns
The final result.
Return values
falseif the condition has been verified.
trueif a timeout occurred.
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 202 of file hal_safety.c.

References get_counter(), get_frequency(), HAL_US2RTC, and is_counter_within().

Here is the call graph for this function:

◆ halRegWaitAllSet8X()

bool halRegWaitAllSet8X ( volatile uint8_t * p,
uint8_t mask,
uint32_t tmo,
uint8_t * valp )

Waits for all specified bits to be set or a timeout.

Note
The timeout feature only works if the HAL LLD implements the required counter functionality.
Parameters
[in]paddress of the register
[in]maskmask of bits to be checked
[in]tmotimeout in microseconds
[in]valppointer to where to store the last read value or NULL
Returns
The final result.
Return values
falseif the condition has been verified.
trueif a timeout occurred.
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 244 of file hal_safety.c.

References get_counter(), get_frequency(), HAL_US2RTC, and is_counter_within().

Here is the call graph for this function:

◆ halRegWaitAllSet16X()

bool halRegWaitAllSet16X ( volatile uint16_t * p,
uint16_t mask,
uint32_t tmo,
uint16_t * valp )

Waits for all specified bits to be set or a timeout.

Note
The timeout feature only works if the HAL LLD implements the required counter functionality.
Parameters
[in]paddress of the register
[in]maskmask of bits to be checked
[in]tmotimeout in microseconds
[in]valppointer to where to store the last read value or NULL
Returns
The final result.
Return values
falseif the condition has been verified.
trueif a timeout occurred.
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 286 of file hal_safety.c.

References get_counter(), get_frequency(), HAL_US2RTC, and is_counter_within().

Here is the call graph for this function:

◆ halRegWaitAllSet32X()

bool halRegWaitAllSet32X ( volatile uint32_t * p,
uint32_t mask,
uint32_t tmo,
uint32_t * valp )

Waits for all specified bits to be set or a timeout.

Note
The timeout feature only works if the HAL LLD implements the required counter functionality.
Parameters
[in]paddress of the register
[in]maskmask of bits to be checked
[in]tmotimeout in microseconds
[in]valppointer to where to store the last read value or NULL
Returns
The final result.
Return values
falseif the condition has been verified.
trueif a timeout occurred.
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 328 of file hal_safety.c.

References get_counter(), get_frequency(), HAL_US2RTC, and is_counter_within().

Here is the call graph for this function:

◆ halRegWaitAnySet8X()

bool halRegWaitAnySet8X ( volatile uint8_t * p,
uint8_t mask,
uint32_t tmo,
uint8_t * valp )

Waits for any of specified bits to be set or a timeout.

Note
The timeout feature only works if the HAL LLD implements the required counter functionality.
Parameters
[in]paddress of the register
[in]maskmask of bits to be checked
[in]tmotimeout in microseconds
[in]valppointer to where to store the last read value or NULL
Returns
The final result.
Return values
falseif the condition has been verified.
trueif a timeout occurred.
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 370 of file hal_safety.c.

References get_counter(), get_frequency(), HAL_US2RTC, and is_counter_within().

Here is the call graph for this function:

◆ halRegWaitAnySet16X()

bool halRegWaitAnySet16X ( volatile uint16_t * p,
uint16_t mask,
uint32_t tmo,
uint16_t * valp )

Waits for any of specified bits to be set or a timeout.

Note
The timeout feature only works if the HAL LLD implements the required counter functionality.
Parameters
[in]paddress of the register
[in]maskmask of bits to be checked
[in]tmotimeout in microseconds
[in]valppointer to where to store the last read value or NULL
Returns
The final result.
Return values
falseif the condition has been verified.
trueif a timeout occurred.
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 412 of file hal_safety.c.

References get_counter(), get_frequency(), HAL_US2RTC, and is_counter_within().

Here is the call graph for this function:

◆ halRegWaitAnySet32X()

bool halRegWaitAnySet32X ( volatile uint32_t * p,
uint32_t mask,
uint32_t tmo,
uint32_t * valp )

Waits for any of specified bits to be set or a timeout.

Note
The timeout feature only works if the HAL LLD implements the required counter functionality.
Parameters
[in]paddress of the register
[in]maskmask of bits to be checked
[in]tmotimeout in microseconds
[in]valppointer to where to store the last read value or NULL
Returns
The final result.
Return values
falseif the condition has been verified.
trueif a timeout occurred.
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 454 of file hal_safety.c.

References get_counter(), get_frequency(), HAL_US2RTC, and is_counter_within().

Here is the call graph for this function:

◆ halRegWaitAllClear8X()

bool halRegWaitAllClear8X ( volatile uint8_t * p,
uint8_t mask,
uint32_t tmo,
uint8_t * valp )

Waits for all specified bits to be cleared or a timeout.

Note
The timeout feature only works if the HAL LLD implements the required counter functionality.
Parameters
[in]paddress of the register
[in]maskmask of bits to be checked
[in]tmotimeout in microseconds
[in]valppointer to where to store the last read value or NULL
Returns
The final result.
Return values
falseif the condition has been verified.
trueif a timeout occurred.
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 496 of file hal_safety.c.

References get_counter(), get_frequency(), HAL_US2RTC, and is_counter_within().

Here is the call graph for this function:

◆ halRegWaitAllClear16X()

bool halRegWaitAllClear16X ( volatile uint16_t * p,
uint16_t mask,
uint32_t tmo,
uint16_t * valp )

Waits for all specified bits to be cleared or a timeout.

Note
The timeout feature only works if the HAL LLD implements the required counter functionality.
Parameters
[in]paddress of the register
[in]maskmask of bits to be checked
[in]tmotimeout in microseconds
[in]valppointer to where to store the last read value or NULL
Returns
The final result.
Return values
falseif the condition has been verified.
trueif a timeout occurred.
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 538 of file hal_safety.c.

References get_counter(), get_frequency(), HAL_US2RTC, and is_counter_within().

Here is the call graph for this function:

◆ halRegWaitAllClear32X()

bool halRegWaitAllClear32X ( volatile uint32_t * p,
uint32_t mask,
uint32_t tmo,
uint32_t * valp )

Waits for all specified bits to be cleared or a timeout.

Note
The timeout feature only works if the HAL LLD implements the required counter functionality.
Parameters
[in]paddress of the register
[in]maskmask of bits to be checked
[in]tmotimeout in microseconds
[in]valppointer to where to store the last read value or NULL
Returns
The final result.
Return values
falseif the condition has been verified.
trueif a timeout occurred.
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 580 of file hal_safety.c.

References get_counter(), get_frequency(), HAL_US2RTC, and is_counter_within().

Here is the call graph for this function:

◆ halRegWaitAnyClear8X()

bool halRegWaitAnyClear8X ( volatile uint8_t * p,
uint8_t mask,
uint32_t tmo,
uint8_t * valp )

Waits for any of specified bits to be cleared or a timeout.

Note
The timeout feature only works if the HAL LLD implements the required counter functionality.
Parameters
[in]paddress of the register
[in]maskmask of bits to be checked
[in]tmotimeout in microseconds
[in]valppointer to where to store the last read value or NULL
Returns
The final result.
Return values
falseif the condition has been verified.
trueif a timeout occurred.
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 622 of file hal_safety.c.

References get_counter(), get_frequency(), HAL_US2RTC, and is_counter_within().

Here is the call graph for this function:

◆ halRegWaitAnyClear16X()

bool halRegWaitAnyClear16X ( volatile uint16_t * p,
uint16_t mask,
uint32_t tmo,
uint16_t * valp )

Waits for any of specified bits to be cleared or a timeout.

Note
The timeout feature only works if the HAL LLD implements the required counter functionality.
Parameters
[in]paddress of the register
[in]maskmask of bits to be checked
[in]tmotimeout in microseconds
[in]valppointer to where to store the last read value or NULL
Returns
The final result.
Return values
falseif the condition has been verified.
trueif a timeout occurred.
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 664 of file hal_safety.c.

References get_counter(), get_frequency(), HAL_US2RTC, and is_counter_within().

Here is the call graph for this function:

◆ halRegWaitAnyClear32X()

bool halRegWaitAnyClear32X ( volatile uint32_t * p,
uint32_t mask,
uint32_t tmo,
uint32_t * valp )

Waits for any of specified bits to be cleared or a timeout.

Note
The timeout feature only works if the HAL LLD implements the required counter functionality.
Parameters
[in]paddress of the register
[in]maskmask of bits to be checked
[in]tmotimeout in microseconds
[in]valppointer to where to store the last read value or NULL
Returns
The final result.
Return values
falseif the condition has been verified.
trueif a timeout occurred.
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 706 of file hal_safety.c.

References get_counter(), get_frequency(), HAL_US2RTC, and is_counter_within().

Here is the call graph for this function:

◆ halSftFailOnError()

void halSftFailOnError ( bool result,
const char * message )
inlinestatic

Enters a common safety fault handler on error.

Note
IF a custom handler is not defined then the default action is to call osalSysHalt().
This function can potentially not return.
Parameters
[in]resultthe error status, true if an error occurred
[in]messagean optional descriptive message
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 214 of file hal_safety.h.

References halSftFail().

Here is the call graph for this function:

◆ halRegWrite8X()

void halRegWrite8X ( volatile uint8_t * p,
uint8_t value,
bool verify )
inlinestatic

Writes an 8 bits register.

Note
This code relies on compiler optimizations, the constant operations that cause no change to the final value are optimized out.
There is a strong assumption for memory-mapped I/O, this is not necessarily true on all architectures.
Verification failure results in entering the fault handler.
Parameters
[in]ppointer to the register
[in]valuevalue to be written
[in]verifyverification flag, register is read back if true, this flag only has effect if HAL_USE_SAFETY is set to TRUE
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 238 of file hal_safety.h.

References halSftFail().

Here is the call graph for this function:

◆ halRegWrite16X()

void halRegWrite16X ( volatile uint16_t * p,
uint16_t value,
bool verify )
inlinestatic

Writes a 16 bits register.

Note
This code relies on compiler optimizations, the constant operations that cause no change to the final value are optimized out.
There is a strong assumption for memory-mapped I/O, this is not necessarily true on all architectures.
Verification failure results in entering the fault handler.
Parameters
[in]ppointer to the register
[in]valuevalue to be written
[in]verifyverification flag, register is read back if true, this flag only has effect if HAL_USE_SAFETY is set to TRUE
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 272 of file hal_safety.h.

References halSftFail().

Here is the call graph for this function:

◆ halRegWrite32X()

void halRegWrite32X ( volatile uint32_t * p,
uint32_t value,
bool verify )
inlinestatic

Writes a 32 bits register.

Note
This code relies on compiler optimizations, the constant operations that cause no change to the final value are optimized out.
There is a strong assumption for memory-mapped I/O, this is not necessarily true on all architectures.
Verification failure results in entering the fault handler.
Parameters
[in]ppointer to the register
[in]valuevalue to be written
[in]verifyverification flag, register is read back if true, this flag only has effect if HAL_USE_SAFETY is set to TRUE
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 306 of file hal_safety.h.

References halSftFail().

Here is the call graph for this function:

◆ halRegModify8X()

void halRegModify8X ( volatile uint8_t * p,
uint8_t setmask,
uint8_t clrmask,
bool verify )
inlinestatic

Modifies a 8 bits register.

Note
This code relies on compiler optimizations, the constant operations that cause no change to the final value are optimized out.
There is a strong assumption for memory-mapped I/O, this is not necessarily true on all architectures.
Verification failure results in entering the fault handler.
Parameters
[in]ppointer to the register
[in]setmaskmask of bits to be set
[in]clrmaskmask of bits to be cleared
[in]verifyverification flag, register is read back if true, this flag only has effect if HAL_USE_SAFETY is set to TRUE
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 341 of file hal_safety.h.

References halSftFail().

Here is the call graph for this function:

◆ halRegModify16X()

void halRegModify16X ( volatile uint16_t * p,
uint16_t setmask,
uint16_t clrmask,
bool verify )
inlinestatic

Modifies a 16 bits register.

Note
This code relies on compiler optimizations, the constant operations that cause no change to the final value are optimized out.
There is a strong assumption for memory-mapped I/O, this is not necessarily true on all architectures.
Verification failure results in entering the fault handler.
Parameters
[in]ppointer to the register
[in]setmaskmask of bits to be set
[in]clrmaskmask of bits to be cleared
[in]verifyverification flag, register is read back if true, this flag only has effect if HAL_USE_SAFETY is set to TRUE
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 381 of file hal_safety.h.

References halSftFail().

Here is the call graph for this function:

◆ halRegModify32X()

void halRegModify32X ( volatile uint32_t * p,
uint32_t setmask,
uint32_t clrmask,
bool verify )
inlinestatic

Modifies a 32 bits register.

Note
This code relies on compiler optimizations, the constant operations that cause no change to the final value are optimized out.
There is a strong assumption for memory-mapped I/O, this is not necessarily true on all architectures.
Verification failure results in entering the fault handler.
Parameters
[in]ppointer to the register
[in]setmaskmask of bits to be set
[in]clrmaskmask of bits to be cleared
[in]verifyverification flag, register is read back if true, this flag only has effect if HAL_USE_SAFETY is set to TRUE
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 421 of file hal_safety.h.

References halSftFail().

Here is the call graph for this function:

◆ halRegMaskedWrite8X()

void halRegMaskedWrite8X ( volatile uint8_t * p,
uint8_t mask,
uint8_t value,
bool verify )
inlinestatic

Writes a field into an 8 bits register.

Note
This code relies on compiler optimizations, the constant operations that cause no change to the final value are optimized out.
There is a strong assumption for memory-mapped I/O, this is not necessarily true on all architectures.
Verification failure results in entering the fault handler.
Parameters
[in]ppointer to the register
[in]maskmask of bits field to be written
[in]valuevalue to be written, must be pre-shifted to match the mask
[in]verifyverification flag, register is read back if true, this flag only has effect if HAL_USE_SAFETY is set to TRUE
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 462 of file hal_safety.h.

References halSftFail(), and osalDbgCheck.

Here is the call graph for this function:

◆ halRegMaskedWrite16X()

void halRegMaskedWrite16X ( volatile uint16_t * p,
uint16_t mask,
uint16_t value,
bool verify )
inlinestatic

Writes a field into a 16 bits register.

Note
This code relies on compiler optimizations, the constant operations that cause no change to the final value are optimized out.
There is a strong assumption for memory-mapped I/O, this is not necessarily true on all architectures.
Verification failure results in entering the fault handler.
Parameters
[in]ppointer to the register
[in]maskmask of bits field to be written
[in]valuevalue to be written, must be pre-shifted to match the mask
[in]verifyverification flag, register is read back if true, this flag only has effect if HAL_USE_SAFETY is set to TRUE
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 507 of file hal_safety.h.

References halSftFail(), and osalDbgCheck.

Here is the call graph for this function:

◆ halRegMaskedWrite32X()

void halRegMaskedWrite32X ( volatile uint32_t * p,
uint32_t mask,
uint32_t value,
bool verify )
inlinestatic

Writes a field into a 32 bits register.

Note
This code relies on compiler optimizations, the constant operations that cause no change to the final value are optimized out.
There is a strong assumption for memory-mapped I/O, this is not necessarily true on all architectures.
Verification failure results in entering the fault handler.
Parameters
[in]ppointer to the register
[in]maskmask of bits field to be written
[in]valuevalue to be written, must be pre-shifted to match the mask
[in]verifyverification flag, register is read back if true, this flag only has effect if HAL_USE_SAFETY is set to TRUE
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 552 of file hal_safety.h.

References halSftFail(), and osalDbgCheck.

Here is the call graph for this function: