dac to adc test
This commit is contained in:
52
Core/Inc/adc.h
Normal file
52
Core/Inc/adc.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file adc.h
|
||||
* @brief This file contains all the function prototypes for
|
||||
* the adc.c file
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2023 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __ADC_H__
|
||||
#define __ADC_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
extern ADC_HandleTypeDef hadc1;
|
||||
|
||||
/* USER CODE BEGIN Private defines */
|
||||
|
||||
/* USER CODE END Private defines */
|
||||
|
||||
void MX_ADC1_Init(void);
|
||||
|
||||
/* USER CODE BEGIN Prototypes */
|
||||
|
||||
/* USER CODE END Prototypes */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ADC_H__ */
|
||||
|
||||
@@ -57,6 +57,7 @@ void Error_Handler(void);
|
||||
/* USER CODE END EFP */
|
||||
|
||||
/* Private defines -----------------------------------------------------------*/
|
||||
#define ADC_PULSES 1024
|
||||
#define B1_Pin GPIO_PIN_13
|
||||
#define B1_GPIO_Port GPIOC
|
||||
#define B1_EXTI_IRQn EXTI15_10_IRQn
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
#define HAL_MODULE_ENABLED
|
||||
|
||||
/*#define HAL_ADC_MODULE_ENABLED */
|
||||
#define HAL_ADC_MODULE_ENABLED
|
||||
/*#define HAL_COMP_MODULE_ENABLED */
|
||||
/*#define HAL_CORDIC_MODULE_ENABLED */
|
||||
/*#define HAL_CRC_MODULE_ENABLED */
|
||||
|
||||
@@ -58,6 +58,7 @@ void SysTick_Handler(void);
|
||||
void DMA1_Channel1_IRQHandler(void);
|
||||
void EXTI15_10_IRQHandler(void);
|
||||
void TIM7_DAC_IRQHandler(void);
|
||||
void DMA2_Channel1_IRQHandler(void);
|
||||
/* USER CODE BEGIN EFP */
|
||||
|
||||
/* USER CODE END EFP */
|
||||
|
||||
@@ -34,11 +34,14 @@ extern "C" {
|
||||
|
||||
extern TIM_HandleTypeDef htim7;
|
||||
|
||||
extern TIM_HandleTypeDef htim20;
|
||||
|
||||
/* USER CODE BEGIN Private defines */
|
||||
|
||||
/* USER CODE END Private defines */
|
||||
|
||||
void MX_TIM7_Init(void);
|
||||
void MX_TIM20_Init(void);
|
||||
|
||||
/* USER CODE BEGIN Prototypes */
|
||||
|
||||
|
||||
176
Core/Src/adc.c
Normal file
176
Core/Src/adc.c
Normal file
@@ -0,0 +1,176 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file adc.c
|
||||
* @brief This file provides code for the configuration
|
||||
* of the ADC instances.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2023 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "adc.h"
|
||||
|
||||
/* USER CODE BEGIN 0 */
|
||||
|
||||
/* USER CODE END 0 */
|
||||
|
||||
ADC_HandleTypeDef hadc1;
|
||||
DMA_HandleTypeDef hdma_adc1;
|
||||
|
||||
/* ADC1 init function */
|
||||
void MX_ADC1_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN ADC1_Init 0 */
|
||||
|
||||
/* USER CODE END ADC1_Init 0 */
|
||||
|
||||
ADC_MultiModeTypeDef multimode = {0};
|
||||
ADC_ChannelConfTypeDef sConfig = {0};
|
||||
|
||||
/* USER CODE BEGIN ADC1_Init 1 */
|
||||
|
||||
/* USER CODE END ADC1_Init 1 */
|
||||
|
||||
/** Common config
|
||||
*/
|
||||
hadc1.Instance = ADC1;
|
||||
hadc1.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV4;
|
||||
hadc1.Init.Resolution = ADC_RESOLUTION_12B;
|
||||
hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT;
|
||||
hadc1.Init.GainCompensation = 0;
|
||||
hadc1.Init.ScanConvMode = ADC_SCAN_DISABLE;
|
||||
hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV;
|
||||
hadc1.Init.LowPowerAutoWait = DISABLE;
|
||||
hadc1.Init.ContinuousConvMode = DISABLE;
|
||||
hadc1.Init.NbrOfConversion = 1;
|
||||
hadc1.Init.DiscontinuousConvMode = DISABLE;
|
||||
hadc1.Init.ExternalTrigConv = ADC_EXTERNALTRIG_T20_TRGO;
|
||||
hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_RISING;
|
||||
hadc1.Init.DMAContinuousRequests = ENABLE;
|
||||
hadc1.Init.Overrun = ADC_OVR_DATA_PRESERVED;
|
||||
hadc1.Init.OversamplingMode = DISABLE;
|
||||
if (HAL_ADC_Init(&hadc1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/** Configure the ADC multi-mode
|
||||
*/
|
||||
multimode.Mode = ADC_MODE_INDEPENDENT;
|
||||
if (HAL_ADCEx_MultiModeConfigChannel(&hadc1, &multimode) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/** Configure Regular Channel
|
||||
*/
|
||||
sConfig.Channel = ADC_CHANNEL_14;
|
||||
sConfig.Rank = ADC_REGULAR_RANK_1;
|
||||
sConfig.SamplingTime = ADC_SAMPLETIME_2CYCLES_5;
|
||||
sConfig.SingleDiff = ADC_SINGLE_ENDED;
|
||||
sConfig.OffsetNumber = ADC_OFFSET_NONE;
|
||||
sConfig.Offset = 0;
|
||||
if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN ADC1_Init 2 */
|
||||
|
||||
/* USER CODE END ADC1_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
void HAL_ADC_MspInit(ADC_HandleTypeDef* adcHandle)
|
||||
{
|
||||
|
||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
|
||||
if(adcHandle->Instance==ADC1)
|
||||
{
|
||||
/* USER CODE BEGIN ADC1_MspInit 0 */
|
||||
|
||||
/* USER CODE END ADC1_MspInit 0 */
|
||||
|
||||
/** Initializes the peripherals clocks
|
||||
*/
|
||||
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC12;
|
||||
PeriphClkInit.Adc12ClockSelection = RCC_ADC12CLKSOURCE_SYSCLK;
|
||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/* ADC1 clock enable */
|
||||
__HAL_RCC_ADC12_CLK_ENABLE();
|
||||
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
/**ADC1 GPIO Configuration
|
||||
PB11 ------> ADC1_IN14
|
||||
*/
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_11;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
/* ADC1 DMA Init */
|
||||
/* ADC1 Init */
|
||||
hdma_adc1.Instance = DMA2_Channel1;
|
||||
hdma_adc1.Init.Request = DMA_REQUEST_ADC1;
|
||||
hdma_adc1.Init.Direction = DMA_PERIPH_TO_MEMORY;
|
||||
hdma_adc1.Init.PeriphInc = DMA_PINC_DISABLE;
|
||||
hdma_adc1.Init.MemInc = DMA_MINC_ENABLE;
|
||||
hdma_adc1.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
|
||||
hdma_adc1.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;
|
||||
hdma_adc1.Init.Mode = DMA_CIRCULAR;
|
||||
hdma_adc1.Init.Priority = DMA_PRIORITY_LOW;
|
||||
if (HAL_DMA_Init(&hdma_adc1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
__HAL_LINKDMA(adcHandle,DMA_Handle,hdma_adc1);
|
||||
|
||||
/* USER CODE BEGIN ADC1_MspInit 1 */
|
||||
|
||||
/* USER CODE END ADC1_MspInit 1 */
|
||||
}
|
||||
}
|
||||
|
||||
void HAL_ADC_MspDeInit(ADC_HandleTypeDef* adcHandle)
|
||||
{
|
||||
|
||||
if(adcHandle->Instance==ADC1)
|
||||
{
|
||||
/* USER CODE BEGIN ADC1_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END ADC1_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_ADC12_CLK_DISABLE();
|
||||
|
||||
/**ADC1 GPIO Configuration
|
||||
PB11 ------> ADC1_IN14
|
||||
*/
|
||||
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_11);
|
||||
|
||||
/* ADC1 DMA DeInit */
|
||||
HAL_DMA_DeInit(adcHandle->DMA_Handle);
|
||||
/* USER CODE BEGIN ADC1_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END ADC1_MspDeInit 1 */
|
||||
}
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
/* USER CODE END 1 */
|
||||
@@ -42,11 +42,15 @@ void MX_DMA_Init(void)
|
||||
/* DMA controller clock enable */
|
||||
__HAL_RCC_DMAMUX1_CLK_ENABLE();
|
||||
__HAL_RCC_DMA1_CLK_ENABLE();
|
||||
__HAL_RCC_DMA2_CLK_ENABLE();
|
||||
|
||||
/* DMA interrupt init */
|
||||
/* DMA1_Channel1_IRQn interrupt configuration */
|
||||
HAL_NVIC_SetPriority(DMA1_Channel1_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(DMA1_Channel1_IRQn);
|
||||
/* DMA2_Channel1_IRQn interrupt configuration */
|
||||
HAL_NVIC_SetPriority(DMA2_Channel1_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(DMA2_Channel1_IRQn);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
/* USER CODE END Header */
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
#include "adc.h"
|
||||
#include "dac.h"
|
||||
#include "dma.h"
|
||||
#include "usart.h"
|
||||
@@ -27,7 +28,7 @@
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
#include "printf.h"
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
@@ -37,7 +38,8 @@
|
||||
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PD */
|
||||
#define DAC_LENGHT 16
|
||||
#define DAC_LENGHT 1024
|
||||
#define ADC_LENGHT ADC_PULSES
|
||||
/* USER CODE END PD */
|
||||
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
@@ -48,9 +50,11 @@
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
|
||||
/* USER CODE BEGIN PV */
|
||||
volatile uint8_t dac_no;
|
||||
volatile uint32_t soft_timer, data_ready;
|
||||
uint8_t uart_data[32];
|
||||
uint16_t dac_data_ch1[DAC_LENGHT];
|
||||
uint16_t dac_data_ch2[DAC_LENGHT];
|
||||
uint16_t adc_data[ADC_LENGHT];
|
||||
/* USER CODE END PV */
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
@@ -98,6 +102,8 @@ int main(void)
|
||||
MX_LPUART1_UART_Init();
|
||||
MX_OPAMP4_Init();
|
||||
MX_TIM7_Init();
|
||||
MX_ADC1_Init();
|
||||
MX_TIM20_Init();
|
||||
|
||||
/* Initialize interrupts */
|
||||
MX_NVIC_Init();
|
||||
@@ -116,32 +122,47 @@ int main(void)
|
||||
}
|
||||
}
|
||||
|
||||
htim7.Instance->PSC = 0;
|
||||
htim7.Instance->ARR = 84;
|
||||
|
||||
HAL_DAC_Start_DMA(&hdac4, DAC_CHANNEL_1, (uint32_t *)dac_data_ch1, DAC_LENGHT, DAC_ALIGN_12B_R);
|
||||
HAL_ADC_Start_DMA(&hadc1, (uint32_t *)adc_data, ADC_LENGHT);
|
||||
// HAL_DAC_Start_DMA(&hdac4, DAC_CHANNEL_2, (uint32_t *)dac_data_ch2, DAC_LENGHT, DAC_ALIGN_12B_R);
|
||||
// HAL_DAC_Start(&hdac4, DAC_CHANNEL_1);
|
||||
// HAL_DAC_Start(&hdac4, DAC_CHANNEL_2);
|
||||
HAL_OPAMP_Start(&hopamp4);
|
||||
// HAL_OPAMP_Start(&hopamp5);
|
||||
HAL_TIM_Base_Start_IT(&htim7);
|
||||
HAL_TIM_OnePulse_Start(&htim20, TIM_CHANNEL_1);
|
||||
/* USER CODE END 2 */
|
||||
|
||||
/* Infinite loop */
|
||||
/* USER CODE BEGIN WHILE */
|
||||
uint8_t i = 0;
|
||||
int8_t count = 0;
|
||||
while (1)
|
||||
{
|
||||
// HAL_DAC_SetValue(&hdac4, DAC_CHANNEL_1, DAC_ALIGN_12B_R, dac_data_ch1[i]);
|
||||
// HAL_DAC_SetValue(&hdac4, DAC_CHANNEL_2, DAC_ALIGN_12B_R, dac_data_ch1[i++]);
|
||||
|
||||
if (i >= DAC_LENGHT)
|
||||
if (data_ready)
|
||||
{
|
||||
i = 0;
|
||||
HAL_UART_Transmit(&hlpuart1, (uint8_t *)"*******************************\n", 32, HAL_MAX_DELAY);
|
||||
for (size_t i = 0; i < ADC_LENGHT; i++)
|
||||
{
|
||||
count = snprintf((char *)uart_data, 32, "%u, %u\n", i, adc_data[i]);
|
||||
if (count < 0 || count >= 32)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
HAL_UART_Transmit(&hlpuart1, uart_data, count, HAL_MAX_DELAY);
|
||||
adc_data[i] = 0;
|
||||
}
|
||||
HAL_UART_Transmit(&hlpuart1, (uint8_t *)"*******************************\n", 32, HAL_MAX_DELAY);
|
||||
}
|
||||
|
||||
// HAL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin);
|
||||
HAL_Delay(1000);
|
||||
htim7.Instance->PSC = 100;
|
||||
htim7.Instance->ARR = 170;
|
||||
|
||||
/* USER CODE END WHILE */
|
||||
|
||||
/* USER CODE BEGIN 3 */
|
||||
@@ -207,14 +228,23 @@ static void MX_NVIC_Init(void)
|
||||
/* USER CODE BEGIN 4 */
|
||||
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
|
||||
{
|
||||
HAL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin);
|
||||
if (htim->Instance == TIM7)
|
||||
{
|
||||
HAL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin);
|
||||
}
|
||||
}
|
||||
|
||||
void HAL_DAC_ConvHalfCpltCallbackCh1(DAC_HandleTypeDef *hdac)
|
||||
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc)
|
||||
{
|
||||
if (hdac->Instance == DAC4)
|
||||
data_ready++;
|
||||
}
|
||||
|
||||
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
|
||||
{
|
||||
if (GPIO_Pin == B1_Pin && soft_timer + 50 < HAL_GetTick())
|
||||
{
|
||||
dac_no = 1;
|
||||
soft_timer = HAL_GetTick();
|
||||
__HAL_TIM_ENABLE(&htim20);
|
||||
}
|
||||
}
|
||||
/* USER CODE END 4 */
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
/* USER CODE END 0 */
|
||||
|
||||
/* External variables --------------------------------------------------------*/
|
||||
extern DMA_HandleTypeDef hdma_adc1;
|
||||
extern DMA_HandleTypeDef hdma_dac4_ch1;
|
||||
extern DAC_HandleTypeDef hdac4;
|
||||
extern TIM_HandleTypeDef htim7;
|
||||
@@ -243,6 +244,20 @@ void TIM7_DAC_IRQHandler(void)
|
||||
/* USER CODE END TIM7_DAC_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles DMA2 channel1 global interrupt.
|
||||
*/
|
||||
void DMA2_Channel1_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN DMA2_Channel1_IRQn 0 */
|
||||
|
||||
/* USER CODE END DMA2_Channel1_IRQn 0 */
|
||||
HAL_DMA_IRQHandler(&hdma_adc1);
|
||||
/* USER CODE BEGIN DMA2_Channel1_IRQn 1 */
|
||||
|
||||
/* USER CODE END DMA2_Channel1_IRQn 1 */
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
/* USER CODE END 1 */
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
/* USER CODE END 0 */
|
||||
|
||||
TIM_HandleTypeDef htim7;
|
||||
TIM_HandleTypeDef htim20;
|
||||
|
||||
/* TIM7 init function */
|
||||
void MX_TIM7_Init(void)
|
||||
@@ -58,6 +59,52 @@ void MX_TIM7_Init(void)
|
||||
|
||||
/* USER CODE END TIM7_Init 2 */
|
||||
|
||||
}
|
||||
/* TIM20 init function */
|
||||
void MX_TIM20_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN TIM20_Init 0 */
|
||||
|
||||
/* USER CODE END TIM20_Init 0 */
|
||||
|
||||
TIM_ClockConfigTypeDef sClockSourceConfig = {0};
|
||||
TIM_MasterConfigTypeDef sMasterConfig = {0};
|
||||
|
||||
/* USER CODE BEGIN TIM20_Init 1 */
|
||||
|
||||
/* USER CODE END TIM20_Init 1 */
|
||||
htim20.Instance = TIM20;
|
||||
htim20.Init.Prescaler = 0;
|
||||
htim20.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim20.Init.Period = 65535;
|
||||
htim20.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
htim20.Init.RepetitionCounter = ADC_PULSES;
|
||||
htim20.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||
if (HAL_TIM_Base_Init(&htim20) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
|
||||
if (HAL_TIM_ConfigClockSource(&htim20, &sClockSourceConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
if (HAL_TIM_OnePulse_Init(&htim20, TIM_OPMODE_SINGLE) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_UPDATE;
|
||||
sMasterConfig.MasterOutputTrigger2 = TIM_TRGO2_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim20, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN TIM20_Init 2 */
|
||||
|
||||
/* USER CODE END TIM20_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle)
|
||||
@@ -74,6 +121,17 @@ void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle)
|
||||
|
||||
/* USER CODE END TIM7_MspInit 1 */
|
||||
}
|
||||
else if(tim_baseHandle->Instance==TIM20)
|
||||
{
|
||||
/* USER CODE BEGIN TIM20_MspInit 0 */
|
||||
|
||||
/* USER CODE END TIM20_MspInit 0 */
|
||||
/* TIM20 clock enable */
|
||||
__HAL_RCC_TIM20_CLK_ENABLE();
|
||||
/* USER CODE BEGIN TIM20_MspInit 1 */
|
||||
|
||||
/* USER CODE END TIM20_MspInit 1 */
|
||||
}
|
||||
}
|
||||
|
||||
void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle)
|
||||
@@ -100,6 +158,17 @@ void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle)
|
||||
|
||||
/* USER CODE END TIM7_MspDeInit 1 */
|
||||
}
|
||||
else if(tim_baseHandle->Instance==TIM20)
|
||||
{
|
||||
/* USER CODE BEGIN TIM20_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END TIM20_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_TIM20_CLK_DISABLE();
|
||||
/* USER CODE BEGIN TIM20_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END TIM20_MspDeInit 1 */
|
||||
}
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
Reference in New Issue
Block a user