/***************  COPYRIGHT (c) 2012 IDNEO INTERNATIONAL   ******************
| Language:       |  MISRA C
| Controller:     |  dsPIC33
| Requirements:   |
|-----------------|-----------------------------------------------------------
| Project:        |   082_TCU01_F1_TCU_EMU_RSA
|------------------------------------------------------------------------------
|    Date  - Cod. - Rev. - App. -             Description
| 07/02/10   AC                               Creation of the file. 
|------------------------------------------------------------------------------
| FILE DESCRIPTION: Configuration header file of the transport protocol 
|                   (ISO15765_2) layer. This header must define if the transport 
|					protocol used is FULL or LITE which implies if frames till 
|					4096 bytes can be send or only single frames till 7 bytes can
| 					be send. This header must configure the number of transport
|					protocol instances that the application need.This header must 
|					also contain the declaration of the callback routine to
|                   initialize the transport protocol dynamic configuration 
|                   parameters which must be called TPDynamicParametersInitCallback
******************************************************************************/
#ifndef __TP_CFG_H
#define __TP_CFG_H

/*---------------------------- includes ----------------------------------*/
//#include "FicosarCfg.h"

/*----------------------------- defines ----------------------------------*/

/* Select the mode of ISO15765_2 used. This will apply for all the      */
/* transport protocol instances defined                                 */
/* TP_MODE_LITE -> Only single frames can be sent and received  		*/
/* TP_MODE_FULL -> Frames till 4096 bytes can be sent and received  	*/
#define TP_MODE_FULL

/* Number of Transport Protocol instances that will be defined. One     */
/* instance must be defined for example for each of the following upper */
/* layters:																*/
/*    - Diagnostics client												*/
/*	  - Diagnostics server												*/
/*    - MPDT															*/
#define TP_NUM_INSTANCES       ((UI_8)1)

/*************************** ISO15765_2 HANDLERS USAGE BEGIN****************************/
#define ISO15765_2_REPROGONCAN_HANDLER        ((UI_8)0)
/*************************** ISO15765_2 HANDLERS USAGE END ****************************/
/* Ticks between task periodic calls */
#define TP_TASK_TICKS			((t_timer_time)2)

/* Minimum length of a flow control frame to be accepted */
#define CAN_FRM_FC_SIZE ((UI_8)8)

/*------------------------- prototips de funcions ------------------------*/

/*****************************************************************************
| Portability: General
|----------------------------------------------------------------------------
| Routine description:
|  * It is responsability of the user to declare this routine.
|  * This routine is a callback routine that will be called each time that the
|    InicialitzaTPTask is executed. This InicialitzaTPTask must be called at
|    the initializations in main and must be called once for each instance
|    defined in the TP_CFG.h.
|  * Routine to initializate dynamically the parameters of each defined
|    transport protocol instance. The way to configure each transport protocol
|    instance is using the structure t_tp_init which must be given as a pointer
|    to TPInitData routine.
|---------------------------------------------------------------------------
| Parameters description:
|  UI_8 tp_hdl : ...
|  result none : ...
/---------------------------------------------------------------------------*/
void TPDynamicParametersInitCallback(UI_8 tp_hdl);

#endif
