3.7 Traps Driver
3.7.1 Introduction
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.
3.7.2 Module Documentation
3.7.2.1 Traps Driver
Traps driver with handler for all types of traps using dsPIC MCUs.
3.7.2.1.1 Module description
Traps driver with handler for all types of traps using dsPIC MCUs.
3.7.2.1.1.1 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.
3.7.2.1.1.2 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.
3.7.2.1.2 Function Documentation
3.7.2.1.2.1 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 |
3.7.2.1.3 Enumeration Type Documentation
3.7.2.1.3.1 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 |
3.7.3 File Documentation
3.7.3.1 source/traps.h File Reference
#include <stdint.h>
3.7.3.1.1 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.
3.7.3.1.2 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.
3.7.3.1.3 Detailed Description
TRAPS Generated Driver Header File