
#ifndef _Internal_FICOSEKCOM_H
#define _Internal_FICOSEKCOM_H

/*-------------------------------- includes ------------------------------*/
#include "Global.h"
#include "SpiFrameWrapper.h"

/*-------------------------------- defines -------------------------------*/
/* Return type of the calls OSEK COM */
#ifndef STD_TYPES_H
    #define E_OK         ((UI_8)0x00) /* Service call has succeeded        */
#endif    
#define E_COM_ID         ((UI_8)0x01) /* Given message or mode identifier  */
                             /* is out of range or invalid        */
#define E_COM_LENGTH     ((UI_8)0x02) /* Given data length is out of range */
#define E_COM_LIMIT      ((UI_8)0x03) /* Overflow of message queue         */
#define E_COM_NOMSG      ((UI_8)0x04) /* Message queue is empty            */
#define E_COM_SYS_NOINIT ((UI_8)0x05) /* User defined E_COM_SYS_??         */

/* Node id */ 
#define NODE_ID_MASK ((UI_16) 0xF000) /* Mask to get nodes id */
#define NODE_ID_MMC (((UI_16) 0x1000) & NODE_ID_MASK) /* Symbolic name of the node MMC */

/* Symbolic names for Tx signals with static length */ 
/* First tx signal */
#define INTERNALFIRST_TX_STA_LEN_SIGNAL_SYMBOLIC_NAME ((~NODE_ID_MASK) & SIG_MMC_ACTU_UDS_MODE)
#define SIG_MMC_ACTU_UDS_MODE (((UI_16) 1) | NODE_ID_MMC) /* Symbolic name of the signal MMC_ACTU_uds_mode */
#define SIG_MMC_APPLICATION_MODE (((UI_16) 2) | NODE_ID_MMC) /* Symbolic name of the signal MMC_application_mode */
#define SIG_MMC_CLOCK_ATCU_A112 (((UI_16) 3) | NODE_ID_MMC) /* Symbolic name of the signal MMC_Clock_ATCU_A112 */
#define SIG_MMC_CRC_ATCU_A112 (((UI_16) 4) | NODE_ID_MMC) /* Symbolic name of the signal MMC_CRC_ATCU_A112 */
#define SIG_MMC_D_LOCK_UDS_OFFSET (((UI_16) 5) | NODE_ID_MMC) /* Symbolic name of the signal MMC_d_lock_uds_offset */
#define SIG_MMC_D_N_UDS_OFFSET (((UI_16) 6) | NODE_ID_MMC) /* Symbolic name of the signal MMC_d_n_uds_offset */
#define SIG_MMC_D_OUT_UDS_OFFSET (((UI_16) 7) | NODE_ID_MMC) /* Symbolic name of the signal MMC_d_out_uds_offset */
#define SIG_MMC_D_UDS_DIE1_SETPOINT (((UI_16) 8) | NODE_ID_MMC) /* Symbolic name of the signal MMC_d_uds_die1_setpoint */
#define SIG_MMC_D_UDS_DIE2_SETPOINT (((UI_16) 9) | NODE_ID_MMC) /* Symbolic name of the signal MMC_d_uds_die2_setpoint */
#define SIG_MMC_GEARLEVERPOSITIONEXTENDED_V2 (((UI_16) 10) | NODE_ID_MMC) /* Symbolic name of the signal MMC_GearLeverPositionExtended_v2 */
#define SIG_MMC_IGNITIONSUPPLYCONFIRMATION (((UI_16) 11) | NODE_ID_MMC) /* Symbolic name of the signal MMC_IgnitionSupplyConfirmation */
#define SIG_MMC_MELEXIS_VIRTUAL_DIE1 (((UI_16) 12) | NODE_ID_MMC) /* Symbolic name of the signal MMC_melexis_virtual_die1 */
#define SIG_MMC_MELEXIS_VIRTUAL_DIE2 (((UI_16) 13) | NODE_ID_MMC) /* Symbolic name of the signal MMC_melexis_virtual_die2 */
#define SIG_MMC_MLX_POSITION (((UI_16) 14) | NODE_ID_MMC) /* Symbolic name of the signal MMC_mlx_position */
#define SIG_MMC_N_D_UDS_OFFSET (((UI_16) 15) | NODE_ID_MMC) /* Symbolic name of the signal MMC_n_d_uds_offset */
#define SIG_MMC_N_R_UDS_OFFSET (((UI_16) 16) | NODE_ID_MMC) /* Symbolic name of the signal MMC_n_r_uds_offset */
#define SIG_MMC_N_UDS_DIE1_SETPOINT (((UI_16) 17) | NODE_ID_MMC) /* Symbolic name of the signal MMC_n_uds_die1_setpoint */
#define SIG_MMC_N_UDS_DIE2_SETPOINT (((UI_16) 18) | NODE_ID_MMC) /* Symbolic name of the signal MMC_n_uds_die2_setpoint */
#define SIG_MMC_P_LOCK_UDS_OFFSET (((UI_16) 19) | NODE_ID_MMC) /* Symbolic name of the signal MMC_p_lock_uds_offset */
#define SIG_MMC_P_OUT_UDS_OFFSET (((UI_16) 20) | NODE_ID_MMC) /* Symbolic name of the signal MMC_p_out_uds_offset */
#define SIG_MMC_P_R_UDS_OFFSET (((UI_16) 21) | NODE_ID_MMC) /* Symbolic name of the signal MMC_p_r_uds_offset */
#define SIG_MMC_P_UDS_DIE1_SETPOINT (((UI_16) 22) | NODE_ID_MMC) /* Symbolic name of the signal MMC_p_uds_die1_setpoint */
#define SIG_MMC_P_UDS_DIE2_SETPOINT (((UI_16) 23) | NODE_ID_MMC) /* Symbolic name of the signal MMC_p_uds_die2_setpoint */
#define SIG_MMC_RELAY_SELFCHECK_REQUEST (((UI_16) 24) | NODE_ID_MMC) /* Symbolic name of the signal MMC_relay_selfcheck_request */
#define SIG_MMC_R_N_UDS_OFFSET (((UI_16) 25) | NODE_ID_MMC) /* Symbolic name of the signal MMC_r_n_uds_offset */
#define SIG_MMC_R_P_UDS_OFFSET (((UI_16) 26) | NODE_ID_MMC) /* Symbolic name of the signal MMC_r_p_uds_offset */
#define SIG_MMC_R_UDS_DIE1_SETPOINT (((UI_16) 27) | NODE_ID_MMC) /* Symbolic name of the signal MMC_r_uds_die1_setpoint */
#define SIG_MMC_R_UDS_DIE2_SETPOINT (((UI_16) 28) | NODE_ID_MMC) /* Symbolic name of the signal MMC_r_uds_die2_setpoint */
#define SIG_MMC_SCU_GEARBOXPOSITIONTARGET (((UI_16) 29) | NODE_ID_MMC) /* Symbolic name of the signal MMC_SCU_GearboxPositionTarget */
#define SIG_MMC_UDS_SETPOINTS_CRC (((UI_16) 30) | NODE_ID_MMC) /* Symbolic name of the signal MMC_uds_setpoints_crc */
#define SIG_MMC_UDS_SETPOINTS_RC (((UI_16) 31) | NODE_ID_MMC) /* Symbolic name of the signal MMC_uds_setpoints_rc */
/* Last tx signal */
#define INTERNALLAST_TX_STA_LEN_SIGNAL_SYMBOLIC_NAME ((~NODE_ID_MASK) & SIG_MMC_UDS_SETPOINTS_RC)


