
#ifndef FICOSARCFG_H_
#define FICOSARCFG_H_

/*----------------------------- MICROCONTROLLER -----------------------------*/

/* Definition of over which micro the code will be running. Allowed Values:  */
#define MPC5604   (0)
#define RH850F1L  (1)

#define MICROCONTROLLER (RH850F1L)

/*----------------------------- CONFIG VERSION  -----------------------------*/
/* Iteration of the configuration. Updated every time the config API changes */

#define HAL_FICOSAR_CFG_VERSION 5



///* AUTOSAR defines different prototypes for CanIf_RxIndication. */
//#define VARIANT_4_0 0
//#define VARIANT_4_2 1
//
//#define AUTOSAR_VARIANT VARIANT_4_0

/*--------------------- CAN COMMUNICATIONS CONFIGURATION --------------------*/

/*Name of the external data structure containing the overall initialization  */
/*data for the CAN driver and affecting all controllers.					 */
#define CAN_CONFIG_SET_0	(&Can_RSCAN_GstConfigType[0])

/* Extended CAN frames filter flag. Allowed values:                          */
/*   CAN_EXTENDED_FRAMES_NOTIFIED: Extended frames aren't filtered by HW     */
/*   CAN_EXTENDED_FRAMES_FILTERED: Extended frames are filtered by HW        */
/* Extended frames reception is incompatible with recording via CAN.         */
#define CAN_EXTENDED_FRAMES (CAN_EXTENDED_FRAMES_FILTERED)

/* Define here the number of CAN controllers used (1 or 2)					 */
#define NO_OF_CAN_CONTROLLERS	((UI_8)1)
/* Configuration parameter of CANn enabling.                                 */
/* Allowed values: CAN_ENABLED, CAN_DISABLED.                                */
#define CAN1_MODE (CAN_ENABLED)
#define CAN2_MODE (CAN_DISABLED)

/* Define which controller uses each CAN logical channel                     */
#define CAN1_CONTROLLER ((UI_8) 0x01)
#define CAN2_CONTROLLER ((UI_8) 0x02)

/* Define here the number of TX HW buffers configured for each CAN Controller
 * Current maximum hw buffers number supported is 2.						 */
#define NO_OF_TX_CAN_BUFFERS	(1)

/* Configuration set for CAN1 */
#define CAN_1_RX_HW_OBJECT0 (CanConf_CanHardwareObject_Ctrl_0_Rx_0) 	/* RECEIVE object of Can Controller ID = 0 	  */
#define CAN_1_TX_HW_OBJECT0 (CanConf_CanHardwareObject_Ctrl_0_Tx_0)	/* TRANSMIT object 1 of Can Controller ID = 0 */
//#define CAN_1_TX_HW_OBJECT1

/* Configuration set for CAN2 */
//#define CAN_2_RX_HW_OBJECT0 (CanConf_CanHardwareObject_CanHardwareObject1) 	/* RECEIVE object of Can Controller ID = 1    */
//#define CAN_2_TX_HW_OBJECT0 (CanConf_CanHardwareObject_CanHardwareObject3) 	/* TRANSMIT object 1 of Can Controller ID = 1 */
//#define CAN_2_TX_HW_OBJECT1

/* Callback Routines */
/* The prototype of the function is void ((* func) (t_can_buf_hdl bhdl)) for */
/* Rx and Tx. 																 */
/* The prototype of the function is void ((BOOL)(* func) (void)) for TxReq.  */
/* If you don't want to use any callback function, you should not define     */
/* this parameter.                                                           */
#define CAN1_RX_CALLBACK 	(OsekComRxNotifCallbackSWTR)
#define CAN1_TXREQ_CALLBACK (OsekComTxReqCallbackSWTR)
#define CAN1_TX_CALLBACK 	(OsekComTxNotifCallbackSWTR)

