
/**
 * @file:       can_message.h
 *
 * Purpose:     Declare custom and register CAN datatype.
 *
 * $Authors:    fcb $
 *
 * $Copyright:  $
 *
 */
#ifndef __CANMESSAGE__HEADER__
#define __CANMESSAGE__HEADER__

#include <stdint.h>

/* @DO NOT REMOVE: The following typedef is required for targets (FM5, C166 etc.) to actually
   use it for their code generation TLC file. Since their datatype is being
   discarded, this is being defined in our header which they will be referencing.*/
typedef enum {CAN_MESSAGE_STANDARD, CAN_MESSAGE_EXTENDED} CanFrameType;

/* Define invalid CAN Identifier value. This can be used to specify invalid CAN Message
   This represents a uint32_T value */
#define INVALID_CAN_ID 0xFFFFFFFFU

typedef struct
{

    /* Is Extended frame */
    uint8_t IDE;

    /* Length */
    uint8_t DLC;

    /* CAN ID */
    uint32_t MsgId;

    /* Data field */
    uint8_t Data[8];

}  CAN_MESSAGE;

typedef CAN_MESSAGE CAN_DATATYPE;



#endif
