/********************************************************************
* Copyright (C) 2016 Microchip Technology Inc. and its subsidiaries
* (Microchip).  All rights reserved.
*
* You are permitted to use the software and its derivatives with Microchip
* products. See the license agreement accompanying this software, if any, for
* more info about your rights and obligations.
*
* SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
* MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR
* PURPOSE. IN NO EVENT SHALL MICROCHIP, SMSC, OR ITS LICENSORS BE LIABLE OR
* OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH
* OF WARRANTY, OR OTHER LEGAL EQUITABLE THEORY FOR ANY DIRECT OR INDIRECT
* DAMAGES OR EXPENSES INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL,
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR OTHER SIMILAR COSTS. To the fullest
* extend allowed by law, Microchip and its licensors liability will not exceed
* the amount of fees, if any, that you paid directly to Microchip to use this
* software.
*************************************************************************
*
*                           Config.h
*
* Configuration header file
*
*
* Hardware:
*  Flyback SMPS using PIC16F1769
*
* Author                          Date            Ver     Comment
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Turcan Gheorghe M15725          2016.10.12      0.6       MPLABX V3.30  XC8 V1.37
******************************************************************************/

#ifndef CONFIG_H
#define	CONFIG_H

#define ON (1)
#define OFF (0)


//Function select ON/OFF       ---- OFF to disable function / ON to enable function
#define ShortCircuitProtection ON
#define ShortCircuitLimitedRetry OFF
#define SoftStartFunction   ON
#define MaxDutyCycleLimit   ON

//______________________________________________________________________________

// Function Options      ---- Value options for the enabled functions

#define ShortCircuitDetectValue (0x10) //Trigger short circuit at :2.2A - 0x11 when the input voltage is 85VAC ; 2.5A - 0x12; @265VAC the triger is at 5A
#define ShortCircuitRetryTimes  (6)    // Values between 2 to 30 (integer)
#define SCTimeBetweenRetries    (2)    // Value in seconds Min: 2 - Max: 30 (integer))
#define MaxDutyCycleValue  (0x85)      // The value is in hex - Formula : transform to hex : (2.56 * Duty-Cycle % )
                                       // Ex: if we need a 48% maximum duty-cycle ::  2.56 * 48 = 122.8 approximate to 123 in decimal; 123 dec = 7A hex

#endif	/* CONFIG_H */