

#ifndef RTE_H
#define RTE_H

#include <stddef.h>                     // Defines NULL
#include <stdbool.h>                    // Defines true
#include <stdlib.h>                     // Defines EXIT_FAILURE
#include "../P417_SWTR_App_ert_rtw/rtwtypes.h"
//For SWTL

//#include "Global.h"


extern uint8_T Two_Finger_X_count;

extern uint8_T X_count;

extern uint8_T Two_Finger_Y_count;


extern uint8_T Y_count;


#if 1
extern uint16_T Touch_Sensor_Sts00;
extern uint16_T Touch_Sensor_Sts01;
extern uint16_T Touch_Sensor_Sts02;
extern uint16_T Touch_Sensor_Sts03;
extern uint16_T Touch_Sensor_Sts04;
extern uint16_T Touch_Sensor_Sts05;
extern uint16_T Touch_Sensor_Sts06;
extern uint16_T Touch_Sensor_Sts07;
extern uint16_T Touch_Sensor_Sts08;
extern uint16_T Touch_Sensor_Sts09;
extern uint16_T Touch_Sensor_Sts10;
extern uint16_T Touch_Sensor_Sts11;
extern uint16_T Touch_Sensor_Sts12;
extern uint16_T Touch_Sensor_Sts13;
extern uint16_T Touch_Sensor_Sts14;

extern uint16_T Touch_Sensor_Ref00;
extern uint16_T Touch_Sensor_Ref01;
extern uint16_T Touch_Sensor_Ref02;
extern uint16_T Touch_Sensor_Ref03;
extern uint16_T Touch_Sensor_Ref04;
extern uint16_T Touch_Sensor_Ref05;
extern uint16_T Touch_Sensor_Ref06;
extern uint16_T Touch_Sensor_Ref07;
extern uint16_T Touch_Sensor_Ref08;
extern uint16_T Touch_Sensor_Ref09;
extern uint16_T Touch_Sensor_Ref10;
extern uint16_T Touch_Sensor_Ref11;
extern uint16_T Touch_Sensor_Ref12;
extern uint16_T Touch_Sensor_Ref13;
extern uint16_T Touch_Sensor_Ref14;

extern uint16_T Touch_Sensor_delta00;
extern uint16_T Touch_Sensor_delta01;
extern uint16_T Touch_Sensor_delta02;
extern uint16_T Touch_Sensor_delta03;
extern uint16_T Touch_Sensor_delta04;
extern uint16_T Touch_Sensor_delta05;
extern uint16_T Touch_Sensor_delta06;
extern uint16_T Touch_Sensor_delta07;
extern uint16_T Touch_Sensor_delta08;
extern uint16_T Touch_Sensor_delta09;
extern uint16_T Touch_Sensor_delta10;
extern uint16_T Touch_Sensor_delta11;
extern uint16_T Touch_Sensor_delta12;
extern uint16_T Touch_Sensor_delta13;
extern uint16_T Touch_Sensor_delta14;

#endif

//Input Sensor
//uint16_t RTE_Get_Power_AD_SNS(void);//to get power voltage
extern uint16_T Fr08_send_flag;
uint8_T RTE_Get_SldVolCtrlSts(void);

//uint8_T RTE_Get_Pressure_Sensor_xxxx(void);//IIC DATA?
uint8_T RTE_Get_TouchBoard_CRC(void);


//button Not active,Touch,Touch and Press,invalid from sensor
uint8_T RTE_Get_TouchBoard_Up_Sts(void);
uint8_T RTE_Get_TouchBoard_Down_Sts(void);
uint8_T RTE_Get_TouchBoard_Left_Sts(void);
uint8_T RTE_Get_TouchBoard_Right_Sts(void);
uint8_T RTE_Get_TouchBoard_Center_Sts(void);
uint8_T RTE_Get_TouchBoard_VOICE1_Sts(void);//TJP1
uint8_T RTE_Get_TouchBoard_VOICE2_Sts(void);//TJP2
uint8_T RTE_Get_TouchBoard_MENU1_Sts(void);//Resume1
uint8_T RTE_Get_TouchBoard_MENU2_Sts(void);//Resume2
uint8_T RTE_Get_TouchBoard_VOL1_Sts(void);//Cancel1
uint8_T RTE_Get_TouchBoard_VOL2_Sts(void);//Cancel2


//touch borad left/right slide: 0:idle, 1:short slide left 2:short slide right 3:long slide left 4:long slide right
uint8_T RTE_Get_TouchBoard_Left_Right_Slide_Sts(void);

//touch borad Up/Down slide: 0:idle, 1:short slide up 2:short slide down 3:long slide up 4:long slide down
uint8_T RTE_Get_TouchBoard_Up_Down_Slide_Sts(void);

//uint8_T RTE_Get_INTB_PRSS_SNS(void);



