84 lines
2.4 KiB
C
84 lines
2.4 KiB
C
/* USER CODE BEGIN Header */
|
|
/**
|
|
******************************************************************************
|
|
* @file TIM/TIM_OnePulse/Inc/main.h
|
|
* @author MCD Application Team
|
|
* @brief Header for main.c module
|
|
******************************************************************************
|
|
* @attention
|
|
*
|
|
* Copyright (c) 2020 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 __MAIN_H
|
|
#define __MAIN_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* Includes ------------------------------------------------------------------*/
|
|
#include "stm32wlxx_hal.h"
|
|
|
|
/* Private includes ----------------------------------------------------------*/
|
|
/* USER CODE BEGIN Includes */
|
|
#include "stm32wlxx_nucleo.h"
|
|
/* USER CODE END Includes */
|
|
|
|
/* Exported types ------------------------------------------------------------*/
|
|
/* USER CODE BEGIN ET */
|
|
|
|
/* USER CODE END ET */
|
|
|
|
/* Exported constants --------------------------------------------------------*/
|
|
/* USER CODE BEGIN EC */
|
|
|
|
/* USER CODE END EC */
|
|
|
|
/* Exported macro ------------------------------------------------------------*/
|
|
/* USER CODE BEGIN EM */
|
|
|
|
/* USER CODE END EM */
|
|
|
|
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
|
|
|
|
/* Exported functions prototypes ---------------------------------------------*/
|
|
void Error_Handler(void);
|
|
|
|
/* USER CODE BEGIN EFP */
|
|
|
|
/* USER CODE END EFP */
|
|
|
|
/* Private defines -----------------------------------------------------------*/
|
|
/* USER CODE BEGIN Private defines */
|
|
/*## Compute the prescaler value, to have TIM1Freq = 1000000 Hz
|
|
* TIM1 input clock (TIM1CLK) is set to APB2 clock (PCLK2), since APB2
|
|
* prescaler is 1.
|
|
* TIM1CLK = PCLK2
|
|
* PCLK2 = HCLK
|
|
* TIM1CLK = SystemCoreClock
|
|
*
|
|
* Prescaler = (TIM1CLK /TIM1 counter clock) - 1
|
|
*
|
|
* The prescaler value is computed in order to have TIM1 counter clock
|
|
* set at 1000000 Hz.
|
|
*/
|
|
|
|
#define PRESCALER_VALUE (uint32_t)(((SystemCoreClock) / 1000000) - 1)
|
|
/* USER CODE END Private defines */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __MAIN_H */
|