/****************************************************************************/
/* Copyright 2016-2018 MBARI                                                */
/****************************************************************************/
/* Summary  : PIC Utility, Device Configuration, and Peripheral Module Disable*/
/* Filename : picConfig.h                                                   */
/* Author   : Robert Herlien (rah)                                          */
/* Project  : BEDS2															*/
/* Revision: 1.0                                                            */
/* Created  : 05/25/2016                                                    */
/*                                                                          */
/* MBARI provides this documentation and code "as is", with no warranty,    */
/* express or implied, of its quality or consistency. It is provided without*/
/* support and without obligation on the part of the Monterey Bay Aquarium  */
/* Research Institute to assist in its use, correction, modification, or    */
/* enhancement. This information should not be published or distributed to  */
/* third parties without specific written permission from MBARI.            */
/*                                                                          */
/****************************************************************************/
/* Modification History:                                                    */
/* 25may2016 rah - created for Oasis5 on PIC32MX470							*/
/* 55feb2018 rah - Ported to BEDS2											*/
/****************************************************************************/

#ifndef PICCONFIG_H
#define PICCONFIG_H

#include <xc.h>

#define DISABLE_INTS()          asm volatile("di")
#define ENABLE_INTS()           asm volatile("ei")

#define picLock()				SYSKEY = 0


/********************************/
/*  Function Prototypes         */
/********************************/

void picUnlock(void);				/* Unlock OSCCON						*/
void picPeriphInit(void);           /* Disables unused peripherals          */
unsigned int picResetType(void);	/* Return and reset RCON				*/

unsigned int __attribute__((nomips16)) INTDisableInterrupts(void);
unsigned int __attribute__((nomips16)) INTEnableInterrupts(void);

void picSoftReset(void);

#endif
