先是HAL大致驱动模块部件
MAIN函数运行流程 { HAL_Init(); SystemClock_Config(); /* Configures User push-button */ BSP_PB_Init(BUTTON_USER, BUTTON_MODE_EXTI); /*##-1- Configure the DAC peripheral #######################################*/ DacHandle.Instance = DACx; /*##-2- Configure the TIM peripheral #######################################*/ TIM6_Config(); /* Infinite loop */ while (1) { /* If the Key is pressed */ if (ubKeyPressed != RESET) { HAL_DAC_DeInit(&DacHandle); /* select waves forms according to the User push-button status */ if (ubSelectedWavesForm == 1) {接下来就是三角波产生的函数, /* The triangle wave has been selected */ /* Triangle Wave generator -------------------------------------------*/ DAC_Ch1_TriangleConfig(); }产生三角波 else {产生阶梯波形 /* The escalator wave has been selected */ /* Escalator Wave generator -------------------------------------------*/ DAC_Ch1_EscalatorConfig(); } ubKeyPressed = RESET; } } } 首先说说STM32的DAC模块配置过程。
梯形波需要设一个数组。
触发源可能的列表
好像不够了 |
| 多谢分享,赞~! |
多谢分享 |
| 感谢分享! |
| 学习了,不错。 |
| O(∩_∩)O谢谢大家支持 |
学习了,多谢楼主分享 |
| 学习了,HAL |
| 谢谢分享 |
微信公众号
手机版