Collaboration diagram for STK525 Module:
![]() |
Modules | |
Leds Management | |
Macros to manage Leds on STK525. | |
Joystick Management | |
Macros to manage Joystick on STK525. | |
HWB button management | |
HWB button is connected to PE2 and can also be used as generic push button. | |
ATMEL Hardware data flash configuration | |
Macros to init the environnement for DF on STK525. | |
Defines | |
#define | ADC_POT_CH 0x01 |
STK 525 ADC Potentiometer Channel Definition. | |
#define | ADC_MIC_CH 0x02 |
#define | ADC_TEMP_CH 0x00 |
this define is set in config.h file | |
Functions | |
U16 | Get_adc_mic_val (void) |
Get_adc_mic_val. | |
U16 | Get_adc_temp_val (void) |
Get_adc_temp_val. | |
U16 | Get_adc_pot_val (void) |
Get_adc_pot_val. | |
S16 | Read_temperature (void) |
Read_temperature. |
|
STK 525 ADC Potentiometer Channel Definition.
Definition at line 77 of file stk_525.h. Referenced by Get_adc_pot_val(). |
|
Definition at line 78 of file stk_525.h. Referenced by Get_adc_mic_val(). |
|
this define is set in config.h file
Definition at line 79 of file stk_525.h. Referenced by Get_adc_temp_val(). |
|
Get_adc_mic_val. This function performs an ADC conversion from the stk525 MIC channel an returns the 10 bits result in an U16 value.
Definition at line 50 of file stk_525.c. References ADC_MIC_CH, ADCH, ADCL, Is_adc_conv_finished, and Start_conv_channel. 00051 { 00052 Start_conv_channel(ADC_MIC_CH); 00053 while (!Is_adc_conv_finished()); 00054 return (U16)(ADCL+((U16)(ADCH<<8))); 00055 }
|
|
Get_adc_temp_val. This function performs an ADC conversion from the stk525 TEMP channel an returns the 10 bits result in an U16 value.
Definition at line 64 of file stk_525.c. 00065 { 00066 Start_conv_channel(ADC_TEMP_CH); 00067 while (!Is_adc_conv_finished()); 00068 return (U16)(ADCL+((U16)(ADCH<<8))); 00069 }
|
|
Get_adc_pot_val. This function performs an ADC conversion from the stk525 POT channel an returns the 10 bits result in an U16 value.
Definition at line 57 of file stk_525.c. References ADC_POT_CH, ADCH, ADCL, Is_adc_conv_finished, and Start_conv_channel. Referenced by hid_task(). 00058 { 00059 Start_conv_channel(ADC_POT_CH); 00060 while (!Is_adc_conv_finished()); 00061 return (U16)(ADCL+((U16)(ADCH<<8))); 00062 }
|
|
Read_temperature. This function performs an ADC conversion from the stk525 POT channel an returns the 10 bits result of the temperature (in °C) in an S16 value.
Definition at line 71 of file stk_525.c. 00072 { 00073 #ifndef AVRGCC 00074 U16 adc_code; 00075 S8 index=0; 00076 adc_code=Get_adc_temp_val(); 00077 if(adc_code>temperature_code[0]) 00078 { 00079 return (S16)(-20); 00080 } 00081 else 00082 { 00083 while(temperature_code[index++]>adc_code); 00084 return (S16)(index-1-20); 00085 } 00086 #else 00087 U16 adc_code; 00088 S8 index=0; 00089 adc_code=Get_adc_temp_val(); 00090 if(adc_code>pgm_read_word_near(&temperature_code)) 00091 { 00092 return (S16)(-20); 00093 } 00094 else 00095 { 00096 while(pgm_read_word_near(&temperature_code[index++])>adc_code); 00097 return (S16)(index-1-20); 00098 } 00099 00100 #endif 00101 }
|