/* Symbolic names for Rx signals */ 
#define SIG_SMC_BMAR_SNS (((UI_16) 32) | NODE_ID_MMC) /* Symbolic name of the signal SMC_bmar_sns */
#define SIG_SMC_CALIBRATION_NOP (((UI_16) 33) | NODE_ID_MMC) /* Symbolic name of the signal SMC_calibration_NOP */
#define SIG_SMC_FW_VERSION (((UI_16) 34) | NODE_ID_MMC) /* Symbolic name of the signal SMC_fw_version */
#define SIG_SMC_MELEXIS_DIAGNOSTICS (((UI_16) 35) | NODE_ID_MMC) /* Symbolic name of the signal SMC_melexis_diagnostics */
#define SIG_SMC_MLX_COOK_DIE1 (((UI_16) 36) | NODE_ID_MMC) /* Symbolic name of the signal SMC_MLX_cook_die1 */
#define SIG_SMC_MLX_COOK_DIE2 (((UI_16) 37) | NODE_ID_MMC) /* Symbolic name of the signal SMC_MLX_cook_die2 */
#define SIG_SMC_MLX_CURRENT_POSITION (((UI_16) 38) | NODE_ID_MMC) /* Symbolic name of the signal SMC_MLX_current_position */
#define SIG_SMC_MLX_RAW_DIE1 (((UI_16) 39) | NODE_ID_MMC) /* Symbolic name of the signal SMC_MLX_raw_die1 */
#define SIG_SMC_MLX_RAW_DIE2 (((UI_16) 40) | NODE_ID_MMC) /* Symbolic name of the signal SMC_MLX_raw_die2 */
#define SIG_SMC_MLX_TEMPERATURE_DIE1 (((UI_16) 41) | NODE_ID_MMC) /* Symbolic name of the signal SMC_MLX_temperature_die1 */
#define SIG_SMC_MLX_TEMPERATURE_DIE2 (((UI_16) 42) | NODE_ID_MMC) /* Symbolic name of the signal SMC_MLX_temperature_die2 */
#define SIG_SMC_MODE_CONTOLER (((UI_16) 43) | NODE_ID_MMC) /* Symbolic name of the signal SMC_mode_contoler */
#define SIG_SMC_RELAY_STATUS (((UI_16) 44) | NODE_ID_MMC) /* Symbolic name of the signal SMC_relay_status */
#define SIG_SMC_VBAT_MOTOR_SUP_SNS (((UI_16) 45) | NODE_ID_MMC) /* Symbolic name of the signal SMC_vbat_motor_sup_sns */

