![]() |
Energy Micro IEC60355 Library Project 1.037 GCC-Version
IEC60355 Library documentation and API
|
The CPU register test checks the functionality of the CPUs registers. More...
|
Defines | |
| #define | TestClear 0x00000000 |
| ordered register test states to verify all tests are done after the CPU register POST test or determine the test which fails (order from LSB up) | |
| #define | TestState_r0 0x00000010 |
| #define | TestState_r1r7 0x00000020 |
| #define | TestState_r8r12 0x00000040 |
| #define | TestStateMSP 0x00000100 |
| #define | TestStatePSP 0x00000200 |
| #define | TestStateLR 0x00000400 |
| #define | TestStateAPSR 0x00000800 |
| #define | TestStatePRIMASK 0x00001000 |
| #define | TestStateFAULTMASK 0x00002000 |
| #define | TestStateBASEPRI 0x00004000 |
Functions | |
| void | ASMCPUregTestPOST (void) |
| private IEC607335 CPU register test POST (Pre-Operation Self Test) consecutive test of all registers in assembler | |
| void | ASMCPUregTestLOW (void) |
| private IEC607335 CPU register test Low-range registers tests r0-r7 | |
| void | ASMCPUregTestHIGH (void) |
| private IEC607335 CPU register test Mid-range registers tests r8-r12 | |
| void | ASMCPUregTestSP (void) |
| private IEC607335 CPU register test Stack pointer registers tests MSP,PSP | |
| void | ASMCPUregTestSPEC (void) |
| private IEC607335 CPU register test Other special register tests | |
| testResult_t | IEC60335_ClassB_CPUregTest_BIST (void) |
| public IEC607335 CPU register test BIST (Build in Self Test) consecutive test of all registers in assembler are called | |
| testResult_t | IEC60335_ClassB_CPUregTest_POST (void) |
| public IEC607335 CPU register test POST (Pre-Operation Self Test) consecutive test of all registers in assembler are called | |
Variables | |
| IEC60335_CPUreg_struct | IEC60335_CPUregTestPOST |
| IEC60335_CPUreg_struct | IEC60335_CPUregTestBIST |
The CPU register test checks the functionality of the CPUs registers.
POST and BIST tests are available. The register test is realized in assembler
language to ensure direct access to all register. This tests are compiler coded specific according to their mnemonics.
Selecting the correct assembler source is necessary for compilation.
| #define TestClear 0x00000000 |
ordered register test states to verify all tests are done after the CPU register POST test or determine the test which fails (order from LSB up)
default test mask
Definition at line 49 of file iec60335_class_b_cpureg_test.h.
| #define TestState_r0 0x00000010 |
R0 register test mask
Definition at line 50 of file iec60335_class_b_cpureg_test.h.
| #define TestState_r1r7 0x00000020 |
R8..R7 register test mask
Definition at line 51 of file iec60335_class_b_cpureg_test.h.
| #define TestState_r8r12 0x00000040 |
R8..R12 register test mask
Definition at line 52 of file iec60335_class_b_cpureg_test.h.
| #define TestStateAPSR 0x00000800 |
APSR register test mask
Definition at line 56 of file iec60335_class_b_cpureg_test.h.
| #define TestStateBASEPRI 0x00004000 |
BASEPRI register test mask
Definition at line 59 of file iec60335_class_b_cpureg_test.h.
| #define TestStateFAULTMASK 0x00002000 |
FAULTMASK register test mask
Definition at line 58 of file iec60335_class_b_cpureg_test.h.
| #define TestStateLR 0x00000400 |
LR register test mask
Definition at line 55 of file iec60335_class_b_cpureg_test.h.
| #define TestStateMSP 0x00000100 |
MSP register test mask
Definition at line 53 of file iec60335_class_b_cpureg_test.h.
| #define TestStatePRIMASK 0x00001000 |
PRIMASK register test mask
Definition at line 57 of file iec60335_class_b_cpureg_test.h.
| #define TestStatePSP 0x00000200 |
PSP register test mask
Definition at line 54 of file iec60335_class_b_cpureg_test.h.
| void ASMCPUregTestHIGH | ( | void | ) |
private IEC607335 CPU register test Mid-range registers tests r8-r12
r8-r12 test with pattern comparison
| void ASMCPUregTestLOW | ( | void | ) |
private IEC607335 CPU register test Low-range registers tests r0-r7
r0 register test block r1-r7 test with pattern comparison
| void ASMCPUregTestPOST | ( | void | ) |
private IEC607335 CPU register test POST (Pre-Operation Self Test) consecutive test of all registers in assembler
| void ASMCPUregTestSP | ( | void | ) |
private IEC607335 CPU register test Stack pointer registers tests MSP,PSP
MSP register tests r/w r13, MSR and MRS
| void ASMCPUregTestSPEC | ( | void | ) |
private IEC607335 CPU register test Other special register tests
LR register test written with pattern1, compared, and inverse
| testResult_t IEC60335_ClassB_CPUregTest_BIST | ( | void | ) |
public IEC607335 CPU register test BIST (Build in Self Test) consecutive test of all registers in assembler are called
Definition at line 49 of file iec60335_class_b_cpureg_test.c.
References ASMCPUregTestHIGH, ASMCPUregTestLOW, ASMCPUregTestSP, ASMCPUregTestSPEC, IEC60335_stateDone, IEC60335_statePending, IEC60335_testFailed, IEC60335_testPassed, IEC60335_CPUreg_struct::testResult, and IEC60335_CPUreg_struct::testState.
{
/* Clear the current test states */
IEC60335_CPUregTestBIST.testState = IEC60335_statePending;
IEC60335_CPUregTestBIST.testResult = IEC60335_testFailed;
/* Test the low registers r0-r7 */
ASMCPUregTestLOW();
if (IEC60335_CPUregTestBIST.testResult != IEC60335_testPassed)
{
return(IEC60335_testFailed);
}
/* Clear the PASS bit */
IEC60335_CPUregTestBIST.testResult = IEC60335_testFailed;
/* Test the high registers r8-r12 */
ASMCPUregTestHIGH();
if (IEC60335_CPUregTestBIST.testResult != IEC60335_testPassed)
{
return(IEC60335_testFailed);
}
/* Clear the PASS bit */
IEC60335_CPUregTestBIST.testResult = IEC60335_testFailed;
/* Test the stack pointer registers
* NOTE: DISABLES ALL INTERRUPTS!
*/
ASMCPUregTestSP();
if (IEC60335_CPUregTestBIST.testResult != IEC60335_testPassed)
{
return(IEC60335_testFailed);
}
/* Clear the PASS bit */
IEC60335_CPUregTestBIST.testResult = IEC60335_testFailed;
/* Test the Special registers */
ASMCPUregTestSPEC();
if (IEC60335_CPUregTestBIST.testResult != IEC60335_testPassed)
{
return(IEC60335_testFailed);
}
/* Indicate all tests passed */
IEC60335_CPUregTestBIST.testResult = IEC60335_testPassed;
IEC60335_CPUregTestBIST.testState = IEC60335_stateDone;
return(IEC60335_testPassed);
}
| testResult_t IEC60335_ClassB_CPUregTest_POST | ( | void | ) |
public IEC607335 CPU register test POST (Pre-Operation Self Test) consecutive test of all registers in assembler are called
Definition at line 39 of file iec60335_class_b_cpureg_test.c.
References ASMCPUregTestPOST, IEC60335_testFailed, and IEC60335_CPUreg_struct::testResult.
Referenced by IEC60335_ClassB_POST().
{
testResult_t Result = IEC60335_testFailed;
ASMCPUregTestPOST();
Result = IEC60335_CPUregTestPOST.testResult;
return(Result);
}

Definition at line 37 of file iec60335_class_b_cpureg_test.c.
Definition at line 36 of file iec60335_class_b_cpureg_test.c.