00001 /*@{*//*@}*/ 00010 00011 /******************************************************************************/ 00012 /* Includes (#include) */ 00013 #include <avr/io.h> 00014 00015 /* Own header files */ 00016 #include "xtypes.h" 00017 #include "global.h" 00018 00019 #include "adc.h" 00020 00021 #define EXPORT 00022 #include "switch.h" 00023 #undef EXPORT 00024 00025 /******************************************************************************/ 00026 /* Constants (#define) *//*@{*/ 00027 /* End: Constants (#define) *//*@}*/ 00028 /******************************************************************************/ 00029 00030 /******************************************************************************/ 00031 /* Macro definitions (#define) *//*@{*/ 00032 /* End: Macro definitions (#define) *//*@}*/ 00033 /******************************************************************************/ 00034 00035 /******************************************************************************/ 00036 /* Basic types (typedef) *//*@{*/ 00037 /* End: Basic types (typedef) *//*@}*/ 00038 /******************************************************************************/ 00039 00040 /******************************************************************************/ 00041 /* Local constants (const) *//*@{*/ 00042 /* End: Local constants (const) *//*@}*/ 00043 /******************************************************************************/ 00044 00045 /******************************************************************************/ 00046 /* Local variables *//*@{*/ 00047 /* End: Local variables *//*@}*/ 00048 /******************************************************************************/ 00049 00050 /******************************************************************************/ 00051 /* Global variables *//*@{*/ 00052 /* End: Global variables *//*@}*/ 00053 /******************************************************************************/ 00054 00055 /******************************************************************************/ 00056 /* Prototype declarations */ 00057 /* End: Prototype declarations */ 00058 /******************************************************************************/ 00059 00060 /******************************************************************************/ 00061 /* Local functions *//*@{*/ 00062 /* End: Local functions *//*@}*/ 00063 /******************************************************************************/ 00064 00065 /******************************************************************************/ 00066 /* Global functions *//*@{*/ 00067 00068 /* ****************************************************************************/ 00077 /* ****************************************************************************/ 00078 void switch_Init (void) 00079 { 00080 /* Nothing to do here */ 00081 } 00082 00083 00084 /* ****************************************************************************/ 00095 /* ****************************************************************************/ 00096 E_SWITCH switch_Get (void) 00097 { 00098 UINT16 u16Help = adc_Read(ADC_SWITCH); 00099 if (u16Help > 0U) 00100 { 00101 return (ON); 00102 } 00103 else 00104 { 00105 return (OFF); 00106 } 00107 } 00108 00109 /* End: Global functions *//*@}*/ 00110 /******************************************************************************/ 00111 00112 /**** Last line of code ****/