RTE_ADC.c 9.49 KB
Newer Older
hu's avatar
hu committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
#include "RTE_ADC.h"

#include "Analog_Signals.h"

void RTE_ADC_Init(void)
{
    Analog_Signal_Conv_Init();
}


/*-------------------------------------------------------------------------
 * Function Name  : RTE_ForceRead_KL15_Voltage
 * Description    : 强制读一次KL15电压
 * Input          : None
 * Output         : None
 * Return         : None
 * onther         : None
 --------------------------------------------------------------------------*/
uint32_t RTE_ForceRead_KL15_Voltage(void)
{
    uint32_t Result = 0x00ul;
    Result = ADC_Conv_Single_Channel(ADC_CH_KL30_VOLTAGE);
    return Result;
}
/*-------------------------------------------------------------------------
 * Function Name  : RTE_ForceRead_KL30_Voltage
 * Description    : 强制读一次KL30电压
 * Input          : None
 * Output         : None
 * Return         : None
 * onther         : None
 --------------------------------------------------------------------------*/
uint32_t RTE_ForceRead_KL30_Voltage(void)
{
    uint32_t Result = 0x00ul;
    Result = ADC_Conv_Single_Channel(ADC_CH_KL30_VOLTAGE);
    return Result;
}
/*-------------------------------------------------------------------------
 * Function Name  : RTE_Read_KL15_Voltage
 * Description    : 读KL15电压
 * Input          : None
 * Output         : None
 * Return         : None
 * onther         : None
 --------------------------------------------------------------------------*/
uint32_t RTE_Read_KL15_Voltage(void)
{
    uint32_t Result = 0x00ul;
    Result = ADC_Read_Signal(ADC_CH_KL30_VOLTAGE);
    return Result;
}
/*-------------------------------------------------------------------------
 * Function Name  : RTE_Read_KL30_Voltage
 * Description    : 读KL30电压
 * Input          : None
 * Output         : None
 * Return         : None
 * onther         : None
 --------------------------------------------------------------------------*/
uint32_t RTE_Read_KL30_Voltage(void)
{
    uint32_t Result = 0x00ul;
    Result = ADC_Read_Signal(ADC_CH_KL30_VOLTAGE);
    return Result;
}
/*-------------------------------------------------------------------------
 * Function Name  : RTE_Read_PRIMARY_AIR_Voltage
 * Description    : 读主气压 电压
 * Input          : None
 * Output         : None
 * Return         : None
 * onther         : None
 --------------------------------------------------------------------------*/
uint32_t RTE_Read_PRIMARY_AIR_Voltage(void)
{
    uint32_t Result = 0x00ul;
    Result = ADC_Read_Signal(ADC_CH_PRIMARY_AIR_VOLTAGE);
    return Result;
}
/*-------------------------------------------------------------------------
 * Function Name  : RTE_Read_SECONDARY_AIR_Voltage
 * Description    : 读副气压 电压
 * Input          : None
 * Output         : None
 * Return         : None
 * onther         : None
 --------------------------------------------------------------------------*/
uint32_t RTE_Read_SECONDARY_AIR_Voltage(void)
{
    uint32_t Result = 0x00ul;
    Result = ADC_Read_Signal(ADC_CH_SECONDARY_AIR_VOLTAGE);
    return Result;
}
95 96 97 98 99 100 101 102 103 104 105 106 107 108
/*-------------------------------------------------------------------------
 * Function Name  : RTE_Read_WET_AIR_Voltage
 * Description    : 读WET
 * Input          : None
 * Output         : None
 * Return         : None
 * onther         : None
 --------------------------------------------------------------------------*/
uint32_t RTE_Read_WET_AIR_Voltage(void)
{
    uint32_t Result = 0x00ul;
    Result = ADC_Read_Signal(ADC_CH_WETAIR_VOLTAGE);
    return Result;
}
hu's avatar
hu committed
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
/*-------------------------------------------------------------------------
 * Function Name  : RTE_Read_FUEL_REF_Voltage
 * Description    : 读燃油基准电压
 * Input          : None
 * Output         : None
 * Return         : None
 * onther         : None
 --------------------------------------------------------------------------*/
uint32_t RTE_Read_FUEL_REF_Voltage(void)
{
    uint32_t Result = 0x00ul;
    Result = ADC_Read_Signal(ADC_CH_FUEL_REF_VOLTAGE);
    return Result;
}
/*-------------------------------------------------------------------------
 * Function Name  : RTE_Read_FUEL_R
 * Description    : 读燃油电阻 10倍
 * Input          : None
 * Output         : None
 * Return         : None
 * onther         : None
 --------------------------------------------------------------------------*/
uint32_t RTE_Read_FUEL_R(void)
{
    uint32_t Result = 0x00ul;
    Result = ADC_Read_Signal(ADC_CH_FUEL_R);
    return Result;
}
/*-------------------------------------------------------------------------
 * Function Name  : RTE_Read_KEY_R
 * Description    : 读按键阻值
 * Input          : None
 * Output         : None
 * Return         : None
 * onther         : None
 --------------------------------------------------------------------------*/
uint32_t RTE_Read_KEY_R(void)
{
    uint32_t Result = 0x00ul;
    Result = ADC_Read_Signal(ADC_CH_KEY);
    return Result;
}
/*-------------------------------------------------------------------------
 * Function Name  : RTE_Read_NTC_R
 * Description    : 读热敏电阻阻值
 * Input          : None
 * Output         : None
 * Return         : None
 * onther         : None
 --------------------------------------------------------------------------*/
