2 ******************************************************************************
3 * @file stm32h7xx_ll_fmac.c
4 * @author MCD Application Team
5 * @brief FMAC LL module driver.
6 ******************************************************************************
9 * <h2><center>© Copyright (c) 2017 STMicroelectronics.
10 * All rights reserved.</center></h2>
12 * This software component is licensed by ST under BSD 3-Clause license,
13 * the "License"; You may not use this file except in compliance with the
14 * License. You may obtain a copy of the License at:
15 * opensource.org/licenses/BSD-3-Clause
17 ******************************************************************************
19 #if defined(USE_FULL_LL_DRIVER)
21 /* Includes ------------------------------------------------------------------*/
22 #include "stm32h7xx_ll_fmac.h"
23 #include "stm32h7xx_ll_bus.h"
25 /** @addtogroup STM32H7xx_LL_Driver
31 /** @addtogroup FMAC_LL
35 /* Private types -------------------------------------------------------------*/
36 /* Private variables ---------------------------------------------------------*/
37 /* Private constants ---------------------------------------------------------*/
38 /* Private macros ------------------------------------------------------------*/
39 /** @addtogroup FMAC_LL_Private_Macros
43 /** @brief Check if the watermark value is a valid one.
44 * @param __VALUE__ Watermak value.
45 * @retval SET (__VALUE__ is a valid value) or RESET (__VALUE__ is invalid)
47 #define IS_LL_FMAC_WM(__VALUE__) (((__VALUE__) == LL_FMAC_WM_0_THRESHOLD_1) \
48 || ((__VALUE__) == LL_FMAC_WM_1_THRESHOLD_2) \
49 || ((__VALUE__) == LL_FMAC_WM_2_THRESHOLD_4) \
50 || ((__VALUE__) == LL_FMAC_WM_3_THRESHOLD_8))
52 /** @brief Check if the function ID is a valid one.
53 * @param __VALUE__ Function ID.
54 * @retval SET (__VALUE__ is a valid value) or RESET (__VALUE__ is invalid)
56 #define IS_LL_FMAC_FUNC(__VALUE__) (((__VALUE__) == LL_FMAC_FUNC_LOAD_X1) \
57 || ((__VALUE__) == LL_FMAC_FUNC_LOAD_X2) \
58 || ((__VALUE__) == LL_FMAC_FUNC_LOAD_Y) \
59 || ((__VALUE__) == LL_FMAC_FUNC_CONVO_FIR) \
60 || ((__VALUE__) == LL_FMAC_FUNC_IIR_DIRECT_FORM_1))
67 /* Private function prototypes -----------------------------------------------*/
69 /* Exported functions --------------------------------------------------------*/
70 /** @addtogroup FMAC_LL_Exported_Functions
74 /** @addtogroup FMAC_LL_EF_Init
79 * @brief Initialize FMAC peripheral registers to their default reset values.
80 * @param FMACx FMAC Instance
81 * @retval An ErrorStatus enumeration value:
82 * - SUCCESS: FMAC registers are initialized
83 * - ERROR: FMAC registers are not initialized
85 ErrorStatus
LL_FMAC_Init(FMAC_TypeDef
*FMACx
)
87 ErrorStatus status
= SUCCESS
;
89 /* Check the parameters */
90 assert_param(IS_FMAC_ALL_INSTANCE(FMACx
));
94 /* Perform the reset */
95 LL_FMAC_EnableReset(FMACx
);
97 /* Wait until flag is reset */
98 while (LL_FMAC_IsEnabledReset(FMACx
) != 0UL)
111 * @brief De-Initialize FMAC peripheral registers to their default reset values.
112 * @param FMACx FMAC Instance
113 * @retval An ErrorStatus enumeration value:
114 * - SUCCESS: FMAC registers are de-initialized
115 * - ERROR: FMAC registers are not de-initialized
117 ErrorStatus
LL_FMAC_DeInit(FMAC_TypeDef
*FMACx
)
119 ErrorStatus status
= SUCCESS
;
121 /* Check the parameters */
122 assert_param(IS_FMAC_ALL_INSTANCE(FMACx
));
126 /* Force FMAC reset */
127 LL_AHB2_GRP1_ForceReset(LL_AHB2_GRP1_PERIPH_FMAC
);
129 /* Release FMAC reset */
130 LL_AHB2_GRP1_ReleaseReset(LL_AHB2_GRP1_PERIPH_FMAC
);
154 #endif /* defined(FMAC) */
160 #endif /* USE_FULL_LL_DRIVER */
162 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/