mirror of
https://gitee.com/dlmu-cone/tronone-h7-scaffold
synced 2026-07-23 19:25:09 +08:00
adc
This commit is contained in:
@@ -28,10 +28,8 @@ __attribute__((section (".AXI_SRAM"))) uint16_t ADC_Voltage_Val[2];
|
||||
*/
|
||||
void BSP_ADC_Init(void)
|
||||
{
|
||||
|
||||
HAL_ADCEx_Calibration_Start(&hadc1, ADC_CALIB_OFFSET, ADC_SINGLE_ENDED);
|
||||
HAL_ADC_Start_DMA(&hadc1, (uint32_t *) ADC_Voltage_Val, 2);
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -43,11 +41,8 @@ void BSP_ADC_Init(void)
|
||||
*/
|
||||
float USER_ADC_Voltage_Update(void)
|
||||
{
|
||||
|
||||
float Voltage;
|
||||
Voltage = (ADC_Voltage_Val[0] * 3.3f / 65535) * 11.0f;
|
||||
auto Voltage = (ADC_Voltage_Val[0] * 3.3f / 65535) * 11.0f;
|
||||
return Voltage;
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
15
openocd_cfg/CMSIS_DAP.cfg
Normal file
15
openocd_cfg/CMSIS_DAP.cfg
Normal file
@@ -0,0 +1,15 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#
|
||||
# ARM CMSIS-DAP compliant adapter
|
||||
#
|
||||
# http://www.keil.com/support/man/docs/dapdebug/
|
||||
#
|
||||
|
||||
adapter driver cmsis-dap
|
||||
transport select swd
|
||||
source [find target/stm32h7x.cfg]
|
||||
# download speed = 10MHz
|
||||
adapter speed 1000
|
||||
# Optionally specify the serial number of CMSIS-DAP usb device.
|
||||
# adapter serial 02200201E6661E601B98E3B9
|
||||
Reference in New Issue
Block a user