/*************************************************************************
Software License Agreement

The software supplied herewith by Microchip Technology Incorporated
(the “Company”) for its PICmicro® Microcontroller is intended and
supplied to you, the Company’s customer, for use solely and
exclusively on Microchip PICmicro Microcontroller products. The
software is owned by the Company and/or its supplier, and is
protected under applicable copyright laws. All rights are reserved.
Any use in violation of the foregoing restrictions may subject the
user to criminal sanctions under applicable laws, as well as to
civil liability for the breach of the terms and conditions of this
license.

THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES,
WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED
TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT,
IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
**************************************************************************/

#ifndef __HARDWARE_PROFILE_H__
#define __HARDWARE_PROFILE_H__

/* Clock Macros **********************************************************/
#ifndef SYS_CLOCK
    #error "Define SYS_CLOCK (ex. -DSYS_CLOCK=80000000) on compiler command line"
#endif

#define GetSystemClock()            SYS_CLOCK
#define GetPeripheralClock()        SYS_CLOCK
#define GetInstructionClock()


/* LED Macros ************************************************************/

#define mInitAllLEDs()  {TRISA = 0; LATA = 0;}

#define mLED_3              LATAbits.LATA0
#define mLED_4              LATAbits.LATA1
#define mLED_5              LATAbits.LATA2
#define mLED_6              LATAbits.LATA3
#define mLED_7              LATAbits.LATA4
#define mLED_8              LATAbits.LATA5
#define mLED_9              LATAbits.LATA6
#define mLED_10             LATAbits.LATA7

#define mLED_3_On()         mLED_3  = 1;
#define mLED_4_On()         mLED_4  = 1;
#define mLED_5_On()         mLED_5  = 1;
#define mLED_6_On()         mLED_6  = 1;
#define mLED_7_On()         mLED_7  = 1;
#define mLED_8_On()         mLED_8  = 1;
#define mLED_9_On()         mLED_9  = 1;
#define mLED_10_On()        mLED_10 = 1;

#define mLED_3_Off()        mLED_3  = 0;
#define mLED_4_Off()        mLED_4  = 0;
#define mLED_5_Off()        mLED_5  = 0;
#define mLED_6_Off()        mLED_6  = 0;
#define mLED_7_Off()        mLED_7  = 0;
#define mLED_8_Off()        mLED_8  = 0;
#define mLED_9_Off()        mLED_9  = 0;
#define mLED_10_Off()       mLED_10 = 0;

#define mLED_3_Toggle()     mLED_3  = !mLED_3;
#define mLED_4_Toggle()     mLED_4  = !mLED_4;
#define mLED_5_Toggle()     mLED_5  = !mLED_5;
#define mLED_6_Toggle()     mLED_6  = !mLED_6;
#define mLED_7_Toggle()     mLED_7  = !mLED_7;
#define mLED_8_Toggle()     mLED_8  = !mLED_8;
#define mLED_9_Toggle()     mLED_9  = !mLED_9;
#define mLED_10_Toggle()    mLED_10 = !mLED_10;


/** USER DEBUG MESSAGE *********************************/
#define mInitMessage()                      Ex16LCDInit(GetPeripheralClock())
#define mSendMessage1()                     Ex16LCDWriteLine(1, "  USB Generic   ")
#define mSendMessage2()                     Ex16LCDWriteLine(2, "  Device Demo   ")

#endif // __HARDWARE_PROFILE_H__

