g431_double_motor/Core/Src/fmac.c
2025-05-08 23:58:02 +08:00

86 lines
1.9 KiB
C

/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file fmac.c
* @brief This file provides code for the configuration
* of the FMAC instances.
******************************************************************************
* @attention
*
* Copyright (c) 2025 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 "fmac.h"
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
FMAC_HandleTypeDef hfmac;
/* FMAC init function */
void MX_FMAC_Init(void)
{
/* USER CODE BEGIN FMAC_Init 0 */
/* USER CODE END FMAC_Init 0 */
/* USER CODE BEGIN FMAC_Init 1 */
/* USER CODE END FMAC_Init 1 */
hfmac.Instance = FMAC;
if (HAL_FMAC_Init(&hfmac) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN FMAC_Init 2 */
/* USER CODE END FMAC_Init 2 */
}
void HAL_FMAC_MspInit(FMAC_HandleTypeDef* fmacHandle)
{
if(fmacHandle->Instance==FMAC)
{
/* USER CODE BEGIN FMAC_MspInit 0 */
/* USER CODE END FMAC_MspInit 0 */
/* FMAC clock enable */
__HAL_RCC_FMAC_CLK_ENABLE();
/* USER CODE BEGIN FMAC_MspInit 1 */
/* USER CODE END FMAC_MspInit 1 */
}
}
void HAL_FMAC_MspDeInit(FMAC_HandleTypeDef* fmacHandle)
{
if(fmacHandle->Instance==FMAC)
{
/* USER CODE BEGIN FMAC_MspDeInit 0 */
/* USER CODE END FMAC_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_FMAC_CLK_DISABLE();
/* USER CODE BEGIN FMAC_MspDeInit 1 */
/* USER CODE END FMAC_MspDeInit 1 */
}
}
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */