00001 // //////////////////////////////////////////////////////////////////////////// 00002 // //////////////////////////////////////////////////////////////////////////// 00023 // //////////////////////////////////////////////////////////////////////////// 00024 // //////////////////////////////////////////////////////////////////////////// 00025 00026 00027 #ifndef INPUT_H 00028 00029 #define INPUT_H 00030 00031 00032 // //////////////////////////////////////////////////////////////////////////// 00033 // Includes 00034 // //////////////////////////////////////////////////////////////////////////// 00035 00036 #include "GenericTypeDefs.h" 00037 00038 00039 // //////////////////////////////////////////////////////////////////////////// 00040 // Defines 00041 // //////////////////////////////////////////////////////////////////////////// 00042 00043 00045 #define BTN_COUNT 0x09 00046 00052 #define ENC_ENDSTOP_MASK 0x01 00053 00058 #define ENC_TURBO_MASK 0x02 00059 00064 #define ENC_NOCHANGE_MASK 0x04 00065 00071 #define BTN_LONG_PUSH_TIME (100u) 00072 00078 #define BTN_DOUBLE_PUSH_TIME (60u) 00079 00080 00081 // //////////////////////////////////////////////////////////////////////////// 00082 // Typedefs 00083 // //////////////////////////////////////////////////////////////////////////// 00084 00088 typedef enum 00089 { 00090 PWR_BTN = 0, 00091 SEL_BTN, 00092 ACC_BTN, 00093 FL_BTN, 00094 F1_BTN, 00095 F2_BTN, 00096 F3_BTN, 00097 F4_BTN, 00098 ENC_BTN, 00099 ALL_BTN 00100 } eButtonID; 00101 00102 00103 // //////////////////////////////////////////////////////////////////////////// 00104 // Function prototypes 00105 // //////////////////////////////////////////////////////////////////////////// 00106 00107 00108 // //////////////////////////////////////////////////////////////////////////// 00121 void InputInit(void); 00122 00123 00124 // //////////////////////////////////////////////////////////////////////////// 00138 void InputMain(void); 00139 00140 00141 // //////////////////////////////////////////////////////////////////////////// 00161 void InputButtonReset(eButtonID eBtn); 00162 00163 00164 // //////////////////////////////////////////////////////////////////////////// 00187 void InputResetPowerButton(void); 00188 00189 00190 // //////////////////////////////////////////////////////////////////////////// 00207 void InputResetButtonPush(eButtonID eBtn); 00208 00209 00210 // //////////////////////////////////////////////////////////////////////////// 00231 BOOL bInputButtonPushedOnce(eButtonID eBtn); 00232 00233 00234 // //////////////////////////////////////////////////////////////////////////// 00256 BOOL bInputButtonPushedTwice(eButtonID eBtn); 00257 00258 00259 // //////////////////////////////////////////////////////////////////////////// 00281 BOOL bInputButtonPushedLong(eButtonID eBtn); 00282 00283 00284 // //////////////////////////////////////////////////////////////////////////// 00305 BOOL bInputButtonPushed(eButtonID eBtn); 00306 00307 00308 // //////////////////////////////////////////////////////////////////////////// 00321 SHORT s16InputEncoderGetValue(void); 00322 00323 00324 // //////////////////////////////////////////////////////////////////////////// 00344 void InputEncoderInit(SHORT s16Val,SHORT s16Min,SHORT s16Max,BYTE u8Flags); 00345 00346 00347 // //////////////////////////////////////////////////////////////////////////// 00363 BOOL bInputEncoderValueChanged(void); 00364 00365 00366 // //////////////////////////////////////////////////////////////////////////// 00377 void InputEncoderSetValue(short s16NewVal, BOOL bRemember); 00378 00379 00380 // //////////////////////////////////////////////////////////////////////////// 00388 void InputForceChangedEncoderValue(void); 00389 00390 00391 // //////////////////////////////////////////////////////////////////////////// 00404 BOOL InputEncoderGetDirection(void); 00405 00406 00407 // //////////////////////////////////////////////////////////////////////////// 00419 BYTE u8InputButtonQuickPushed(void); 00420 00421 00422 // //////////////////////////////////////////////////////////////////////////// 00434 BOOL bInputButtonPressed(eButtonID eBtn); 00435 00436 00437 // //////////////////////////////////////////////////////////////////////////// 00447 BOOL IsEncoderTurning(void); 00448 00449 00450 // //////////////////////////////////////////////////////////////////////////// 00455 void InputInterruptHandler(void); 00456 00460 void InputEncoderTest(void); 00461 00462 // //////////////////////////////////////////////////////////////////////////// 00463 // Epilogue 00464 // //////////////////////////////////////////////////////////////////////////// 00465 00466 00467 #include "main.h" 00468 00469 #endif
1.5.5