/* Symbolic names for Dummy signal */ 
#define INTERNALSIGDUMMY ((UI_16)0x0FFF) /* Symbolic name of the signal SIGDUMMY */


/*----------------------------- data types -------------------------------*/
/* Type definition of internal signals */
typedef SI_16 t_sig_mmc_p_uds_die1_setpoint;
typedef SI_16 t_sig_mmc_r_uds_die1_setpoint;
typedef SI_16 t_sig_mmc_n_uds_die1_setpoint;
typedef SI_16 t_sig_mmc_d_uds_die1_setpoint;
typedef SI_16 t_sig_mmc_p_uds_die2_setpoint;
typedef SI_16 t_sig_mmc_r_uds_die2_setpoint;
typedef SI_16 t_sig_mmc_n_uds_die2_setpoint;
typedef SI_16 t_sig_mmc_d_uds_die2_setpoint;
typedef UI_8 t_sig_mmc_p_lock_uds_offset;
typedef UI_8 t_sig_mmc_p_r_uds_offset;
typedef UI_8 t_sig_mmc_r_p_uds_offset;
typedef UI_8 t_sig_mmc_r_n_uds_offset;
typedef UI_8 t_sig_mmc_n_r_uds_offset;
typedef UI_8 t_sig_mmc_n_d_uds_offset;
typedef UI_8 t_sig_mmc_d_n_uds_offset;
typedef UI_8 t_sig_mmc_d_lock_uds_offset;
typedef SI_16 t_sig_mmc_uds_setpoints_rc;
typedef SI_8 t_sig_mmc_uds_setpoints_crc;
typedef UI_8 t_sig_mmc_p_out_uds_offset;
typedef UI_8 t_sig_mmc_d_out_uds_offset;
typedef UI_8 t_sig_mmc_scu_gearboxpositiontarget;
typedef UI_8 t_sig_mmc_gearleverpositionextended_v2;
typedef UI_8 t_sig_mmc_clock_atcu_a112;
typedef UI_8 t_sig_mmc_crc_atcu_a112;
typedef UI_8 t_sig_mmc_ignitionsupplyconfirmation;
typedef UI_8 t_sig_mmc_actu_uds_mode;
typedef UI_8 t_sig_mmc_mlx_position;
typedef SI_16 t_sig_mmc_melexis_virtual_die1;
typedef SI_16 t_sig_mmc_melexis_virtual_die2;
typedef UI_8 t_sig_mmc_relay_selfcheck_request;
typedef UI_8 t_sig_mmc_application_mode;
typedef SI_16 t_sig_smc_mlx_cook_die1;
typedef SI_16 t_sig_smc_mlx_cook_die2;
typedef UI_8 t_sig_smc_mode_contoler;
typedef SI_8 t_sig_smc_mlx_current_position;
typedef UI_16 t_sig_smc_vbat_motor_sup_sns;
typedef UI_16 t_sig_smc_bmar_sns;
typedef SI_16 t_sig_smc_mlx_raw_die1;
typedef SI_16 t_sig_smc_mlx_raw_die2;
typedef UI_8 t_sig_smc_mlx_temperature_die1;
typedef UI_8 t_sig_smc_mlx_temperature_die2;
typedef UI_8 t_sig_smc_fw_version;
typedef UI_8 t_sig_smc_melexis_diagnostics;
typedef UI_8 t_sig_smc_relay_status;
typedef UI_8 t_sig_smc_calibration_nop[8];


