610 lines
21 KiB
C
610 lines
21 KiB
C
//
|
|
// Created by CFIF on 14.12.23.
|
|
//
|
|
#include <stdbool.h>
|
|
#include "fc7xxx_driver_port.h"
|
|
#include "Adcs.h"
|
|
|
|
#define LOG_SIGN "INIT"
|
|
#define LOGGER logger
|
|
|
|
tAdcs ADCS;
|
|
|
|
void Bsp_ADC0_HandleResult(const uint32_t *const pBuffer) {
|
|
Get_ADC_Result(ADCS.adc_0_IO.env);
|
|
}
|
|
|
|
void Bsp_ADC1_HandleResult(const uint32_t *const pBuffer) {
|
|
Get_ADC_Result(ADCS.adc_1_IO.env);
|
|
}
|
|
|
|
|
|
#define ADC0_CHN_NUM_EN 31
|
|
static uint32_t s_aAdc0ResultBuf[ADC0_CHN_NUM_EN] = {0U};
|
|
static const ADC_ChannelCfgType s_aChannelsAdc0[ADC0_CHN_NUM_EN] =
|
|
{
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_0, //PA25: Sensor_Ambient_Temp
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
{
|
|
.eChannel = ADC_CHANNEL_1, //PE5: IGN_ANS_PE5_ADC0_1 (Напряжение зажигание ДЕЛИТЕЛЬ)
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_2, //PA26: Sensor_AC_Pressure
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_3, //PE12: Sensor_Incar_Temp_FL
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_4, //PE4: Sensor_Incar_Temp_RL
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_5, //PE13: Sensor_Rear_Evap_Temp
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_6, //PA27: Sensor_Evap_Temp
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_7, //PA28: Sensor_Rear_Duct1
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_8, //PD17: Sensor_Rear_Duct2
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_9, //PA29: Sensor_Front_Duct1
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_10, //PD16: Sensor_Front_Duct2
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_11, //PD15: Sensor_Front_Duct3
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_12, //PE9: Sensor_Front_Duct4
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_13, //PA31: Sensor_Rear_Duct3
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_14, //PB20: Sensor_Rear_Duct4
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_15, //PB21: Sensor_Incar_Temp_FR
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_16, //PE0: Sensor_Incar_Temp_RR
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_1
|
|
},
|
|
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_17, //PE1: Sensor_Rear_Duct5
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_18, //PE24: Sensor_Rear_Duct6
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_19, //PE23: Reserve_Sensor_Duct_Temp_1
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_21, //PA14: Sensor_Front_Duct5
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_22, //PE20: Sensor_Front_Duct6
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_23, //PE19: BTS5120_2EKA_ShutoffValvePowerTXV
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_25, //PE6: Pressure_DIAG_PE6_ADC_0_25 (Напряжение датчика давления ДЕЛИТЕЛЬ)
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_26, //PA15: BTS5180_2EKA_ShutOFFValveFrontRear
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_27, //PE18: Вывод диагностики BTS5180_2EKA_TwoWayValveAndReservePowerSupply (0 - Канал 0; 1 - Канал 1)
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_28, //PA16: BTS5180_2EKA_FrontRearIncarMotor
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_30, //PC7: Вывод диагностики BTS5180_2EKA_2xChannelPTCPower (0 - Канал 0; 1 - Канал 1)
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_31, //PD31: Reserve_Sensor_Duct_Temp_2
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_29, //PC6: Sensor_PT_rHVAC_P
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_24, //PE2: Sensor_A_T_reserve
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
}
|
|
|
|
};
|
|
|
|
|
|
#define ADC1_CHN_NUM_EN 16
|
|
static uint32_t s_aAdc1ResultBuf[ADC1_CHN_NUM_EN] = {0U};
|
|
static const ADC_ChannelCfgType s_aChannelsAdc1[ADC1_CHN_NUM_EN] =
|
|
{
|
|
{
|
|
.eChannel = ADC_CHANNEL_0, //PE10: Напряжение VN7008AJ_DIAG_FrontLINActuatorPowerDriverAB (ДЕЛИТЕЛЬ)
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_1, //PD0: tVN7008AJ_DIAG_RearLINActuatorPowerDriverC (ДЕЛИТЕЛЬ)
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_2, //PE15: PBATT_CHECK_PE15_ADC1_2 (Напряжение сети ДЕЛИТЕЛЬ)
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_3, //PA8: VN7008AJ_FrontLINActuatorPowerDriverAB
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_4, //PE11: tVN7008AJ_RearLINActuatorPowerDriverC
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_9, //PA6: PT_F_HVAC_VCC_DIAG
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_18, //PB14: PT_HVBchiller_VCC_DIAG
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_28, //PB8: PT_R_HVAC_VCC_DIAG
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_17, //PB15: Sensor_PT_fHVAC_P
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_8, //PE7: Sensor_PT_fHVAC_T
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_20, //PC25: Sensor_PT_rHVAC_T
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_21, //PC26: Sensor_HVBchiller_P
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_24, //PD25: Sensor_HVBchiller_T
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_25, //PB9: Sensor_PT_P_reserve
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_26, //PD26: Sensor_PT_T_reserve
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
},
|
|
|
|
{
|
|
.eChannel = ADC_CHANNEL_30, //PA0: Sensor_B_T_reserve
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_3
|
|
}
|
|
|
|
};
|
|
|
|
|
|
/*
|
|
#define ADC0_CHN_NUM_EN 1
|
|
static uint32_t s_aAdc0ResultBuf[ADC0_CHN_NUM_EN] = {0U};
|
|
static const ADC_ChannelCfgType s_aChannelsAdc0[ADC0_CHN_NUM_EN] =
|
|
{
|
|
{
|
|
.eChannel = ADC_CHANNEL_0,
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_1
|
|
}
|
|
};
|
|
|
|
#define ADC1_CHN_NUM_EN 1
|
|
static uint32_t s_aAdc1ResultBuf[ADC1_CHN_NUM_EN] = {0U};
|
|
static const ADC_ChannelCfgType s_aChannelsAdc1[ADC1_CHN_NUM_EN] =
|
|
{
|
|
{
|
|
.eChannel = ADC_CHANNEL_25,
|
|
.eSampleTimeOption = ADC_SAMPLE_TIME_OPTION_1
|
|
}
|
|
};
|
|
*/
|
|
|
|
void Adcs_Init(tLoggerInterface *logger) {
|
|
tAdcs *env = &ADCS;
|
|
|
|
PORT_InitType tInitStruct = {0};
|
|
tInitStruct.bPullEn = false;
|
|
tInitStruct.ePullSel = PORT_PULL_UP;
|
|
|
|
//PA25: Sensor_Ambient_Temp
|
|
tInitStruct.u32PortPins = PORT_PIN_25;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTA_25_ADC0_SE0;
|
|
PORT_InitPins(PORT_A, &tInitStruct);
|
|
|
|
//PE5: IGN_ANS_PE5_ADC0_1 (Напряжение зажигание ДЕЛИТЕЛЬ)
|
|
tInitStruct.u32PortPins = PORT_PIN_5;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTE_5_ADC0_SE1;
|
|
PORT_InitPins(PORT_E, &tInitStruct);
|
|
|
|
//PA26: Sensor_AC_Pressure
|
|
tInitStruct.u32PortPins = PORT_PIN_26;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTA_26_ADC0_SE2;
|
|
PORT_InitPins(PORT_A, &tInitStruct);
|
|
|
|
//PE12: Sensor_Incar_Temp_FL
|
|
tInitStruct.u32PortPins = PORT_PIN_12;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTE_12_ADC0_SE3;
|
|
PORT_InitPins(PORT_E, &tInitStruct);
|
|
|
|
//PE4: Sensor_Incar_Temp_RL
|
|
tInitStruct.u32PortPins = PORT_PIN_4;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTE_4_ADC0_SE4;
|
|
PORT_InitPins(PORT_E, &tInitStruct);
|
|
|
|
//PE13: Sensor_Rear_Evap_Temp
|
|
tInitStruct.u32PortPins = PORT_PIN_13;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTE_13_ADC0_SE5;
|
|
PORT_InitPins(PORT_E, &tInitStruct);
|
|
|
|
//PA27: Sensor_Evap_Temp
|
|
tInitStruct.u32PortPins = PORT_PIN_27;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTA_27_ADC0_SE6;
|
|
PORT_InitPins(PORT_A, &tInitStruct);
|
|
|
|
//PA28: Sensor_Rear_Duct1
|
|
tInitStruct.u32PortPins = PORT_PIN_28;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTA_28_ADC0_SE7;
|
|
PORT_InitPins(PORT_A, &tInitStruct);
|
|
|
|
// PD17: Sensor_Rear_Duct2
|
|
tInitStruct.u32PortPins = PORT_PIN_17;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTD_17_ADC0_SE8;
|
|
PORT_InitPins(PORT_D, &tInitStruct);
|
|
|
|
//PA29: Sensor_Front_Duct1
|
|
tInitStruct.u32PortPins = PORT_PIN_29;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTA_29_ADC0_SE9;
|
|
PORT_InitPins(PORT_A, &tInitStruct);
|
|
|
|
//PD16: Sensor_Front_Duct2
|
|
tInitStruct.u32PortPins = PORT_PIN_16;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTD_16_ADC0_SE10_CMP0_IN0;
|
|
PORT_InitPins(PORT_D, &tInitStruct);
|
|
|
|
//PD15: Sensor_Front_Duct3
|
|
tInitStruct.u32PortPins = PORT_PIN_15;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTD_15_ADC0_SE11_CMP0_IN1;
|
|
PORT_InitPins(PORT_D, &tInitStruct);
|
|
|
|
//PE9: Sensor_Front_Duct4
|
|
tInitStruct.u32PortPins = PORT_PIN_9;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTE_9_ADC0_SE12_CMP0_IN2;
|
|
PORT_InitPins(PORT_E, &tInitStruct);
|
|
|
|
//PA31: Sensor_Rear_Duct3
|
|
tInitStruct.u32PortPins = PORT_PIN_31;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTA_31_ADC0_SE13_CMP0_IN3;
|
|
PORT_InitPins(PORT_A, &tInitStruct);
|
|
|
|
//PB20: Sensor_Rear_Duct4
|
|
tInitStruct.u32PortPins = PORT_PIN_20;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTB_20_ADC0_SE14;
|
|
PORT_InitPins(PORT_B, &tInitStruct);
|
|
|
|
//PB21: Sensor_Incar_Temp_FR
|
|
tInitStruct.u32PortPins = PORT_PIN_21;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTB_21_ADC0_SE15;
|
|
PORT_InitPins(PORT_B, &tInitStruct);
|
|
|
|
//PE0: Sensor_Incar_Temp_RR
|
|
tInitStruct.u32PortPins = PORT_PIN_0;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTE_0_ADC0_SE16;
|
|
PORT_InitPins(PORT_E, &tInitStruct);
|
|
|
|
//PE1: Sensor_Rear_Duct5
|
|
tInitStruct.u32PortPins = PORT_PIN_1;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTE_1_ADC0_SE17;
|
|
PORT_InitPins(PORT_E, &tInitStruct);
|
|
|
|
//PE24: Sensor_Rear_Duct6
|
|
tInitStruct.u32PortPins = PORT_PIN_24;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTE_24_ADC0_SE18;
|
|
PORT_InitPins(PORT_E, &tInitStruct);
|
|
|
|
//PE23: Reserve_Sensor_Duct_Temp_1
|
|
tInitStruct.u32PortPins = PORT_PIN_23;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTE_23_ADC0_SE19;
|
|
PORT_InitPins(PORT_E, &tInitStruct);
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//PA14: Sensor_Front_Duct5
|
|
tInitStruct.u32PortPins = PORT_PIN_14;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTA_14_ADC0_SE21;
|
|
PORT_InitPins(PORT_A, &tInitStruct);
|
|
|
|
|
|
//PE20: Sensor_Front_Duct6
|
|
tInitStruct.u32PortPins = PORT_PIN_20;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTE_20_ADC0_SE22;
|
|
PORT_InitPins(PORT_E, &tInitStruct);
|
|
|
|
//PE19: BTS5120_2EKA_ShutoffValvePowerTXV
|
|
tInitStruct.u32PortPins = PORT_PIN_23;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTE_19_ADC0_SE23;
|
|
PORT_InitPins(PORT_E, &tInitStruct);
|
|
|
|
//PE6: Pressure_DIAG_PE6_ADC_0_25 (Напряжение датчика давления ДЕЛИТЕЛЬ)
|
|
tInitStruct.u32PortPins = PORT_PIN_6;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTE_6_ADC0_SE25;
|
|
PORT_InitPins(PORT_E, &tInitStruct);
|
|
|
|
//PA15: BTS5180_2EKA_ShutOFFValveFrontRear
|
|
tInitStruct.u32PortPins = PORT_PIN_15;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTA_15_ADC0_SE26;
|
|
PORT_InitPins(PORT_A, &tInitStruct);
|
|
|
|
//PE18: Вывод диагностики BTS5180_2EKA_TwoWayValveAndReservePowerSupply (0 - Канал 0; 1 - Канал 1)
|
|
tInitStruct.u32PortPins = PORT_PIN_18;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTE_18_ADC0_SE27;
|
|
PORT_InitPins(PORT_E, &tInitStruct);
|
|
|
|
//PA16: BTS5180_2EKA_FrontRearIncarMotor
|
|
tInitStruct.u32PortPins = PORT_PIN_16;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTA_16_ADC0_SE28;
|
|
PORT_InitPins(PORT_A, &tInitStruct);
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//PC7: Вывод диагностики BTS5180_2EKA_2xChannelPTCPower (0 - Канал 0; 1 - Канал 1)
|
|
tInitStruct.u32PortPins = PORT_PIN_7;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTC_7_ADC0_SE30;
|
|
PORT_InitPins(PORT_C, &tInitStruct);
|
|
|
|
//PD31: Reserve_Sensor_Duct_Temp_2
|
|
tInitStruct.u32PortPins = PORT_PIN_31;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTD_31_ADC0_SE31;
|
|
PORT_InitPins(PORT_D, &tInitStruct);
|
|
|
|
|
|
//PC6: Sensor_PT_rHVAC_P
|
|
tInitStruct.u32PortPins = PORT_PIN_6;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTC_6_ADC0_SE29;
|
|
PORT_InitPins(PORT_C, &tInitStruct);
|
|
|
|
//PE2: Sensor_A_T_reserve
|
|
tInitStruct.u32PortPins = PORT_PIN_2;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTE_2_ADC0_SE24;
|
|
PORT_InitPins(PORT_E, &tInitStruct);
|
|
|
|
ADC_Initial(
|
|
&env->adc_0,
|
|
ADC_INSTANCE_0, // ADC_INSTANCE_0, ADC_INSTANCE_1
|
|
|
|
DMA_CHANNEL_4,
|
|
|
|
DMA4_IRQn,
|
|
0xFF,
|
|
DMA4_IRQn,
|
|
|
|
s_aAdc0ResultBuf,
|
|
|
|
ADC0_CHN_NUM_EN,
|
|
(ADC_ChannelCfgType *) s_aChannelsAdc0,
|
|
|
|
0,
|
|
0,
|
|
0,
|
|
|
|
Bsp_ADC0_HandleResult
|
|
);
|
|
|
|
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Initialization ADC0 - OK")
|
|
|
|
|
|
env->adc_0_IO = vAdcGetIo(&env->adc_0);
|
|
|
|
|
|
//PE10: Напряжение VN7008AJ_DIAG_FrontLINActuatorPowerDriverAB (ДЕЛИТЕЛЬ)
|
|
tInitStruct.u32PortPins = PORT_PIN_10;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTE_10_ADC1_SE0;
|
|
PORT_InitPins(PORT_E, &tInitStruct);
|
|
|
|
//PD0: tVN7008AJ_DIAG_RearLINActuatorPowerDriverC (ДЕЛИТЕЛЬ)
|
|
tInitStruct.u32PortPins = PORT_PIN_0;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTD_0_ADC1_SE1;
|
|
PORT_InitPins(PORT_D, &tInitStruct);
|
|
|
|
//PE15: PBATT_CHECK_PE15_ADC1_2 (Напряжение сети ДЕЛИТЕЛЬ)
|
|
tInitStruct.u32PortPins = PORT_PIN_15;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTE_15_ADC1_SE2;
|
|
PORT_InitPins(PORT_E, &tInitStruct);
|
|
|
|
//PA8: VN7008AJ_FrontLINActuatorPowerDriverAB
|
|
tInitStruct.u32PortPins = PORT_PIN_8;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTA_8_ADC1_SE3;
|
|
PORT_InitPins(PORT_A, &tInitStruct);
|
|
|
|
//PE11: tVN7008AJ_RearLINActuatorPowerDriverC
|
|
tInitStruct.u32PortPins = PORT_PIN_11;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTE_11_ADC1_SE4;
|
|
PORT_InitPins(PORT_E, &tInitStruct);
|
|
|
|
//PA6: PT_F_HVAC_VCC_DIAG
|
|
tInitStruct.u32PortPins = PORT_PIN_6;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTA_6_ADC1_SE9;
|
|
PORT_InitPins(PORT_A, &tInitStruct);
|
|
|
|
//PB14: PT_HVBchiller_VCC_DIAG
|
|
tInitStruct.u32PortPins = PORT_PIN_14;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTB_14_ADC1_SE18;
|
|
PORT_InitPins(PORT_B, &tInitStruct);
|
|
|
|
//PB8: PT_R_HVAC_VCC_DIAG
|
|
tInitStruct.u32PortPins = PORT_PIN_8;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTB_8_ADC1_SE28;
|
|
PORT_InitPins(PORT_B, &tInitStruct);
|
|
|
|
|
|
|
|
//PB15: Sensor_PT_fHVAC_P
|
|
tInitStruct.u32PortPins = PORT_PIN_15;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTB_15_ADC1_SE17;
|
|
PORT_InitPins(PORT_B, &tInitStruct);
|
|
|
|
//PE7: Sensor_PT_fHVAC_T
|
|
tInitStruct.u32PortPins = PORT_PIN_7;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTE_7_ADC1_SE8;
|
|
PORT_InitPins(PORT_B, &tInitStruct);
|
|
|
|
//PC25: Sensor_PT_rHVAC_T
|
|
tInitStruct.u32PortPins = PORT_PIN_25;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTC_25_ADC1_SE20;
|
|
PORT_InitPins(PORT_C, &tInitStruct);
|
|
|
|
//PC26: Sensor_HVBchiller_P
|
|
tInitStruct.u32PortPins = PORT_PIN_26;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTC_26_ADC1_SE21;
|
|
PORT_InitPins(PORT_C, &tInitStruct);
|
|
|
|
//PD25: Sensor_HVBchiller_T
|
|
tInitStruct.u32PortPins = PORT_PIN_25;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTD_25_ADC1_SE24;
|
|
PORT_InitPins(PORT_D, &tInitStruct);
|
|
|
|
//PB9: Sensor_PT_P_reserve
|
|
tInitStruct.u32PortPins = PORT_PIN_9;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTB_9_ADC1_SE25;
|
|
PORT_InitPins(PORT_B, &tInitStruct);
|
|
|
|
//PD26: Sensor_PT_T_reserve
|
|
tInitStruct.u32PortPins = PORT_PIN_26;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTD_26_ADC1_SE26;
|
|
PORT_InitPins(PORT_D, &tInitStruct);
|
|
|
|
//PA0: Sensor_B_T_reserve
|
|
tInitStruct.u32PortPins = PORT_PIN_0;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORTA_0_ADC1_SE30;
|
|
PORT_InitPins(PORT_A, &tInitStruct);
|
|
|
|
|
|
ADC_Initial(
|
|
&env->adc_1,
|
|
ADC_INSTANCE_1, // ADC_INSTANCE_0, ADC_INSTANCE_1
|
|
|
|
DMA_CHANNEL_3,
|
|
|
|
DMA3_IRQn,
|
|
0xFF,
|
|
DMA3_IRQn,
|
|
|
|
s_aAdc1ResultBuf,
|
|
|
|
ADC1_CHN_NUM_EN,
|
|
(ADC_ChannelCfgType *) s_aChannelsAdc1,
|
|
|
|
0,
|
|
0,
|
|
0,
|
|
|
|
Bsp_ADC1_HandleResult
|
|
);
|
|
|
|
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Initialization ADC1 - OK")
|
|
|
|
|
|
env->adc_1_IO = vAdcGetIo(&env->adc_1);
|
|
}
|