2.29.7 Traps Driver
Overview
Traps are non-maskable, nestable interrupts that adhere to a fixed priority structure. Traps provide a means to correct erroneous operation during debugging and the operation of the application.
2.29.7.1 Module Documentation
2.29.7.1.1 Traps Driver
Traps driver with handler for all types of traps using dsPIC MCUs.
Module description
Traps driver with handler for all types of traps using dsPIC MCUs.
Enumerations
enum TRAPS_ERROR_CODE { TRAPS_OSC_FAIL = 0, TRAPS_STACK_ERR = 1, TRAPS_ADDRESS_ERR = 2, TRAPS_MATH_ERR = 3, TRAPS_HARD_ERR = 7, TRAPS_DOOVR_ERR = 10, TRAPS_APLL_ERR = 11, TRAPS_NVM_ERR = 12, TRAPS_CAN_ERR = 13 }
Defines the TRAPS error codes.
Functions
void TRAPS_halt_on_error (uint16_t code)
Stores the trap error code and waits forever. This is a weak attribute function. The user can override and implement the same function without weak attribute.
Function Documentation
TRAPS_halt_on_error()
void TRAPS_halt_on_error (uint16_t code)
Stores the trap error code and waits forever. This is a weak attribute function. The user can override and implement the same function without weak attribute.
in | code |
- trap error code |
none |
Enumeration Type Documentation
TRAPS_ERROR_CODE
enum TRAPS_ERROR_CODE
Defines the TRAPS error codes.
TRAPS_OSC_FAIL |
Oscillator Fail Trap vector |
TRAPS_STACK_ERR |
Stack Error Trap Vector |
TRAPS_ADDRESS_ERR |
Address error Trap vector |
TRAPS_MATH_ERR |
Math Error Trap vector |
TRAPS_HARD_ERR |
Generic Hard Trap vector |
TRAPS_DOOVR_ERR |
Generic Soft Trap vector |
TRAPS_APLL_ERR |
Generic Soft Trap vector |
TRAPS_NVM_ERR |
Generic Soft Trap vector |
TRAPS_CAN_ERR |
Generic Soft Trap vector |
2.29.7.2 File Documentation
2.29.7.2.1 source/traps.h File Reference
#include <stdint.h>
Functions
void TRAPS_halt_on_error (uint16_t code)
Stores the trap error code and waits forever. This is a weak attribute function. The user can override and implement the same function without weak attribute.
Enumerations
enum TRAPS_ERROR_CODE { TRAPS_OSC_FAIL = 0, TRAPS_STACK_ERR = 1, TRAPS_ADDRESS_ERR = 2, TRAPS_MATH_ERR = 3, TRAPS_HARD_ERR = 7, TRAPS_DOOVR_ERR = 10, TRAPS_APLL_ERR = 11, TRAPS_NVM_ERR = 12, TRAPS_CAN_ERR = 13 }
Defines the TRAPS error codes.
Detailed Description
TRAPS Generated Driver Header File