CPU Core API#
CPU_BREAK()#
Description#
Creates a software-generated CPU break.
Files#
cpu.h/cpu_core.c
Prototype#
CPU_BREAK()
Arguments#
None.
Returned Value#
None.
Notes / Warnings#
None.
CPU_CntLeadZeros()#
Description#
Counts the number of contiguous, most-significant, leading zero bits in a data value. Dispatches the call to the proper CPU_CntLeadZeros??()
implementation according to the size of CPU_DATA
.
Files#
cpu.h/cpu_core.c
Prototype#
CPU_DATA CPU_CntLeadZeros (CPU_DATA val)
Arguments#
val
Data value to count the number of leading zero bits.
Returned Value#
Number of contiguous, most-significant, leading zero bits in 'val', if NO error(s). DEF_INT_CPU_U_MAX_VAL
, otherwise.
Notes / Warnings#
For more information, see
CPU_CntLeadZeros()
function header comment block incpu_core.c
.
CPU_CntLeadZeros08()#
Description#
Counts the number of contiguous, most-significant, leading zero bits in an 8-bit data value.
Files#
cpu.h/cpu_core.c
Prototype#
CPU_DATA CPU_CntLeadZeros08 (CPU_INT08U val)
Arguments#
val
Data value to count the number of leading zero bits.
Returned Value#
Number of contiguous, most-significant, leading zero bits in 'val'.
Notes / Warnings#
For more information, see
CPU_CntLeadZeros08()
function header comment block incpu_core.c
.
CPU_CntLeadZeros16()#
Description#
Counts the number of contiguous, most-significant, leading zero bits in a 16-bit data value.
Files#
cpu.h/cpu_core.c
Prototype#
CPU_DATA CPU_CntLeadZeros16 (CPU_INT16U val)
Arguments#
val
Data value to count the number of leading zero bits.
Returned Value#
Number of contiguous, most-significant, leading zero bits in 'val'.
Notes / Warnings#
For more information, see
CPU_CntLeadZeros16()
function header comment block incpu_core.c
.
CPU_CntLeadZeros32()#
Description#
Counts the number of contiguous, most-significant, leading zero bits in a 32-bit data value.
Files#
cpu.h/cpu_core.c
Prototype#
CPU_DATA CPU_CntLeadZeros32 (CPU_INT32U val)
Arguments#
val
Data value to count the number of leading zero bits.
Returned Value#
Number of contiguous, most-significant, leading zero bits in 'val
'.
Notes / Warnings#
For more information, see
CPU_CntLeadZeros32()
function header comment block incpu_core.c
.
CPU_CntLeadZeros64()#
Description#
Counts the number of contiguous, most-significant, leading zero bits in a 64-bit data value.
Files#
cpu.h/cpu_core.c
Prototype#
CPU_DATA CPU_CntLeadZeros64 (CPU_INT64U val)
Arguments#
val
Data value to count the number of leading zero bits.
Returned Value#
Number of contiguous, most-significant, leading zero bits in 'val
'.
Notes / Warnings#
For more information, see
CPU_CntLeadZeros64()
function header comment block incpu_core.c
.
CPU_CntTrailZeros()#
Description#
Counts the number of contiguous, least-significant, trailing zero bits in a data value. This function dispatches the call to the proper CPU_CntTrailZeros??()
implementation according to the size of CPU_DATA
.
Files#
cpu.h/cpu_core.c
Prototype#
CPU_DATA CPU_CntTrailZeros (CPU_DATA val)
Arguments#
val
Data value to count the number of trailing zero bits.
Returned Value#
Number of contiguous, least-significant, trailing zero bits in 'val
'.
Notes / Warnings#
For more information, see
CPU_CntTrailZeros()
function header comment block incpu_core.c
.
CPU_CntTrailZeros08()#
Description#
Counts the number of contiguous, least-significant, trailing zero bits in an 8-bit data value.
Files#
cpu.h/cpu_core.c
Prototype#
CPU_DATA CPU_CntTrailZeros08 (CPU_INT08U val)
Arguments#
val
Data value to count the number of trailing zero bits.
Returned Value#
Number of contiguous, least-significant, trailing zero bits in 'val
'.
Notes / Warnings#
For more information, see
CPU_CntTrailZeros08()
function header comment block incpu_core.c
.
CPU_CntTrailZeros16()#
Description#
Counts the number of contiguous, least-significant, trailing zero bits in a 16-bit data value.
Files#
cpu.h/cpu_core.c
Prototype#
CPU_DATA CPU_CntTrailZeros16 (CPU_INT16U val)
Arguments#
val
Data value to count the number of trailing zero bits.
Returned Value#
Number of contiguous, least-significant, trailing zero bits in 'val
'.
Notes / Warnings#
For more information, see
CPU_CntTrailZeros16()
function header comment block incpu_core.c
.
CPU_CntTrailZeros32()#
Description#
Counts the number of contiguous, least-significant, trailing zero bits in a 32-bit data value.
Files#
cpu.h/cpu_core.c
Prototype#
CPU_DATA CPU_CntTrailZeros32 (CPU_INT32U val)
Arguments#
val
Data value to count the number of trailing zero bits.
Returned Value#
Number of contiguous, least-significant, trailing zero bits in 'val
'.
Notes / Warnings#
For more information, see
CPU_CntTrailZeros32()
function header comment block incpu_core.c
.
CPU_CntTrailZeros64()#
Description#
Counts the number of contiguous, least-significant, trailing zero bits in a 64-bit data value.
Files#
cpu.h/cpu_core.c
Prototype#
CPU_DATA CPU_CntTrailZeros64 (CPU_INT64U val)
Arguments#
val
Data value to count the number of trailing zero bits.
Returned Value#
Number of contiguous, least-significant, trailing zero bits in 'val
'.
Notes / Warnings#
For more information, see
CPU_CntTrailZeros64()
function header comment block incpu_core.c
.
CPU_Init()#
Description#
Initializes the CPU module :
Initialize the CPU timestamps.
Initialize the CPU interrupts disabled time measurements.
Initialize the CPU host name.
Initialize the CPU cache management.
Initialize the CPU interrupt management.
Files#
cpu.h/cpu_core.c
Prototype#
void CPU_Init (void)
Arguments#
None.
Returned Value#
None.
Notes / Warnings#
CPU_Init()
MUST be called :a. ONLY ONCE from a product's application.
b. BEFORE product's application calls any core CPU module function.
The following initialization functions MUST be sequenced as follows :
a.
CPU_TS_Init()
SHOULD precede ALL calls to other CPU timestamp functions.b.
CPU_IntDisMeasInit()
SHOULD precede ALL calls toCPU_CRITICAL_ENTER()
/CPU_CRITICAL_EXIT()
and other CPU interrupts disabled time measurement functions.c.
CPU_IntInit()
SHOULD precede ALL calls to other CPU interrupt management functions.
CPU_NameClr()#
Description#
Clears the CPU Name.
Files#
cpu.h/cpu_core.c
Prototype#
void CPU_NameClr (void)
Arguments#
None.
Returned Value#
None.
Notes / Warnings#
None.
CPU_NameGet()#
Description#
Gets the CPU host name.
Files#
cpu.h/cpu_core.c
Prototype#
void CPU_NameGet (CPU_CHAR *p_name,
RTOS_ERR *p_err)
Arguments#
p_name
Pointer to an ASCII character array that will receive the return CPU host.
p_err
Pointer to the variable that will receive one of the following error code(s) from this function:
RTOS_ERR_NONE
Returned Value#
None.
Notes / Warnings#
The size of the ASCII character array that will receive the return CPU host name ASCII string :
a. MUST be greater than or equal to the current CPU host name's ASCII string size, including the terminating NULL character.
b. SHOULD be greater than or equal to
CPU_CFG_NAME_SIZE
.
CPU_NameSet()#
Description#
Sets the CPU host name.
Files#
cpu.h/cpu_core.c
Prototype#
void CPU_NameSet (const CPU_CHAR *p_name,
RTOS_ERR *p_err)
Arguments#
p_name
Pointer to a CPU host name to set.
p_err
Pointer to the variable that will receive one of the following error code(s) from this function:
RTOS_ERR_NONE
RTOS_ERR_INVALID_ARG
Returned Value#
None.
Notes / Warnings#
The 'p_name' ASCII string size, including the terminating NULL character, MUST be less than or equal to
CPU_CFG_NAME_SIZE
.
CPU_PopCnt32()#
Description#
Calculates the population count (hamming weight) for value (number of bits set).
Files#
cpu.h/cpu_core.c
Prototype#
CPU_INT08U CPU_PopCnt32 (CPU_INT32U value)
Arguments#
value
Value upon which to calculate the population.
Returned Value#
The value's population count.
Notes / Warnings#
This algorithm is taken from the Hamming Weight. For more information on the Hamming Weight, see Wikipedia .
CPU_SW_EXCEPTION()#
Description#
Trap unrecoverable software exception.
Files#
cpu.h/cpu_core.c
Prototype#
CPU_SW_EXCEPTION (CPU_DATA err_rtn_val)
Arguments#
err_rtn_val
Error type and/or value of the calling function to return.
Returned Value#
None.
Notes / Warnings#
For more information, see
CPU_SW_EXCEPTION()
function header comment block in cpu.h.
CPU_TS32_to_uSec()#
Description#
Converts a 32-bit CPU timestamp from timer counts to microseconds.
Files#
cpu.h/cpu_core.c
Prototype#
CPU_INT64U CPU_TS32_to_uSec(CPU_TS32 ts_cnts)
Arguments#
ts_cnts
CPU timestamp (in timestamp timer counts).
Returned Value#
Converted CPU timestamp (in microseconds).
Notes / Warnings#
For more information, see
CPU_TS32_to_uSec()
function header comment block incpu_core.c
.
CPU_TS64_to_uSec()#
Description#
Converts a 64-bit CPU timestamp from timer counts to microseconds.
Files#
cpu.h/cpu_core.c
Prototype#
CPU_INT64U CPU_TS64_to_uSec(CPU_TS64 ts_cnts)
Arguments#
ts_cnts
CPU timestamp (in timestamp timer counts).
Returned Value#
Converted CPU timestamp (in microseconds).
Notes / Warnings#
For more information, see
CPU_TS64_to_uSec()
function header comment block in cpu_core.c.
CPU_TS_Get32()#
Description#
Gets the current 32-bit CPU timestamp.
Files#
cpu.h/cpu_core.c
Prototype#
CPU_TS32 CPU_TS_Get32 (void)
Arguments#
None.
Returned Value#
Current 32-bit CPU timestamp (in timestamp timer counts).
Notes / Warnings#
For more information, see
CPU_TS_Get32()
function header comment block incpu_core.c
.
CPU_TS_Get64()#
Description#
Gets the current 64-bit CPU timestamp.
Files#
cpu.h/cpu_core.c
Prototype#
CPU_TS64 CPU_TS_Get64 (void)
Arguments#
None.
Returned Value#
Current 64-bit CPU timestamp (in timestamp timer counts).
Notes / Warnings#
For more information, see
CPU_TS_Get64()
function header comment block incpu_core.c
.
CPU_TS_TmrFreqGet()#
Description#
Gets the CPU timestamp's timer frequency.
Files#
cpu.h/cpu_core.c
Prototype#
CPU_TS_TMR_FREQ CPU_TS_TmrFreqGet (RTOS_ERR *p_err)
Arguments#
p_err
Pointer to the variable that will receive one of the following error code(s) from this function:
RTOS_ERR_NONE
RTOS_ERR_INVALID_CFG
Returned Value#
CPU timestamp's timer frequency (in Hertz), if NO error(s). 0, otherwise.
Notes / Warnings#
None.
CPU_TS_TmrFreqSet()#
Description#
Sets the CPU timestamp's timer frequency.
Files#
cpu.h/cpu_core.c
Prototype#
void CPU_TS_TmrFreqSet (CPU_TS_TMR_FREQ freq_hz)
Arguments#
freq_hz
Frequency to set for CPU timestamp's timer (in Hertz).
Returned Value#
None.
Notes / Warnings#
For more information, see
CPU_TS_TmrFreqSet()
function header comment block incpu_core.c
.
CPU_TS_Update()#
Description#
Updates the current CPU timestamp(s).
Files#
cpu.h/cpu_core.c
Prototype#
void CPU_TS_Update (void)
Arguments#
None.
Returned Value#
None.
Notes / Warnings#
For more information, see
CPU_TS_Update()
function header comment block incpu_core.c
.