//uint8_T RTE_Get_X1_SNS(void);
//uint8_T RTE_Get_X2_SNS(void);
//uint8_T RTE_Get_X3_SNS(void);
//uint8_T RTE_Get_X4_SNS(void);
//uint8_T RTE_Get_X5_SNS(void);
uint8_T RTE_Get_X_SNS(void);


//uint8_T RTE_Get_Y1_SNS(void);
//uint8_T RTE_Get_Y2_SNS(void);
//uint8_T RTE_Get_Y3_SNS(void);
//uint8_T RTE_Get_Y4_SNS(void);
//uint8_T RTE_Get_Y5_SNS(void);
uint8_T RTE_Get_Y_SNS(void);

uint8_T RTE_Get_TouchBoard_XY_Sts(void);//Not active,Touch,Touch and Press,invalid from sensor
uint8_T RTE_Get_TouchBoard_XY_Touch_And_Below_1N(void);


uint8_T RTE_Get_Pad_XY_trig(void);
uint8_T RTE_Get_Voice_XY_trig(void);
uint8_T RTE_Get_Menu_XY_trig(void);
uint8_T RTE_Get_Vol_XY_trig(void);


uint8_T RTE_Get_ACT_FAULT_OUT_SNS(void);
uint8_T RTE_Get_ACT_LD_OUT_SNS(void);


//Input CAN

//LED on off control
uint8_T RTE_Get_CAN_ActvnOfSteerWhlIllmn(void);
//LED Day/Night Mode switch
uint8_T RTE_Get_CAN_TwliBriSts(void);


uint8_T RTE_Get_CAN_IntrBriSts(void);

uint8_T RTE_Get_CAN_SteerWhlTouchBdLeFaildFb(void);

uint8_T RTE_Get_CAN_SwtOfKeyTone(void);

//Vibration control
uint8_T RTE_Get_CAN_VibrationFbToSwtp(void);

uint8_T RTE_Get_CAN_IhuPrivateDHUCanFr01_Frame_Timeout(void);//0x030 frame


//Output Control

void RTE_Set_illumination_BL_PWM(uint32_T Percent);

//void RTE_Set_Power_AD_Ctrl(uint8_T Value);//to enable power AD diag

//ACT control??
void RTE_Set_ACT_Vibration(uint8_T Value);
//void RTE_Set_Gain0(uint8_T Value);
//void RTE_Set_Gain1(uint8_T Value);
//void RTE_Set_SDZ(uint8_T Value);
//void RTE_Set_INP(uint8_T Value);

//Output CAN
void RTE_Set_CAN_RiMFctActSgCe(uint8_T Value);
void RTE_Set_CAN_RiMFctActSgDn(uint8_T Value);
void RTE_Set_CAN_RiMFctActSgLe(uint8_T Value);
void RTE_Set_CAN_RiMFctActSgRi(uint8_T Value);
void RTE_Set_CAN_RiMFctActSgUp(uint8_T Value);

void RTE_Set_CAN_SteerWhlTouchBdVoice(uint8_T Value);

void RTE_Set_CAN_SwpLeRiStsRi(uint8_T Value);

void RTE_Set_CAN_SwpUpDwnStsRi(uint8_T Value);

void RTE_Set_CAN_SldVolCtrlSts(uint8_T Value);

void RTE_Set_CAN_DiagcFailrTouchPanSWTRCmnFltSts(uint8_T Value);

void RTE_Set_CAN_DiagcFailrTouchPanSWTRTouchdFltSts(uint8_T Value);

void RTE_Set_CAN_DiagcFailrTouchPanSWTRVibrationFltSts(uint8_T Value);

void RTE_Set_CAN_DiagcFailrTouchPanSWTRSnsrFltSts(uint8_T Value);



void RTE_Set_CAN_SteerWhlTouchBdMenu(uint8_T Value);


void RTE_Set_CAN_SteerWhlTouchBdDn(uint8_T Value);

void RTE_Set_CAN_SteerWhlTouchBdRiChks(uint8_T Value);

void RTE_Set_CAN_SteerWhlTouchBdRiCntr(uint8_T Value);

void RTE_Set_CAN_SteerWhlTouchBdRiSteerWhlTouchBdSts(uint8_T Value);


void RTE_Set_CAN_SteerWhlTouchBdRiTouchPosnX(uint8_T Value);
void RTE_Set_CAN_SteerWhlTouchBdRiTouchPosnY(uint8_T Value);

void RTE_Set_SEND_CAN_0x309_immediately(uint8_T Value); //called immediately when touch,or touch and press in XY area
void RTE_Set_SEND_CAN_0x307_25ms(uint8_T Value); // when touch,or touch and press in 3 button area,0x305 is sent every 25ms


void RTE_Set_SEND_CAN_0x307_1000ms(uint8_T Value); // when  3 button area is not active,0x305 is Sent every 1000ms

void RTE_Set_All_UB(void);
void RTE_Set_All_Test_Value(void);

#endif
