Rev 378 | Rev 778 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 378 | Rev 672 | ||
---|---|---|---|
Line 66... | Line 66... | ||
66 | IENABLE; |
66 | IENABLE; |
Line 67... | Line 67... | ||
67 | 67 | ||
68 | if(ADC_GetFlagStatus(ADC_FLAG_ECV) == SET) |
68 | if(ADC_GetFlagStatus(ADC_FLAG_ECV) == SET) |
69 | { |
69 | { |
- | 70 | ADC_ClearFlag(ADC_FLAG_ECV); |
|
70 | ADC_ClearFlag(ADC_FLAG_ECV); |
71 | AnalogData.Ch0 = ADC_GetConversionValue(ADC_Channel_0); |
71 | AnalogData.Ch1 = ADC_GetConversionValue(ADC_Channel_1); |
72 | AnalogData.Ch1 = ADC_GetConversionValue(ADC_Channel_1); |
72 | AnalogData.Ch2 = ADC_GetConversionValue(ADC_Channel_2); |
73 | AnalogData.Ch2 = ADC_GetConversionValue(ADC_Channel_2); |
73 | AnalogData.Ch3 = ADC_GetConversionValue(ADC_Channel_3); |
74 | AnalogData.Ch3 = ADC_GetConversionValue(ADC_Channel_3); |
74 | AnalogData.Ch4 = ADC_GetConversionValue(ADC_Channel_4); |
75 | AnalogData.Ch4 = ADC_GetConversionValue(ADC_Channel_4); |
75 | AnalogData.Ch5 = ADC_GetConversionValue(ADC_Channel_5); |
76 | AnalogData.Ch5 = ADC_GetConversionValue(ADC_Channel_5); |
76 | AnalogData.Ch6 = ADC_GetConversionValue(ADC_Channel_6); |
77 | AnalogData.Ch6 = ADC_GetConversionValue(ADC_Channel_6); |
- | 78 | AnalogData.Ch7 = ADC_GetConversionValue(ADC_Channel_7); |
|
77 | AnalogData.Ch7 = ADC_GetConversionValue(ADC_Channel_7); |
79 | //FC_Temperatur = 250 + (s32)(((s32)AnalogData.Ch0 * 100 - 51200) / 18); |
78 | } |
80 | } |
79 | IDISABLE; |
81 | IDISABLE; |
80 | VIC0->VAR = 0xFF; // write any value to VIC0 Vector address register |
82 | VIC0->VAR = 0xFF; // write any value to VIC0 Vector address register |
Line 89... | Line 91... | ||
89 | SCU_APBPeriphClockConfig(__GPIO4, ENABLE); // Enable the GPIO4 Clock |
91 | SCU_APBPeriphClockConfig(__GPIO4, ENABLE); // Enable the GPIO4 Clock |
Line 90... | Line 92... | ||
90 | 92 | ||
Line 91... | Line 93... | ||
91 | ADC_DeInit(); // reset register to default values |
93 | ADC_DeInit(); // reset register to default values |
- | 94 | ||
92 | 95 | // configure port 4 pins as analog inputs |
|
93 | // configure port 4 pins as analog inputs |
96 | GPIO_ANAPinConfig(GPIO_ANAChannel0, ENABLE); |
94 | GPIO_ANAPinConfig(GPIO_ANAChannel1, ENABLE); |
97 | GPIO_ANAPinConfig(GPIO_ANAChannel1, ENABLE); |
95 | GPIO_ANAPinConfig(GPIO_ANAChannel2, ENABLE); |
98 | GPIO_ANAPinConfig(GPIO_ANAChannel2, ENABLE); |
96 | GPIO_ANAPinConfig(GPIO_ANAChannel3, ENABLE); |
99 | GPIO_ANAPinConfig(GPIO_ANAChannel3, ENABLE); |
Line 100... | Line 103... | ||
100 | GPIO_ANAPinConfig(GPIO_ANAChannel7, ENABLE); |
103 | GPIO_ANAPinConfig(GPIO_ANAChannel7, ENABLE); |
Line 101... | Line 104... | ||
101 | 104 | ||
102 | ADC_Cmd(ENABLE); // power on the ADC |
105 | ADC_Cmd(ENABLE); // power on the ADC |
103 | ADC_StandbyModeCmd(DISABLE); // disable Standby Mode |
106 | ADC_StandbyModeCmd(DISABLE); // disable Standby Mode |
- | 107 | ADC_StructInit(&ADC_InitStructure); |
|
104 | ADC_StructInit(&ADC_InitStructure); |
108 | ADC_InitStructure.ADC_Channel_0_Mode = ADC_NoThreshold_Conversion; |
105 | ADC_InitStructure.ADC_Channel_1_Mode = ADC_NoThreshold_Conversion; |
109 | ADC_InitStructure.ADC_Channel_1_Mode = ADC_NoThreshold_Conversion; |
106 | ADC_InitStructure.ADC_Channel_2_Mode = ADC_NoThreshold_Conversion; |
110 | ADC_InitStructure.ADC_Channel_2_Mode = ADC_NoThreshold_Conversion; |
107 | ADC_InitStructure.ADC_Channel_3_Mode = ADC_NoThreshold_Conversion; |
111 | ADC_InitStructure.ADC_Channel_3_Mode = ADC_NoThreshold_Conversion; |
108 | ADC_InitStructure.ADC_Channel_4_Mode = ADC_NoThreshold_Conversion; |
112 | ADC_InitStructure.ADC_Channel_4_Mode = ADC_NoThreshold_Conversion; |