//#define CAN2_RX_CALLBACK 	(Can2_Rx_Cb)
//#define CAN2_TXREQ_CALLBACK (Can2_TxReq_Cb)
//#define CAN2_TX_CALLBACK 	(Can2_TxNotif_Cb)

/*------------------------   TIMER CONFIGURATION   --------------------------*/

/* Definition of GPT Configuration Set 0 handler */
#define GPT_CONFIG_SET_0 (&Gpt_GstConfiguration[0])
/* Definition of GPT Configuration Channel 0 handler */
#define GPT_CONFIG_CHANNEL_0 (GptConf_GptChannelConfiguration_GptChannelConfiguration0)

/* Definition of clock frequency for the system timer(set in ECU SPECTRUM)   */ 
#define FREQ_SYS_CLOCK (40) /* SYS_CLOCK = 40MHz */

/* Time units configuration parameter which TIMER_TIME_TICK parameter is     */
/* expressed. Allowed Values:                                                */
/*   M_SECONDS if you pass a value in miliseconds                            */
/*   U_SECONDS if you pass a value in microseconds                           */
#define TIMER_TIME_UNIT (M_SECONDS)

/* Period between clock ticks configuration parameter.                       */
/* Allowable Values when FREQ_CLOCK_MHZ is 8:                                */
/* - If TIMER_TIME_UNIT is M_SECONDS: any in the range [1-63]                */
/* - If TIMER_TIME_UNIT is U_SECONDS: any in the range [1-255],              */
/*   and the tick will be 125 x TIMER_TIME_TICK microseconds.                */   
/*     Example: TIMER_TIME_TICK = 2 --> tick of 250 microseconds             */
/* Allowable Values when FREQ_CLOCK_MHZ is 5:                                */
/* - If TIMER_TIME_UNIT is M_SECONDS: any in the range [1-51]                */
/* - If TIMER_TIME_UNIT is U_SECONDS: any in the range [1-255],              */
/*   and the tick will be 200 x TIMER_TIME_TICK microseconds.                */
/*     Example: TIMER_TIME_TICK = 2 --> tick of 400 microseconds             */
/* Allowable Values when FREQ_CLOCK_MHZ is 12:                               */
/* - If TIMER_TIME_UNIT is M_SECONDS: any in the range [1-42]                */
/* - If TIMER_TIME_UNIT is U_SECONDS: any in the range [1-255],              */
/*   and the tick will be 166,666... x TIMER_TIME_TICK microseconds.         */
/*     Example: TIMER_TIME_TICK = 3 --> tick of 500 microseconds             */
#define TIMER_TIME_TICK (1)
	
/* Configuration parameter of the number of clock ticks that the main        */ 
/* program cycle works. Admisible Values: [1-127]. This value is obtained    */
/* by dividing the time of the program cycle period between the ticks.       */
/* For example, if you have a period of 250 microseconds between ticks       */
/* and we want a cycle of 5 ms, we have to set TIMER_TICKS_CICLE to:         */ 
/* 5000/250 = 20 */
#define TIMER_TICKS_CICLE (2)

/* Definition of the t_timer_time size that will be used in every FSM and    */
/* generated code.                                                           */
/* Allowed values for TIMER_T_CLOCK_SIZE                                     */
/* T_TIMER_TIME_1_BYTE  (1)                                                  */
/* T_TIMER_TIME_2_BYTE  (2)                                                  */
/* T_TIMER_TIME_4_BYTE  (3)                                                  */
#define T_TIMER_TIME_SIZE  (T_TIMER_TIME_4_BYTE)

/* Name of the auxiliar callback function to execute each clock tick.        */
/* The prototype of the function is void (* func) (void)). If you don't want */
/* to use any callback function, you should not define this parameter. The   */
/* user is responsible to calculate the increased cost in execution time     */
/* that the call of this function may cause.                                 */
#define TIMER_TICK_CALLBACK (SystemTick_callback)


#endif /* FICOSARCFG_H_ */
