/* 
 * File:   DigitalIO_Fubarino.h
 * Author: JF
 *
 * Created on November 24, 2018, 3:20 PM
 */

#ifndef DIGITALIO_FUBARINO_H
#define	DIGITALIO_FUBARINO_H

#ifdef	__cplusplus
extern "C" {
#endif

/* ************************************************************************** */
/* Includes */
#include "define.h"
/* ************************************************************************** */
/* Defines */
    
#define SYS_FREQ 			(80000000L)		//Clock period = 12.5 ns
#define PERIPHERAL_FREQ		(80000000L)
    
    
    
//Output pins hardware definitions
//
	#define HEARTBEAT_LED_1_PIN_DIR		TRISEbits.TRISE5
	#define HEARTBEAT_LED_1_PIN			LATEbits.LATE5
	#define HEARTBEAT_LED_1_TOGGLE_REG  LATEINV
	#define HEARTBEAT_LED_1_SET_REG  	LATESET
	#define HEARTBEAT_LED_1_CLEAR_REG   LATECLR
	#define HEARTBEAT_LED_1_TOGGLE_MASK _LATE_LATE5_MASK
	
	#define HEARTBEAT_LED_2_PIN_DIR		TRISEbits.TRISE2
	#define HEARTBEAT_LED_2_PIN			LATEbits.LATE2
	#define HEARTBEAT_LED_2_TOGGLE_REG  LATEINV
	#define HEARTBEAT_LED_2_SET_REG  	LATESET
	#define HEARTBEAT_LED_2_CLEAR_REG   LATECLR
	#define HEARTBEAT_LED_2_TOGGLE_MASK _LATE_LATE2_MASK

    #define SD_SPI_SDO_PIN_DIR		TRISGbits.TRISG8
    #define SD_SPI_CS_PIN_DIR		TRISGbits.TRISG9
    #define SD_SPI_CS_PIN   		LATGbits.LATG9
    #define SD_SPI_SDI_PIN_DIR		TRISGbits.TRISG7
    #define SD_SPI_SCK_PIN_DIR		TRISGbits.TRISG6


/* ************************************************************************** */
/* Prototypes */
void InitDigitalIO(void);

#ifdef	__cplusplus
}
#endif

#endif	/* DIGITALIO_FUBARINO_H */

