3.6 Reset Driver
3.6.1 Introduction
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
3.6.2 Module Documentation
3.6.2.1 Reset Driver
Reset driver using dsPIC MCUs.
3.6.2.1.1 Module description
Reset driver using dsPIC MCUs.
3.6.2.1.1.1 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.
3.6.2.1.1.2 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.
3.6.2.1.2 Function Documentation
3.6.2.1.2.1 RESET_CauseClearAll()
void RESET_CauseClearAll ( )
Clears the Reset Cause register.
none |
none |
3.6.2.1.2.2 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. |
3.6.2.1.2.3 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 |
3.6.2.1.3 Enumeration Type Documentation
3.6.2.1.3.1 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 |
3.6.2.1.3.2 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 |
3.6.3 File Documentation
3.6.3.1 source/reset.h File Reference
#include <stdint.h> #include "reset_types.h"
3.6.3.1.1 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.
3.6.3.1.2 Detailed Description
RESET Generated Driver Header File
3.6.3.2 source/reset_types.h File Reference
This is the generated driver types header file for the RESET driver.
3.6.3.2.1 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.
3.6.3.2.2 Detailed Description
This is the generated driver types header file for the RESET driver.
RESET Generated Driver Types Header File