金牌会员
 
- 积分
- 1757
- 金钱
- 1757
- 注册时间
- 2018-4-28
- 在线时间
- 242 小时
|
1金钱
HAL库的DMA进行ADC数据采集有问题
STM32CubeH7 Firmware Package V1.9.0 / 12-February-2021
HAL_StatusTypeDef HAL_ADC_Start_DMA(ADC_HandleTypeDef *hadc, uint32_t *pData, uint32_t Length)
/* Enable ADC DMA mode*/
#if defined(ADC_VER_V5_V90) 这里条件为什么不成立 ADC3无法采到数据
if (hadc->Instance == ADC3)
{
LL_ADC_REG_SetDMATransferMode(hadc->Instance, ADC3_CFGR_DMACONTREQ((uint32_t)hadc->Init.DMAContinuousRequests));
LL_ADC_EnableDMAReq(hadc->Instance);
}
else
{
LL_ADC_REG_SetDataTransferMode(hadc->Instance, ADC_CFGR_DMACONTREQ((uint32_t)hadc->Init.ConversionDataManagement));
}
#else
LL_ADC_REG_SetDataTransferMode(hadc->Instance, (uint32_t)hadc->Init.ConversionDataManagement);
#endif
|
|