

#ifndef LINE_IN_H__
#define LINE_IN_H__

#include "common.h"
#include "string.h"

/*
Note !  NOW LineIn only support 254 channel!!!!!
Note !  NOW LineIn only support 254 channel!!!!!
Note !  NOW LineIn only support 254 channel!!!!!
Note !  NOW LineIn only support 254 channel!!!!!
Note !  NOW LineIn only support 254 channel!!!!!
*/

/*鎵?鏈夌‖绾胯緭鍏ョ殑绱㈠紩*/
typedef enum
{
    LINE_IN_RightTurn = 0u, 
    LINE_IN_LeftTurn,
    LINE_IN_HighBeam,
    LINE_IN_ABS,
    LINE_IN_AutoStarStop,
    LINE_IN_TirePressure,
    LINE_IN_OilPressure,
    LINE_IN_OBD,
	
    LINE_IN_NUMBER,
} Line_In_Channel_en_t;




/*鑾峰彇瀹炴椂纭嚎鐢靛钩鍑芥暟鎸囬拡*/
typedef struct
{

    LINE_IN_WorkSt_en_t enPowerStatus;      /*纭嚎宸ヤ綔鐨勭數婧愮姸鎬?*/
    uint16_t u16ValidTime;                  /*浠庢棤鏁堝埌鏈夋晥鐨勬秷鎶栨椂闂? ms*/
    uint16_t u16InvalidTime;                /*浠庢湁鏁堝埌鏃犳晥鐨勬秷鎶栨椂闂?*/
    uint8_t (*pfnLineIn_Read_Cbk)(void);    /*鑾峰彇瀹炴椂鐢靛钩鐨勫洖璋冨嚱鏁?*/
} Line_In_Attribute_st_t;



extern void Line_In_SetPowerSt(LINE_IN_WorkSt_en_t u8PowerSt);
/*10ms璋冪敤*/
extern void Line_In_Debounce_Service(void);

extern LineIn_LogicLevel_en_t Line_In_Get_Status(uint8_t Channel);

extern void Line_In_KL30_Init(void);
extern void Line_In_KL15_ON_Init(void);
extern void Line_In_KL15_OFF_Init(void);



extern uint8_t LINE_IN_Get_RightTurn(void);
extern uint8_t LINE_IN_Get_LeftTurn(void);
extern uint8_t LINE_IN_Get_HighBeam(void);
extern uint8_t LINE_IN_Get_ABS(void);
extern uint8_t LINE_IN_Get_AutoStarStop(void);
extern uint8_t LINE_IN_Get_TirePressure(void);
extern uint8_t LINE_IN_Get_OilPressure(void);
extern uint8_t LINE_IN_Get_OBD(void);

#endif