uint32_t RTE_Read_NTC_R(void)
{
    uint32_t Result = 0x00ul;
    Result = ADC_Read_Signal(ADC_CH_NTC_R);
    return Result;
}
/*-------------------------------------------------------------------------
 * Function Name  : RTE_Read_KL15_Valid
 * Description    : 读KL15 有效
 * Input          : None
 * Output         : None
 * Return         : None
 * onther         : None
 --------------------------------------------------------------------------*/
uint8_t RTE_Read_KL15_Valid(void)
{
    uint8_t Result = 0x00u;
    Result = ADC_Read_Signal_Valid(ADC_CH_KL30_VOLTAGE);
    return Result;
}
/*-------------------------------------------------------------------------
 * Function Name  : RTE_Read_KL30_Valid
 * Description    : 读KL30 有效
 * Input          : None
 * Output         : None
 * Return         : None
 * onther         : None
 --------------------------------------------------------------------------*/
uint8_t RTE_Read_KL30_Valid(void)
{
    uint8_t Result = 0x00u;
    Result = ADC_Read_Signal_Valid(ADC_CH_KL30_VOLTAGE);
    return Result;
}
/*-------------------------------------------------------------------------
 * Function Name  : RTE_Read_PRIMARY_AIR_Valid
 * Description    : 读主气压 有效
 * Input          : None
 * Output         : None
 * Return         : None
 * onther         : None
 --------------------------------------------------------------------------*/
uint8_t RTE_Read_PRIMARY_AIR_Valid(void)
{
203
    uint8_t Result = 0x00u;
hu's avatar
hu committed
204 205 206 207 208 209 210 211 212 213 214 215 216
    Result = ADC_Read_Signal_Valid(ADC_CH_PRIMARY_AIR_VOLTAGE);
    return Result;
}
/*-------------------------------------------------------------------------
 * Function Name  : RTE_Read_SECONDARY_AIR_Valid
 * Description    : 读副气压 有效
 * Input          : None
 * Output         : None
 * Return         : None
 * onther         : None
 --------------------------------------------------------------------------*/
uint8_t RTE_Read_SECONDARY_AIR_Valid(void)
{
217
    uint8_t Result = 0x00u;
hu's avatar
hu committed
218 219 220 221 222 223 224 225 226 227 228 229 230
    Result = ADC_Read_Signal_Valid(ADC_CH_SECONDARY_AIR_VOLTAGE);
    return Result;
}
/*-------------------------------------------------------------------------
 * Function Name  : RTE_Read_FUEL_REF_Valid
 * Description    : 读燃油基准电压 有效
 * Input          : None
 * Output         : None
 * Return         : None
 * onther         : None
 --------------------------------------------------------------------------*/
uint8_t RTE_Read_FUEL_REF_Valid(void)
{
231
    uint8_t Result = 0x00u;
hu's avatar
hu committed
232 233 234 235 236 237 238 239 240 241 242 243 244
    Result = ADC_Read_Signal_Valid(ADC_CH_FUEL_REF_VOLTAGE);
    return Result;
}
/*-------------------------------------------------------------------------
 * Function Name  : RTE_Read_FUEL_R_Valid
 * Description    : 读燃油电阻 有效
 * Input          : None
 * Output         : None
 * Return         : None
 * onther         : None
 --------------------------------------------------------------------------*/
uint8_t RTE_Read_FUEL_R_Valid(void)
{
245
    uint8_t Result = 0x00u;
hu's avatar
hu committed
246 247 248 249 250 251 252 253 254 255 256 257 258
    Result = ADC_Read_Signal_Valid(ADC_CH_FUEL_R);
    return Result;
}
/*-------------------------------------------------------------------------
 * Function Name  : RTE_Read_KEY_R_Valid
 * Description    : 读按键 有效
 * Input          : None
 * Output         : None
 * Return         : None
 * onther         : None
 --------------------------------------------------------------------------*/
uint8_t RTE_Read_KEY_R_Valid(void)
{
259
    uint8_t Result = 0x00u;
hu's avatar
hu committed
260 261 262 263 264 265 266 267 268 269 270 271 272
    Result = ADC_Read_Signal_Valid(ADC_CH_KEY);
    return Result;
}
/*-------------------------------------------------------------------------
 * Function Name  : RTE_Read_NTC_R_Valid
 * Description    : 读热敏电阻阻值 有效
 * Input          : None
 * Output         : None
 * Return         : None
 * onther         : None
 --------------------------------------------------------------------------*/
uint8_t RTE_Read_NTC_R_Valid(void)
{
273
    uint8_t Result = 0x00u;
hu's avatar
hu committed
274 275 276
    Result = ADC_Read_Signal_Valid(ADC_CH_NTC_R);
    return Result;
}
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291

/*-------------------------------------------------------------------------
 * Function Name  : RTE_Read_WET_AIR_Value
 * Description    :
 * Input          : None
 * Output         : None
 * Return         : None
 * onther         : None
 --------------------------------------------------------------------------*/
uint8_t RTE_Read_WET_AIR_Value(void)
{
    uint8_t Result = 0x00u;
    Result = ADC_Read_Signal_Valid(ADC_CH_WETAIR_VOLTAGE);
    return Result;
}