OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 3066|回复: 3

stm32H7官方程序ADC_Regular_injected_groups中回调函数

[复制链接]

3

主题

15

帖子

0

精华

初级会员

Rank: 2

积分
73
金钱
73
注册时间
2019-2-14
在线时间
11 小时
发表于 2019-2-25 19:48:43 | 显示全部楼层 |阅读模式
1金钱
想请教一下/**  * @brief  Conversion complete callback in non blocking mode
  * @param  AdcHandle : ADC handle
  * @note   This example shows a simple way to report end of conversion
  *         and get conversion result. You can add your own implementation.
  * @retval None
  */
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc)
{
   uint32_t tmp_index = 0;
   uint32_t tmp_average = 0;
        /* Variable 32 bits for intermediate processing */
        /* When the 2nd half of the buffer is reached, compute these results while  */
  /* the 1st half of the buffer is updated by the ADC and DMA transfers.      */
  SCB_InvalidateDCache_by_Addr ((uint32_t *)&aADCxConvertedData[ADC_CONVERTED_DATA_BUFFER_SIZE/2], ADC_CONVERTED_DATA_BUFFER_SIZE);
         /* Process average of the 2nd half of the buffer */
  for (tmp_index = 0; tmp_index < (ADC_CONVERTED_DATA_BUFFER_SIZE/2); tmp_index++)
  {
    tmp_average += aADCxConvertedData[tmp_index + (ADC_CONVERTED_DATA_BUFFER_SIZE/2)];
  }
  tmp_average /= (ADC_CONVERTED_DATA_BUFFER_SIZE/2);
  uhADCxConvertedValue_Regular_Avg_half2 = (uint16_t)tmp_average;

  /* Affect pointer to the average of the 2nd half of ADC conversion results  */
  /* table of regular group, channel on rank1.                                */
  puhADCxConvertedValue_Regular_Avg = &uhADCxConvertedValue_Regular_Avg_half2;
}


这个回调函数是做什么用的。是官方H7板子中的程序工程如下。


ADC_Regular_injected_groups.rar

8.64 MB, 下载次数: 12

正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165536
金钱
165536
注册时间
2010-12-1
在线时间
2117 小时
发表于 2019-2-26 02:32:05 | 显示全部楼层
回复

使用道具 举报

3

主题

15

帖子

0

精华

初级会员

Rank: 2

积分
73
金钱
73
注册时间
2019-2-14
在线时间
11 小时
 楼主| 发表于 2019-2-26 09:56:47 | 显示全部楼层

原子哥帮忙看看呗
回复

使用道具 举报

3

主题

15

帖子

0

精华

初级会员

Rank: 2

积分
73
金钱
73
注册时间
2019-2-14
在线时间
11 小时
 楼主| 发表于 2019-3-1 19:39:02 | 显示全部楼层
是adc转换完之后就可以选择调用这个函数。。。。。自问自答。。。。。。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-6-10 00:03

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表