#ifndef _FICOSEKCOM_H
#define _FICOSEKCOM_H

/* Type definition of the symbolic names for signals */
typedef UI_16 t_symbolic_name;
typedef UI_16 t_symbolic_frm_name;

/* Return type of the calls OSEK COM */
typedef UI_8 t_status_type;

/* Structure of data type passed by reference in */
/* the calls of OSEK COM                         */
typedef void *t_application_data_ref;
typedef void *t_length_ref; 

/* Flag types of OSEK COM */
typedef enum {
    COM_FALSE = 0x00, /* Flag down  */
    COM_TRUE  = 0x01  /* Flag up */
} t_flag_value;

/* Stop mode of OSEK COM */
typedef enum {
    COM_SHUTDOWN_IMMEDIATE = 0 /* Apagat immediat */
} t_com_shutdown_mode_type;

/* Initialize mode of OSEK COM */
typedef enum {
    COM_NORMAL_MODE = 0 /* No es processen trames de COM de Debug */
} t_com_application_mode_type;

#endif

/*--------------------------- global variables ---------------------------*/


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

/*****************************************************************************
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine specification:
|  * Reception callback Routine of COM frames
|---------------------------------------------------------------------------
| Parameters description:
|---------------------------------------------------------------------------
| CPU requirements data:
| Tmax: ?? cpu cycles | O(n): CTE 
/---------------------------------------------------------------------------*/
void InternalOsekComRxNotifCallbackMMC(t_com_buf_hdl bhdl);

/*****************************************************************************
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine specification:
|  * Transmission callback Routine of COM frames
|---------------------------------------------------------------------------
| Parameters description:
|---------------------------------------------------------------------------
| CPU requirements data:
| Tmax: ?? cpu cycles | O(n): CTE 
/---------------------------------------------------------------------------*/
BOOL InternalOsekComTxReqCallbackMMC(void);

/*****************************************************************************
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine specification:
|  * Notifying transmission callback Routine of COM frames
|---------------------------------------------------------------------------
| Parameters description:
|---------------------------------------------------------------------------
| CPU requirements data:
| Tmax: ?? cpu cycles | O(n): CTE 
/---------------------------------------------------------------------------*/
void InternalOsekComTxNotifCallbackMMC(t_com_buf_hdl bhdl);

/*****************************************************************************
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine specification:
|  * Initialize service of OSEK COM in the selected mode
|
| ------------------------------------------------- --------------------------
| Explanation of arguments:
| App_mode: activation model of communications.
| Result: if all goes well E_OK
| Another code (see t_status_type) if an error occurs.
|---------------------------------------------------------------------------
| Temporitzacio:
| Tmax: ?? cicles cpu | O(n): CTE 
/---------------------------------------------------------------------------*/
t_status_type InternalStartCom(t_com_application_mode_type app_mode);

/*****************************************************************************
| Portability: Generic
| ----------------------------------------------------------------------------
| Contract transactions:
| * Service inquiry mode in which communications are initialized
| COM.
| * If this service is called before initializing the communications
| Random mode will be returned.
| ---------------------------------------------------------------------------
| Explanation of arguments:
| Result: how they have been enabled communications
| (See t_com_application_mode_type)
| ---------------------------------------------------------------------------
| Timing:
| Tmax: 15 cpu cycles | O (n): CTE
/ --------------------------------------------------------------------------- */
t_com_application_mode_type InternalGetComApplicationMode(void);

/*****************************************************************************
| Portability: Generic
| ----------------------------------------------------------------------------
| Contract transactions:
| * Service stopped the activity of OSEK COM communications.
| * This service stops the transmission of messages periodically.
| * After calling this service communications can be reestablished
| Calling service StartCom. (At no time this service modifies the state
| COM driver).
| ---------------------------------------------------------------------------
| Explanation of arguments:
| App_mode: Stop mode communications.
| Result: if all goes well E_OK
| Another code (see t_status_type) if an error occurs.
| ---------------------------------------------------------------------------
| Timing:
| Tmax:? cpu cycles | O (n): CTE
/ --------------------------------------------------------------------------- */
t_status_type InternalStopCom(t_com_shutdown_mode_type shtdwn_mode);

