limit_switch.h
00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __H_LIMIT_SWITCH__
00009 #define __H_LIMIT_SWITCH__
00010
00014 typedef enum ls_states{
00015 LS_OFF = 0,
00016 LS_ON
00017 } LS_STATE;
00018
00022 typedef struct ls_switch{
00023 unsigned int limit;
00024 unsigned int count;
00025 LS_STATE prev;
00026 LS_STATE state;
00027 INT_VOID_F function;
00028 } LIMIT_SWITCH;
00029
00030
00031 LS_STATE ls_get_state(int ls);
00032 int ls_init_switch(unsigned int new_limit, INT_VOID_F funct);
00033 void ls_update(void);
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #endif // __H_LIMIT_SWITCH__