/*
 * TJA1145FD_Applhint.h
 *
 *  Created on: Nov 21, 2019
 *      Author: B33124
 */

#ifndef PHY_TJA1145_INCLUDE_TJA1145FD_APPLHINT_H_
#define PHY_TJA1145_INCLUDE_TJA1145FD_APPLHINT_H_

#include <TJA1145FD_Application_Specific_Functions.h>

#if 0
volatile bool PendingEvent;

/// This variable indicates if a check of the transceiver status is required
/**
*   - 0 everything fine
*   - 1 check of transceiver status required
*/
extern volatile Byte CheckTrcvStatus;

/// This is the data structure/scheduler for requested application tasks
/**
* CHANGE_TO_SLEEP, CHANGE_TO_STANDBY, CHANGE_TO_NORMAL, EVENT_HANDLING, TRIGGER_WATCHDOG,
*	POLL_TRCV_STATUS, PORT_SUPERVISION can be scheduled
*/
extern PendingTask_t ApplTask[MAXTASKNO];

/// This variable indicates the write pointer variable of application task queue
extern volatile int ApplTaskPt_write;

/// This variable indicates the read pointer variable of application task queue
extern volatile int ApplTaskPt_read;

/// This is the data strcuture storing the failure entries
extern enum FailureEntries FailureMemory[MAXERRENTR];

/// This variable indicates the write pointer variable of failure memory
extern volatile int FailMemPt_write;

/// The variable indicates the device type
/**
* NXP_TJA1145 = 1, NXP_TJA1145FD = 2, NXP_UJA1164 = 3, NXP_UJA1167 = 4, NXP_UJA1167VX = 5, NXP_UJA1168 = 6,
* NXP_UJA1168FD = 7, NXP_UJA1168FDVX = 8, NXP_UJA1168VX = 9, NXP_UNKNOWN = 0,
*/
extern volatile Device_t DeviceType;

/// Global timer overflow counter variable. Increases every 1ms. Counts up to 3 and starts from the beginning
extern volatile int OverflowCnt;

/// This variable indicates, if the Startup operation has been finished
/**
*   - FALSE Startup Operation not finished
*   - TRUE Startup operation finished
*/
extern volatile bool StartupReady;

/// Reason for last wake-up
/**
* CANTRCV_WU_BY_BUS = 0, CANTRCV_WU_BY_PIN = 1, CANTRCV_WU_ERROR = 2, CANTRCV_WU_INTERNALLY = 3, CANTRCV_WU_NOT_SUPPORTED = 4,
*	CANTRCV_WU_POWER_ON = 5, CANTRCV_WU_RESET = 6, CANTRCV_WU_BY_SYSERR = 7
*/
extern volatile CanTrcv_TrcvWakeupReasonType WuReason;
#endif

void tja1145_main_task(void);
void tja1145_1_poll_task(void);
#endif /* PHY_TJA1145_INCLUDE_TJA1145FD_APPLHINT_H_ */
