变更
This commit is contained in:
5
BoooomCTL/Data/Current/Current.c
Normal file
5
BoooomCTL/Data/Current/Current.c
Normal file
@@ -0,0 +1,5 @@
|
||||
//
|
||||
// Created by ZK on 2023/3/14.
|
||||
//
|
||||
|
||||
#include "Current.h"
|
||||
8
BoooomCTL/Data/Current/Current.h
Normal file
8
BoooomCTL/Data/Current/Current.h
Normal file
@@ -0,0 +1,8 @@
|
||||
//
|
||||
// Created by ZK on 2023/3/14.
|
||||
//
|
||||
|
||||
#ifndef BOOOOMFOC_STSPIN32G4_EVB_CURRENT_H
|
||||
#define BOOOOMFOC_STSPIN32G4_EVB_CURRENT_H
|
||||
|
||||
#endif //BOOOOMFOC_STSPIN32G4_EVB_CURRENT_H
|
||||
21
BoooomCTL/Data/Current/InteriorADC/InteriorADC.c
Normal file
21
BoooomCTL/Data/Current/InteriorADC/InteriorADC.c
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// Created by ZK on 2023/3/14.
|
||||
//
|
||||
|
||||
#include "InteriorADC.h"
|
||||
|
||||
|
||||
bool InteriorADC_Init(void) {
|
||||
//使能ADC注入
|
||||
HAL_ADCEx_Calibration_Start(&hadc1, ADC_SINGLE_ENDED);
|
||||
HAL_ADCEx_Calibration_Start(&hadc2, ADC_SINGLE_ENDED);
|
||||
|
||||
HAL_Delay(100);
|
||||
HAL_ADCEx_InjectedStart(&hadc1);
|
||||
__HAL_ADC_ENABLE_IT(&hadc1, ADC_IT_JEOC);
|
||||
HAL_ADCEx_InjectedStart(&hadc2);
|
||||
__HAL_ADC_ENABLE_IT(&hadc2, ADC_IT_JEOC);
|
||||
|
||||
|
||||
return 0;//返回值为零表示初始化成功
|
||||
}
|
||||
12
BoooomCTL/Data/Current/InteriorADC/InteriorADC.h
Normal file
12
BoooomCTL/Data/Current/InteriorADC/InteriorADC.h
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// Created by ZK on 2023/3/14.
|
||||
//
|
||||
|
||||
#ifndef BOOOOMFOC_STSPIN32G4_EVB_INTERIORADC_H
|
||||
#define BOOOOMFOC_STSPIN32G4_EVB_INTERIORADC_H
|
||||
#include "APP_Main.h"
|
||||
|
||||
|
||||
bool InteriorADC_Init(void);
|
||||
|
||||
#endif //BOOOOMFOC_STSPIN32G4_EVB_INTERIORADC_H
|
||||
Reference in New Issue
Block a user