/*****************************************************************************
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine specification:
|  * Initialize service transmission of periodic or mix frames.
|  * If the transmission of periodic or mix frames is initialized, this service
|    reboot the communication.
|---------------------------------------------------------------------------
| Parameters description:
|   return: 
|     E_OK in case of no errors
|     Other (see t_status_type).
|---------------------------------------------------------------------------
| CPU requirements data:
| Tmax: ?? cpu cycles | O(n): CTE 
/---------------------------------------------------------------------------*/
t_status_type InternalStartPeriodic(void);

/*****************************************************************************
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine specification:
|  * Stop service transmission of periodic or mix frames.
|  * If the transmission of periodic or mix frames is stopped, you can restart
|    it calling the StartPeriodic service.
|---------------------------------------------------------------------------
| Parameters description:
|   return: 
|     E_OK in case of no errors
|     Other (see t_status_type).
|---------------------------------------------------------------------------
| CPU requirements data:
| Tmax: ?? cpu cycles | O(n): CTE 
/---------------------------------------------------------------------------*/
t_status_type InternalStopPeriodic(void);

/*****************************************************************************
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine specification:
|  * This service updates the application signal referenced by >data_ref< with
|    the data in the internal object identified by >message<.
|  * This service will reset the class 1 and 3 flags associated to >message<
|  * If >message< is an unqueued signal the service will return the last value
|    received.
|    If >message< is a queued signal the service will return the first value
|    available in the queue or error if the queue is empty. (Mode not suported)
|  * The software engineer is resposible of granting that the parameter >data_ref< 
|    points to an address correctly allocated and compatible in size with the 
|    received signal type
|  * Usage example: 
|    t_vehicle_speed vehicle_speed;
|    (void)ReceiveMessage(SIG_VEHICLE_SPEED,&vehicle_speed); 
|---------------------------------------------------------------------------
| Parameters description:
|   message: Identification of the received signal.
|   data_ref: Pointer to the application area where to store the received signal. 
|   return: 
|     E_OK in case of no errors
|     E_COM_ID in case the parameter >message< is out of range or if it refers
|              to signal that is sent or to a dynamiclength or zero-length signal
|     E_COM_NOMSG in case the queued signal identified by >message< is empty.
|     E_COM_LIMIT in case an overflow of the signal queue identified by >message<
|                 occurred since the last call to ReceiveMessage for >message<.
|                 E_COM_LIMIT indicates that at least one message has been discarded
|                 since the message queue filled. Nevertheless the service is 
|                 performed and a message is returned. The service ReceiveMessage
|                 clears the overflow condition for >message<.
|     other (see t_status_type).
|---------------------------------------------------------------------------
| CPU resources data:
| Tmax: ?? cpu cycles | O(n): CTE 
/---------------------------------------------------------------------------*/
t_status_type InternalReceiveMessage(t_symbolic_name message,
                             t_application_data_ref data_ref);

/*****************************************************************************
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine specification:
|  * This service updates the internal signal object identified by >message<
|    with the application signal referenced by the >data_ref< parameter.
|  * This service will reset the class 2 and 4 flags associated to >message<
|  * If >message< has the Triggered Transfer Property, the update is followed
|    by immediate transmission of the I-PDU associated with the signal except
|    when the signal is packed into an I-PDU with Periodic Transmission Mode;
|    in this case, no transmission is initiated by the call to this service.
|  * If >message< has the Pending Transfer Property, no transmission is
|    caused by the update.
|  * The software engineer is resposible of granting that the parameter >data_ref< 
|    points to an address correctly allocated and compatible in size with the 
|    transmited signal type
|  * Usage example: 
|    t_vehicle_speed vehicle_speed = 20;
|    (void)SendMessage(SIG_VEHICLE_SPEED,&vehicle_speed); 
|---------------------------------------------------------------------------
| Parameters description:
|   message: Identification of the transmited signal.
|   data_ref: Pointer to the application signal where is the value to be transmited. 
|   return: 
|     E_OK in case of no errors
|     E_COM_ID is case the parameter >message< is out of range or if it refers
|              to a message that is received or to a dynamic-length or 
|              zero-length message.
|     other (see t_status_type).
|---------------------------------------------------------------------------
| CPU requirements data:
| Tmax: ?? cpu cycles | O(n): CTE 
/---------------------------------------------------------------------------*/
#define OSEK_INTERNALSENDMESSAGE
t_status_type InternalSendMessage(t_symbolic_name message,
                          t_application_data_ref data_ref);

