/****************************************************************************** �� �� ����Line_In.c ������������·�����źŴ�������ͷ�ļ� �� �ߣ����� �� ����V1.1 �� �ڣ�2016.11.4 ******************************************************************************/ /****************************************************************************** ��·����IO�ܽ����ƶ��� ------------------------------------------------------------------------------- ע�⣺��GPIO.h�ж�����·�����Ӧ��IO�ܽ�ʱ������ʹ���±����г������� ------------------------------------------------------------------------------- ��·����IO�ܽ����� | ��Ч��ƽ | ���� ------------------------------------------------------------------------------- LINE_IN_KEY0 | �ߵ�ƽ | ����0���� LINE_IN_KEY0n | �͵�ƽ | LINE_IN_KEY1 | �ߵ�ƽ | ����1���� LINE_IN_KEY1n | �͵�ƽ | LINE_IN_KEY2 | �ߵ�ƽ | ����2���� LINE_IN_KEY2n | �͵�ƽ | ------------------------------------------------------------------------------- ******************************************************************************/ /****************************************************************************** �ź������б� ------------------------------------------------------------------------------ ˵����1.�ź����Ƶ���������Ϊ <��·����IO�ܽ�����>_SIGNAL .��ֲ����ʱӦ�ϸ��� ���еĹܽ�����������Ӧ��·�����IO�˿�, �����·��������Ӧ���ź��Զ��� Ϊ���� 2.��ͬ�����в�ͬ����·�����ź�,��˲��������б��������źŶ��ǿ��õ�.Ӧ�� ���õ��ź����Ʊ�ע���±���,���ڲ��� 3.��Line_In_Debounce_Service������20ms���ڵ��ú�, �����б��и������ź� ��״̬�����ⲿ��·����仯���仯,��Щ�źŵ�����������������,���ڹ����� �������ļ������ɵ��� 4.��Щ�źű�ʾ��·������߼�״̬,�� ��Ч(0ֵ) �� ��Ч(��0ֵ) ,������·�� ��ƽ�ߵ� ------------------------------------------------------------------------------ ��ǰ���� | �ź����� | ���� ------------------------------------------------------------------------------ | LINE_IN_EPB_SIGNAL | ����פ��״̬ | LINE_IN_ESPOFF_SIGNAL | ESP�ر�״̬ * | LINE_IN_KEY0_SIGNAL | ����0״̬(Timer����) * | LINE_IN_KEY1_SIGNAL | ����1״̬(Reset����) * | LINE_IN_KEY2_SIGNAL | ����2״̬(Trip ����) ------------------------------------------------------------------------------- ******************************************************************************/ #ifndef _LINE_IN_H_ #define _LINE_IN_H_ #include "GPIO.h" #include "Analog_Signal_Conversion.h" /****************************************************************************** ��������ʱ�䶨�� ******************************************************************************/ #define LINE_IN_DEBOUNCE_TIME 500 #define LINE_TIME 200 #define LINE_IN_DEBOUNCE_L_TIME 200 //2021.01.29��80��Ϊ200 /****************************************************************************** �ṹ�嶨�� ******************************************************************************/ typedef struct { uint8_t Current; uint8_t Last; uint16_t Timer; }LineInDebounceStruct; /****************************************************************************** �ź�Ԥ���� ******************************************************************************/ #define LINE_IN_DEBOUNCE_L_CNT (LINE_IN_DEBOUNCE_L_TIME / 20) #define LINE_IN_DEBOUNCE_CNT (LINE_IN_DEBOUNCE_TIME / 20) #define LINE_TIME_CNT (LINE_TIME / 20) /****************************************************************************** ������������ ******************************************************************************/ #define LINE_IN_DEBOUNCE_CYCLE 20 //������������������,��λms /***Key***/ extern volatile uint8_t KeyLeftinStatus; #define KEY_LEFT_IN KeyLeftinStatus #if ((defined KEY_LEFT_IN) || (defined KEY_LEFT_INn)) extern volatile uint8_t KeyLeftStatus; #define KEY_LEFT_SIGNAL KeyLeftStatus #define KEY_LEFT_DEFAULT 0 #define KEY_DEB_RISE 80 //����������ʱ��(ms) #define KEY_DEB_FALL 80 //�½�������ʱ��(ms) #endif extern volatile uint8_t KeyRightinStatus; #define KEY_RIGHT_IN KeyRightinStatus #if ((defined KEY_RIGHT_IN) || (defined KEY_RIGHT_INn)) extern volatile uint8_t KeyRightStatus; #define KEY_RIGHT_SIGNAL KeyRightStatus #define KEY_RIGHT_DEFAULT 0 #endif extern volatile uint8_t KeyEnterinStatus; #define KEY_ENTER_IN KeyEnterinStatus #if ((defined KEY_ENTER_IN) || (defined KEY_ENTER_INn)) extern volatile uint8_t KeyEnterStatus; #define KEY_ENTER_SIGNAL KeyEnterStatus #define KEY_ENTER_DEFAULT 0 #endif /***LED_SEATBELT_R ***/ //����ȫ�� #if ((defined LINE_IN_SEATBELT) || (defined LINE_IN_SEATBELTn)) extern volatile uint8_t LineInSEATBELTStatus; #define LINE_IN_SEATBELT_SIGNAL LineInSEATBELTStatus #define LINE_IN_SEATBELT_DEFAULT 0 #endif /***LED_POSITION_G ***/ #if ((defined LINE_IN_POSITION) || (defined LINE_IN_POSITIONn)) extern volatile uint8_t LineInPOSITIONStatus; #define LINE_IN_POSITION_SIGNAL LineInPOSITIONStatus #define LINE_IN_POSITION_DEFAULT 0 #endif //////////////////////////////////////////////////////////////////////// /***LED_MIL_Y ***/ #if ((defined LINE_IN_MIL) || (defined LINE_IN_MILn)) extern volatile uint8_t LineInMILStatus; #define LINE_IN_MIL_SIGNAL LineInMILStatus #define LINE_IN_MIL_DEFAULT 0 #endif /***PTO ***/ #if ((defined LINE_IN_PTO) || (defined LINE_IN_PTOn)) extern volatile uint8_t LineInPTOStatus; #define LINE_IN_PTO_SIGNAL LineInPTOStatus #define LINE_IN_PTO_DEFAULT 0 #endif /*** LINE_IN_BREAK_FLUID_SIGNAL ***/ #if ((defined LINE_IN_BREAK_FLUID) || (defined LINE_IN_BREAK_FLUIDn)) extern volatile uint8_t LineInBREAKFLUIDStatus; #define LINE_IN_BREAK_FLUID_SIGNAL LineInBREAKFLUIDStatus #define LINE_IN_BREAK_FLUID_DEFAULT 0 #endif /*** LINE_IN_BREAK_SIGNAL ***/ #if ((defined LINE_IN_BREAK) || (defined LINE_IN_BREAKn)) extern volatile uint8_t LineInBREAKStatus; #define LINE_IN_BREAK_SIGNAL LineInBREAKStatus #define LINE_IN_BREAK_DEFAULT 0 #endif /*** LINE_IN_RF_HOOVES_SIGNAL ***/ #if ((defined LINE_IN_RF_HOOVES) || (defined LINE_IN_RF_HOOVESn)) extern volatile uint8_t LineInRFHOOVESStatus; #define LINE_IN_RF_HOOVES_SIGNAL LineInRFHOOVESStatus #define LINE_IN_RF_HOOVES_DEFAULT 0 #endif /*** LINE_IN_RR_HOOVES_SIGNAL ***/ #if ((defined LINE_IN_RR_HOOVES) || (defined LINE_IN_RR_HOOVESn)) extern volatile uint8_t LineInRRHOOVESStatus; #define LINE_IN_RR_HOOVES_SIGNAL LineInRRHOOVESStatus #define LINE_IN_RR_HOOVES_DEFAULT 0 #endif /*** LINE_IN_CAB_LOCK_SIGNAL ***/ #if ((defined LINE_IN_CAB_LOCK) || (defined LINE_IN_CAB_LOCKn)) extern volatile uint8_t LineInCABLOCKStatus; #define LINE_IN_CAB_LOCK_SIGNAL LineInCABLOCKStatus #define LINE_IN_CAB_LOCK_DEFAULT 0 #endif /*** LINE_IN_FILT_BLOCK_SIGNAL ***/ #if ((defined LINE_IN_FILT_BLOCK) || (defined LINE_IN_FILT_BLOCKn)) extern volatile uint8_t LineInFILTBLOCKStatus; #define LINE_IN_FILT_BLOCK_SIGNAL LineInFILTBLOCKStatus #define LINE_IN_FILT_BLOCK_DEFAULT 0 #endif /*** LINE_IN_CHARGE_SIGNAL ***/ #if ((defined LINE_IN_CHARGE) || (defined LINE_IN_CHARGEn)) extern volatile uint8_t LineInCHARGEStatus; #define LINE_IN_CHARGE_SIGNAL LineInCHARGEStatus #define LINE_IN_CHARGE_DEFAULT 0 #endif /*** LINE_IN_GEAR_SIGNAL ***/ #if ((defined LINE_IN_GEAR) || (defined LINE_IN_GEARn)) extern volatile uint8_t LineInGEARStatus; #define LINE_IN_GEAR_SIGNAL LineInGEARStatus #define LINE_IN_GEAR_DEFAULT 0 #endif /****************************************************************************** �������� ******************************************************************************/ void Line_In_Enable(uint8_t Enable); void Line_In_Status_Reset(void); void Line_In_Debounce_Service(void); //����ÿ20ms����һ�� #endif