2.29.6 Reset Driver
Overview
The Reset module combines all Reset sources and controls the device Reset Signal.
Features
The following are the list of device Reset sources available based on the device used.
- POR: Power-on Reset
- BOR: Brown-out Reset
- MCLR: Master Clear Pin Reset
- SWR: RESET Instruction
- WDTO: Watchdog Timer Time-out Reset
- CM: Configuration Mismatch Reset
- TRAPR: Trap Conflict Reset
- IOPUWR: Illegal Condition Device Reset
- Illegal Opcode Reset
- Uninitialized W Register Reset
2.29.6.1 Module Documentation
2.29.6.1.1 Reset Driver
Reset driver using dsPIC MCUs.
Module description
Reset driver using dsPIC MCUs.
Enumerations
enum RESET_TYPES { RESET_ERROR_RCON_TRAPR = 1, RESET_ERROR_RCON_IOPUWR = 2, RESET_ERROR_RCON_CM = 3, RESET_ERROR_RCON_WDTO_ISR = 4 }
Defines the RCON error types.
enum RESET_MASKS { RESET_MASK_WDTO = 0x0010, RESET_MASK_SWR = 0x0040, RESET_MASK_EXTR = 0x0080, RESET_MASK_CM = 0x0200, RESET_MASK_IOPUWR = 0x4000, RESET_MASK_TRAPR = 0x8000 }
Defines the RESET cause mask location.
Functions
uint16_t RESET_CauseGet (void)
Returns the cause of previous reset.
void RESET_CauseHandler (void)
It handles the reset cause by clearing the cause register values. This is a weak attribute function. The user can override and implement the same function without weak attribute.
void RESET_CauseClearAll ()
Clears the Reset Cause register.
Function Documentation
RESET_CauseClearAll()
void RESET_CauseClearAll ( )
Clears the Reset Cause register.
none |
none |
RESET_CauseGet()
uint16_t RESET_CauseGet (void )
Returns the cause of previous reset.
This function should be called before any use of CLRWDT since it has a side-effect of clearing the appropriate bits in the register showing reset cause. |
none |
Returns a value corresponding to a possible cause for reset. |
RESET_CauseHandler()
void RESET_CauseHandler (void )
It handles the reset cause by clearing the cause register values. This is a weak attribute function. The user can override and implement the same function without weak attribute.
none |
none |
Enumeration Type Documentation
RESET_MASKS
enum RESET_MASKS
Defines the RESET cause mask location.
RESET_MASK_WDTO |
Defines the watchdog timeout reset flag mask location |
RESET_MASK_SWR |
Defines the software reset mask location |
RESET_MASK_EXTR |
Defines the external reset mask location |
RESET_MASK_CM |
Defines the configuration mismatch reset mask location |
RESET_MASK_IOPUWR |
Defines the illegal opcode or uninitialized W access reset mask location |
RESET_MASK_TRAPR |
Defines the trap reset mask location |
RESET_TYPES
enum RESET_TYPES
Defines the RCON error types.
RESET_ERROR_RCON_TRAPR |
A Trap Conflict Reset has occurred |
RESET_ERROR_RCON_IOPUWR |
An illegal opcode detection, an illegal address mode or Uninitialized W register used as an Address Pointer caused a Reset |
RESET_ERROR_RCON_CM |
A Configuration Mismatch Reset has occurred |
RESET_ERROR_RCON_WDTO_ISR |
WDT time-out has occurred |
2.29.6.2 File Documentation
2.29.6.2.1 source/reset.h File Reference
#include <stdint.h> #include "reset_types.h"
Functions
uint16_t RESET_CauseGet (void)
Returns the cause of previous reset.
void RESET_CauseHandler (void)
It handles the reset cause by clearing the cause register values. This is a weak attribute function. The user can override and implement the same function without weak attribute.
void RESET_CauseClearAll ()
Clears the Reset Cause register.
Detailed Description
RESET Generated Driver Header File
2.29.6.2.2 source/reset_types.h File Reference
This is the generated driver types header file for the RESET driver.
Enumerations
enum RESET_TYPES { RESET_ERROR_RCON_TRAPR = 1, RESET_ERROR_RCON_IOPUWR = 2, RESET_ERROR_RCON_CM = 3, RESET_ERROR_RCON_WDTO_ISR = 4 }
Defines the RCON error types.
enum RESET_MASKS { RESET_MASK_WDTO = 0x0010, RESET_MASK_SWR = 0x0040, RESET_MASK_EXTR = 0x0080, RESET_MASK_CM = 0x0200, RESET_MASK_IOPUWR = 0x4000, RESET_MASK_TRAPR = 0x8000 }
Defines the RESET cause mask location.
Detailed Description
This is the generated driver types header file for the RESET driver.
RESET Generated Driver Types Header File