/*****************************************************************************
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine specification:
|  * Initialize service message with a different value than configuration.
|  * The software engineer is responsible of garanting that the parameter 'data_ref' 
|    points to an address correctly allocated and compatible in size with the 
|    transmitted signal type.
|---------------------------------------------------------------------------
| Parameters description:
|   message: Identification of the received signal.
|   data_ref: Pointer to the application area where to store the received signal. 
|   return: 
|     E_OK in case of no errors
|     E_COM_ID if the message or signal to initialize don't exist
|     Other (see t_status_type).
|---------------------------------------------------------------------------
| CPU requirements data:
| Tmax: ?? cpu cycles | O(n): CTE 
/---------------------------------------------------------------------------*/
t_status_type InternalInitMessage(t_symbolic_name message,
                          t_application_data_ref data_ref);

/*****************************************************************************
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine specification:
|  * Consult service for the flag of COM traffic.
|---------------------------------------------------------------------------
| Parameters description:
|   return: 
|     COM_FALSE if the flag is down
|     COM_TRUE  if the flag is up
|---------------------------------------------------------------------------
| CPU requirements data:
| Tmax: ?? cpu cycles | O(n): CTE 
/---------------------------------------------------------------------------*/
t_flag_value InternalReadFlagComTrafficMMC(void);

/*****************************************************************************
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine specification:
|  * Reset service for the flag of COM traffic.
|---------------------------------------------------------------------------
| Parameters description:
|---------------------------------------------------------------------------
| CPU requirements data:
| Tmax: ?? cpu cycles | O(n): CTE 
/---------------------------------------------------------------------------*/
void InternalResetFlagComTrafficMMC(void);

