/* ======================================================================
*   Copyright (C) 2022 Texas Instruments Incorporated
*
*   All rights reserved. Property of Texas Instruments Incorporated.
*   Restricted rights to use, duplicate or disclose this code are
*   granted through contract.
*
*   The program may not be used without the written permission
*   of Texas Instruments Incorporated or against the terms and conditions
*   stipulated in the agreement under which this program has been
*   supplied.
* ==================================================================== */
 /***************************************************************************
  Project: CAN_AM263
  Date   : 2022-08-04 22:43:04
  This file is generated by EB Tresos
  Do not modify this file, otherwise the software may behave in unexpected way.

 *****************************************************************************/

/**
 *  \file     Can_Cfg.h
 *
 *  \brief    This file contains generated pre compile configuration file for
 *            CAN MCAL driver
 *
 */

/**
 *
 ******************************************************************************
 * \defgroup MCAL_CAN_CFG Can Configuration
 *
 * This files defines CAN MCAL configuration structures
 *  @{
 ******************************************************************************/

#ifndef CAN_CFG_H_
#define CAN_CFG_H_

#include "Dem.h"
#ifdef __cplusplus
extern "C" {
#endif

/** \brief CAN Config ID */
#define CAN_CFG_ID          (CAN_CFG_ID_0)

/**
 *  \name Can Driver Configuration SW Version Info
 *
 *  Defines for CAN Driver configuration version
 *  @{
 */
/** \brief Can configuration Major Version */
#define CAN_CFG_MAJOR_VERSION           (0U)
/** \brief Can configuration Minor Version */
#define CAN_CFG_MINOR_VERSION           (9U)
/** \brief Can configuration Patch Version */
#define CAN_CFG_PATCH_VERSION           (0U)
/* @} */

/**
 *  \name Can Driver Configuration SW Version Info
 *
 *  Pre-compile switches for enabling/disabling CAN MCAL APIs
 *  @{
 */
#define CAN_VERSION_INFO_API   (STD_ON)
/*!< Enable/Disable Can_GetVersionInfo() */
#define CAN_CHANGE_BAUDRATE_API (STD_ON)
/*!< Enable/Disable Can_ChangeBaudrate()  */
#define CAN_DEV_ERROR_DETECT  (STD_ON)
/*!< Enable/Disable DEV error detection */
#define CAN_CFG_DEINIT_API  (STD_ON)
/*!< Enable/Disable Can_DeInit() API */
#define CAN_LOOPBACK_ENABLE   (STD_OFF)
/*!< Enable/Disable Can_TestLoopBackModeEnable() */
#define CAN_SAFETI_API        (STD_OFF)
/*!< Enable/Disable SAFETY APIs */
#define CAN_WAKEUP_FUNCTIONALITY_API        (STD_ON)
/*!< Enable/Disable Can_CheckWakeup() */
#define CAN_MULTIPLEXED_TRANSMISSION_ENABLE (STD_OFF)
/*!< Enable/Disable Multiplexed Transmission */

/**
*  \brief CAN Build Variant.
*   Build Variants.(i.e Pre-compile,Post-Build or Link time)
*/
#define CAN_CFG_PRE_COMPILE_VARIANT         (STD_OFF)

/* For all controllers setting needs to be same either polling or interrupt No
 *mixed mode is allowed */
#define CAN_TX_POLLING      (STD_ON)
/*!< Enable/Disable Can_MainFunction_Write */
#define CAN_RX_POLLING      (STD_ON)
/*!< Enable/Disable Can_MainFunction_Read */
#define CAN_BUSOFF_POLLING  (STD_ON)
/*!< Enable/Disable Can_MainFunction_BusOff */
#define CAN_WAKEUP_POLLING  (STD_ON)
/*!< Enable/Disable Can_MainFunction_Wakeup */
#define CAN_ECC_ENABLE          (STD_OFF)
/*!< Enable/Disable single bit ECC logic */
/* @} */
 #define KMAX_CONFIG_SET       (1U)
/*!< Maximum number of Config sets */
#define KMAX_BAUD_LIST      (13U)
/*!< Max Baud rate config structs */
#define KMAX_CONTROLLER      (4U)
/*!< Max number of controllers defined*/

#define KMAX_MAILBOXES      (16U)
/*!< Max number of mailboxes defined*/
#define KMAX_MB_PER_CONTROLLER (64U)
/*!< Max number of mailboxes per controller */


/*!< Enable/Disable OSEK Category 1 ISR */
#define CLK_CAN_FD1_FREQ   (80U)
/*!< Clock source frequency CAN FD */
#define CLK_CAN_FD2_FREQ   (80U)
/*!< Clock source frequency CAN FD 2*/
#define CLK_CAN_FD3_FREQ   (80U)
/*!< Clock source frequency CAN FD 3*/
#define CLK_CAN_FD4_FREQ   (80U)
/*!< Clock source frequency CAN FD 4*/
/**
 *  \name Can Controller Id names
 *
 *  Defines for symbolic names for the CanControllerIds
 *  @{
 */
#define CanConf_CanController_CanController_0   (0U)
#define CanConf_CanController_CanController_1   (1U)
#define CanConf_CanController_CanController_2   (2U)
#define CanConf_CanController_CanController_3   (3U)
/* @} */

/* @} */



/*!< MCAN1 CONTROLLER */
#define CAN_CONTROLLER_MCAN1

/*!< MCAN2 CONTROLLER */
#define CAN_CONTROLLER_MCAN2

/*!< MCAN3 CONTROLLER */
#define CAN_CONTROLLER_MCAN3

/*!< MCAN4 CONTROLLER */
#define CAN_CONTROLLER_MCAN4

/*!< CAN ISR TYPE */
#define CAN_ISR_TYPE    (CAN_ISR_CAT1)


/**
 *  \name Can HW Object names
 *
 *  Defines for symbolic names for the CanHardwareObjectIds
 *  @{
 */

#define CanConf_CanHardwareObject_CanHardwareObject_0   (0U)
#define CAN_HTRH_0         (CanConf_CanHardwareObject_CanHardwareObject_0)

#define CanConf_CanHardwareObject_CanHardwareObject_1   (1U)
#define CAN_HTRH_1         (CanConf_CanHardwareObject_CanHardwareObject_1)

#define CanConf_CanHardwareObject_CanHardwareObject_2   (2U)
#define CAN_HTRH_2         (CanConf_CanHardwareObject_CanHardwareObject_2)

#define CanConf_CanHardwareObject_CanHardwareObject_3   (3U)
#define CAN_HTRH_3         (CanConf_CanHardwareObject_CanHardwareObject_3)

#define CanConf_CanHardwareObject_CanHardwareObject_4   (4U)
#define CAN_HTRH_4         (CanConf_CanHardwareObject_CanHardwareObject_4)

#define CanConf_CanHardwareObject_CanHardwareObject_5   (5U)
#define CAN_HTRH_5         (CanConf_CanHardwareObject_CanHardwareObject_5)

#define CanConf_CanHardwareObject_CanHardwareObject_6   (6U)
#define CAN_HTRH_6         (CanConf_CanHardwareObject_CanHardwareObject_6)

#define CanConf_CanHardwareObject_CanHardwareObject_7   (7U)
#define CAN_HTRH_7         (CanConf_CanHardwareObject_CanHardwareObject_7)

#define CanConf_CanHardwareObject_CanHardwareObject_8   (8U)
#define CAN_HTRH_8         (CanConf_CanHardwareObject_CanHardwareObject_8)

#define CanConf_CanHardwareObject_CanHardwareObject_9   (9U)
#define CAN_HTRH_9         (CanConf_CanHardwareObject_CanHardwareObject_9)

#define CanConf_CanHardwareObject_CanHardwareObject_10   (10U)
#define CAN_HTRH_10         (CanConf_CanHardwareObject_CanHardwareObject_10)

#define CanConf_CanHardwareObject_CanHardwareObject_11   (11U)
#define CAN_HTRH_11         (CanConf_CanHardwareObject_CanHardwareObject_11)

#define CanConf_CanHardwareObject_CanHardwareObject_12   (12U)
#define CAN_HTRH_12         (CanConf_CanHardwareObject_CanHardwareObject_12)

#define CanConf_CanHardwareObject_CanHardwareObject_13   (13U)
#define CAN_HTRH_13         (CanConf_CanHardwareObject_CanHardwareObject_13)

#define CanConf_CanHardwareObject_CanHardwareObject_14   (14U)
#define CAN_HTRH_14         (CanConf_CanHardwareObject_CanHardwareObject_14)

#define CanConf_CanHardwareObject_CanHardwareObject_15   (15U)
#define CAN_HTRH_15         (CanConf_CanHardwareObject_CanHardwareObject_15)
/* @} */

/* @} */

/** \brief Counter ID for counter used to count wait ticks */
#define CAN_CFG_OS_COUNTER_ID               ((CounterType)0U)

/**
*  \brief CAN timeout - used in CAN IFCMD busy wait and Start/Stop busy wait.
*   Specifies the maximum time for blocking function until a timeout is detected.
*   Unit is milli seconds.
*/
#define CAN_CFG_TIMEOUT_DURATION            (10000U)

/* DEM Error Definitions */
/* DEM Error Codes */
/** \brief No event error code */
#define CAN_DEM_NO_EVENT                (0xFFFFU)


#ifndef CAN_E_HARDWARE_ERROR
/** \brief Hardware failed */
#define CAN_E_HARDWARE_ERROR          (CAN_DEM_NO_EVENT)
#endif

/* ========================================================================== */
/*                         Structures and Enums                               */
/* ========================================================================== */

/** \brief CAN Configuration struct declaration */
extern const struct Can_ConfigType_s CanConfigSet;


#ifdef __cplusplus
}
#endif

#endif /*CAN_CFG_H__*/

/* @} */
/**********************************************************************************************************************
 *  END OF FILE: Can_Cfg.h
 *********************************************************************************************************************/
