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.

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.

Parameters:
none
Returns:

none

RESET_CauseGet()

uint16_t RESET_CauseGet (void )

Returns the cause of previous reset.

Precondition:

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.

Parameters:
none
Returns:

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.

Parameters:
none
Returns:

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.

Detailed Description

This is the generated driver types header file for the RESET driver.

RESET Generated Driver Types Header File