/*****************************************************************************
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine specification:
|  * Consult service for the notify Rx Rx_Error Tx Tx_Error
|---------------------------------------------------------------------------
| Parameters description:
|   message: Identification of the signal flag.
|   return: 
|     COM_FALSE if the flag is down
|     COM_TRUE  if the flag is up
|---------------------------------------------------------------------------
| CPU requirements data:
| Tmax: ?? cpu cycles | O(n): CTE 
/---------------------------------------------------------------------------*/
t_flag_value InternalReadFlagRxSig(t_symbolic_name message);
t_flag_value InternalReadFlagRxSigSMC_MLX_cook_die1(void);
t_flag_value InternalReadFlagRxSigSMC_MLX_cook_die2(void);
t_flag_value InternalReadFlagRxSigSMC_mode_contoler(void);
t_flag_value InternalReadFlagRxSigSMC_MLX_current_position(void);
t_flag_value InternalReadFlagRxSigSMC_vbat_motor_sup_sns(void);
t_flag_value InternalReadFlagRxSigSMC_bmar_sns(void);
t_flag_value InternalReadFlagRxSigSMC_MLX_raw_die1(void);
t_flag_value InternalReadFlagRxSigSMC_MLX_raw_die2(void);
t_flag_value InternalReadFlagRxSigSMC_MLX_temperature_die1(void);
t_flag_value InternalReadFlagRxSigSMC_MLX_temperature_die2(void);
t_flag_value InternalReadFlagRxSigSMC_fw_version(void);
t_flag_value InternalReadFlagRxSigSMC_melexis_diagnostics(void);
t_flag_value InternalReadFlagRxSigSMC_relay_status(void);
t_flag_value InternalReadFlagRxSigSMC_calibration_NOP(void);
t_flag_value InternalReadFlagRxErrorSig(t_symbolic_name message);
t_flag_value InternalReadFlagRxErrorSigSMC_MLX_cook_die1(void);
t_flag_value InternalReadFlagRxErrorSigSMC_MLX_cook_die2(void);
t_flag_value InternalReadFlagRxErrorSigSMC_mode_contoler(void);
t_flag_value InternalReadFlagRxErrorSigSMC_MLX_current_position(void);
t_flag_value InternalReadFlagRxErrorSigSMC_vbat_motor_sup_sns(void);
t_flag_value InternalReadFlagRxErrorSigSMC_bmar_sns(void);
t_flag_value InternalReadFlagRxErrorSigSMC_MLX_raw_die1(void);
t_flag_value InternalReadFlagRxErrorSigSMC_MLX_raw_die2(void);
t_flag_value InternalReadFlagRxErrorSigSMC_MLX_temperature_die1(void);
t_flag_value InternalReadFlagRxErrorSigSMC_MLX_temperature_die2(void);
t_flag_value InternalReadFlagRxErrorSigSMC_fw_version(void);
t_flag_value InternalReadFlagRxErrorSigSMC_melexis_diagnostics(void);
t_flag_value InternalReadFlagRxErrorSigSMC_relay_status(void);
t_flag_value InternalReadFlagRxErrorSigSMC_calibration_NOP(void);
t_flag_value InternalReadFlagTxSig(t_symbolic_name message);
t_flag_value InternalReadFlagTxSigMMC_p_uds_die1_setpoint(void);
t_flag_value InternalReadFlagTxSigMMC_r_uds_die1_setpoint(void);
t_flag_value InternalReadFlagTxSigMMC_n_uds_die1_setpoint(void);
t_flag_value InternalReadFlagTxSigMMC_d_uds_die1_setpoint(void);
t_flag_value InternalReadFlagTxSigMMC_p_uds_die2_setpoint(void);
t_flag_value InternalReadFlagTxSigMMC_r_uds_die2_setpoint(void);
t_flag_value InternalReadFlagTxSigMMC_n_uds_die2_setpoint(void);
t_flag_value InternalReadFlagTxSigMMC_d_uds_die2_setpoint(void);
t_flag_value InternalReadFlagTxSigMMC_p_lock_uds_offset(void);
t_flag_value InternalReadFlagTxSigMMC_p_r_uds_offset(void);
t_flag_value InternalReadFlagTxSigMMC_r_p_uds_offset(void);
t_flag_value InternalReadFlagTxSigMMC_r_n_uds_offset(void);
t_flag_value InternalReadFlagTxSigMMC_n_r_uds_offset(void);
t_flag_value InternalReadFlagTxSigMMC_n_d_uds_offset(void);
t_flag_value InternalReadFlagTxSigMMC_d_n_uds_offset(void);
t_flag_value InternalReadFlagTxSigMMC_d_lock_uds_offset(void);
t_flag_value InternalReadFlagTxSigMMC_uds_setpoints_rc(void);
t_flag_value InternalReadFlagTxSigMMC_uds_setpoints_crc(void);
t_flag_value InternalReadFlagTxSigMMC_p_out_uds_offset(void);
t_flag_value InternalReadFlagTxSigMMC_d_out_uds_offset(void);
t_flag_value InternalReadFlagTxSigMMC_SCU_GearboxPositionTarget(void);
t_flag_value InternalReadFlagTxSigMMC_GearLeverPositionExtended_v2(void);
t_flag_value InternalReadFlagTxSigMMC_Clock_ATCU_A112(void);
t_flag_value InternalReadFlagTxSigMMC_CRC_ATCU_A112(void);
t_flag_value InternalReadFlagTxSigMMC_IgnitionSupplyConfirmation(void);
t_flag_value InternalReadFlagTxSigMMC_ACTU_uds_mode(void);
t_flag_value InternalReadFlagTxSigMMC_mlx_position(void);
t_flag_value InternalReadFlagTxSigMMC_melexis_virtual_die1(void);
t_flag_value InternalReadFlagTxSigMMC_melexis_virtual_die2(void);
t_flag_value InternalReadFlagTxSigMMC_relay_selfcheck_request(void);
t_flag_value InternalReadFlagTxSigMMC_application_mode(void);

/*****************************************************************************
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine specification:
|  * Reset service for the notify Rx Rx_Error Tx Tx_Error
|---------------------------------------------------------------------------
| Parameters description:
|   message: Identification of the signal flag.
|---------------------------------------------------------------------------
| CPU requirements data:
| Tmax: ?? cpu cycles | O(n): CTE 
/---------------------------------------------------------------------------*/
void InternalResetFlagRxSig(t_symbolic_name message);
void InternalResetFlagRxSigSMC_MLX_cook_die1(void);
void InternalResetFlagRxSigSMC_MLX_cook_die2(void);
void InternalResetFlagRxSigSMC_mode_contoler(void);
void InternalResetFlagRxSigSMC_MLX_current_position(void);
void InternalResetFlagRxSigSMC_vbat_motor_sup_sns(void);
void InternalResetFlagRxSigSMC_bmar_sns(void);
void InternalResetFlagRxSigSMC_MLX_raw_die1(void);
void InternalResetFlagRxSigSMC_MLX_raw_die2(void);
void InternalResetFlagRxSigSMC_MLX_temperature_die1(void);
void InternalResetFlagRxSigSMC_MLX_temperature_die2(void);
void InternalResetFlagRxSigSMC_fw_version(void);
void InternalResetFlagRxSigSMC_melexis_diagnostics(void);
void InternalResetFlagRxSigSMC_relay_status(void);
void InternalResetFlagRxSigSMC_calibration_NOP(void);
void InternalResetFlagRxErrorSig(t_symbolic_name message);
void InternalResetFlagRxErrorSigSMC_MLX_cook_die1(void);
void InternalResetFlagRxErrorSigSMC_MLX_cook_die2(void);
void InternalResetFlagRxErrorSigSMC_mode_contoler(void);
void InternalResetFlagRxErrorSigSMC_MLX_current_position(void);
void InternalResetFlagRxErrorSigSMC_vbat_motor_sup_sns(void);
void InternalResetFlagRxErrorSigSMC_bmar_sns(void);
void InternalResetFlagRxErrorSigSMC_MLX_raw_die1(void);
void InternalResetFlagRxErrorSigSMC_MLX_raw_die2(void);
void InternalResetFlagRxErrorSigSMC_MLX_temperature_die1(void);
void InternalResetFlagRxErrorSigSMC_MLX_temperature_die2(void);
void InternalResetFlagRxErrorSigSMC_fw_version(void);
void InternalResetFlagRxErrorSigSMC_melexis_diagnostics(void);
void InternalResetFlagRxErrorSigSMC_relay_status(void);
void InternalResetFlagRxErrorSigSMC_calibration_NOP(void);
void InternalResetFlagTxSig(t_symbolic_name message);
void InternalResetFlagTxSigMMC_p_uds_die1_setpoint(void);
void InternalResetFlagTxSigMMC_r_uds_die1_setpoint(void);
void InternalResetFlagTxSigMMC_n_uds_die1_setpoint(void);
void InternalResetFlagTxSigMMC_d_uds_die1_setpoint(void);
void InternalResetFlagTxSigMMC_p_uds_die2_setpoint(void);
void InternalResetFlagTxSigMMC_r_uds_die2_setpoint(void);
void InternalResetFlagTxSigMMC_n_uds_die2_setpoint(void);
void InternalResetFlagTxSigMMC_d_uds_die2_setpoint(void);
void InternalResetFlagTxSigMMC_p_lock_uds_offset(void);
void InternalResetFlagTxSigMMC_p_r_uds_offset(void);
void InternalResetFlagTxSigMMC_r_p_uds_offset(void);
void InternalResetFlagTxSigMMC_r_n_uds_offset(void);
void InternalResetFlagTxSigMMC_n_r_uds_offset(void);
void InternalResetFlagTxSigMMC_n_d_uds_offset(void);
void InternalResetFlagTxSigMMC_d_n_uds_offset(void);
void InternalResetFlagTxSigMMC_d_lock_uds_offset(void);
void InternalResetFlagTxSigMMC_uds_setpoints_rc(void);
void InternalResetFlagTxSigMMC_uds_setpoints_crc(void);
void InternalResetFlagTxSigMMC_p_out_uds_offset(void);
void InternalResetFlagTxSigMMC_d_out_uds_offset(void);
void InternalResetFlagTxSigMMC_SCU_GearboxPositionTarget(void);
void InternalResetFlagTxSigMMC_GearLeverPositionExtended_v2(void);
void InternalResetFlagTxSigMMC_Clock_ATCU_A112(void);
void InternalResetFlagTxSigMMC_CRC_ATCU_A112(void);
void InternalResetFlagTxSigMMC_IgnitionSupplyConfirmation(void);
void InternalResetFlagTxSigMMC_ACTU_uds_mode(void);
void InternalResetFlagTxSigMMC_mlx_position(void);
void InternalResetFlagTxSigMMC_melexis_virtual_die1(void);
void InternalResetFlagTxSigMMC_melexis_virtual_die2(void);
void InternalResetFlagTxSigMMC_relay_selfcheck_request(void);
void InternalResetFlagTxSigMMC_application_mode(void);

/*****************************************************************************
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine specification:
|  * Main task of OSEK/COM that must be called periodically in
|    the main loop of the program.
|---------------------------------------------------------------------------
| Parameters description:
|---------------------------------------------------------------------------
| CPU requirements data:
| Tmax: ?? cpu cycles | O(n): CTE 
/---------------------------------------------------------------------------*/
void InternalOsekComTask(void);

#endif

