![]() |
|
|||
File indexing completed on 2025-05-11 08:23:37
0001 /** 0002 ****************************************************************************** 0003 * @file stm32h7xx_ll_fmac.h 0004 * @author MCD Application Team 0005 * @brief Header file of FMAC LL module. 0006 ****************************************************************************** 0007 * @attention 0008 * 0009 * Copyright (c) 2017 STMicroelectronics. 0010 * All rights reserved. 0011 * 0012 * This software is licensed under terms that can be found in the LICENSE file 0013 * in the root directory of this software component. 0014 * If no LICENSE file comes with this software, it is provided AS-IS. 0015 * 0016 ****************************************************************************** 0017 */ 0018 0019 /* Define to prevent recursive inclusion -------------------------------------*/ 0020 #ifndef STM32H7xx_LL_FMAC_H 0021 #define STM32H7xx_LL_FMAC_H 0022 0023 #ifdef __cplusplus 0024 extern "C" { 0025 #endif 0026 0027 /* Includes ------------------------------------------------------------------*/ 0028 #include "stm32h7xx.h" 0029 0030 /** @addtogroup STM32H7xx_LL_Driver 0031 * @{ 0032 */ 0033 0034 #if defined(FMAC) 0035 0036 /** @defgroup FMAC_LL FMAC 0037 * @ingroup RTEMSBSPsARMSTM32H7 0038 * @{ 0039 */ 0040 0041 /* Exported types ------------------------------------------------------------*/ 0042 0043 /* Exported constants --------------------------------------------------------*/ 0044 /** @defgroup FMAC_LL_Exported_Constants FMAC Exported Constants 0045 * @ingroup RTEMSBSPsARMSTM32H7 0046 * @{ 0047 */ 0048 0049 /** @defgroup FMAC_LL_EC_GET_FLAG Get Flag Defines 0050 * @ingroup RTEMSBSPsARMSTM32H7 0051 * @brief Flag defines which can be used with LL_FMAC_ReadReg function 0052 * @{ 0053 */ 0054 #define LL_FMAC_SR_SAT FMAC_SR_SAT /*!< Saturation Error Flag 0055 (this helps in debugging a filter) */ 0056 #define LL_FMAC_SR_UNFL FMAC_SR_UNFL /*!< Underflow Error Flag */ 0057 #define LL_FMAC_SR_OVFL FMAC_SR_OVFL /*!< Overflow Error Flag */ 0058 #define LL_FMAC_SR_X1FULL FMAC_SR_X1FULL /*!< X1 Buffer Full Flag */ 0059 #define LL_FMAC_SR_YEMPTY FMAC_SR_YEMPTY /*!< Y Buffer Empty Flag */ 0060 /** 0061 * @} 0062 */ 0063 0064 /** @defgroup FMAC_LL_EC_IT IT Defines 0065 * @ingroup RTEMSBSPsARMSTM32H7 0066 * @brief IT defines which can be used with LL_FMAC_ReadReg and LL_FMAC_WriteReg functions 0067 * @{ 0068 */ 0069 #define LL_FMAC_CR_SATIEN FMAC_CR_SATIEN /*!< Saturation Error Interrupt Enable 0070 (this helps in debugging a filter) */ 0071 #define LL_FMAC_CR_UNFLIEN FMAC_CR_UNFLIEN /*!< Underflow Error Interrupt Enable */ 0072 #define LL_FMAC_CR_OVFLIEN FMAC_CR_OVFLIEN /*!< Overflow Error Interrupt Enable */ 0073 #define LL_FMAC_CR_WIEN FMAC_CR_WIEN /*!< Write Interrupt Enable */ 0074 #define LL_FMAC_CR_RIEN FMAC_CR_RIEN /*!< Read Interrupt Enable */ 0075 /** 0076 * @} 0077 */ 0078 0079 /** @defgroup FMAC_LL_EC_WM FMAC watermarks 0080 * @ingroup RTEMSBSPsARMSTM32H7 0081 * @brief Watermark defines that can be used for buffer full (input) or buffer empty (output) 0082 * @{ 0083 */ 0084 #define LL_FMAC_WM_0_THRESHOLD_1 0x00000000U /*!< Buffer full/empty flag set if there 0085 is less than 1 free/unread space. */ 0086 #define LL_FMAC_WM_1_THRESHOLD_2 0x01000000U /*!< Buffer full/empty flag set if there 0087 are less than 2 free/unread spaces. */ 0088 #define LL_FMAC_WM_2_THRESHOLD_4 0x02000000U /*!< Buffer full/empty flag set if there 0089 are less than 4 free/unread spaces. */ 0090 #define LL_FMAC_WM_3_THRESHOLD_8 0x03000000U /*!< Buffer full/empty flag set if there 0091 are less than 8 free/empty spaces. */ 0092 /** 0093 * @} 0094 */ 0095 0096 /** @defgroup FMAC_LL_EC_FUNC FMAC functions 0097 * @ingroup RTEMSBSPsARMSTM32H7 0098 * @{ 0099 */ 0100 #define LL_FMAC_FUNC_LOAD_X1 (FMAC_PARAM_FUNC_0) /*!< Load X1 buffer */ 0101 #define LL_FMAC_FUNC_LOAD_X2 (FMAC_PARAM_FUNC_1) /*!< Load X2 buffer */ 0102 #define LL_FMAC_FUNC_LOAD_Y (FMAC_PARAM_FUNC_1 | FMAC_PARAM_FUNC_0) /*!< Load Y buffer */ 0103 #define LL_FMAC_FUNC_CONVO_FIR (FMAC_PARAM_FUNC_3) /*!< Convolution (FIR filter) */ 0104 #define LL_FMAC_FUNC_IIR_DIRECT_FORM_1 (FMAC_PARAM_FUNC_3 | FMAC_PARAM_FUNC_0) /*!< IIR filter (direct form 1) */ 0105 /** 0106 * @} 0107 */ 0108 0109 /** @defgroup FMAC_LL_EC_PROCESSING FMAC processing 0110 * @ingroup RTEMSBSPsARMSTM32H7 0111 * @{ 0112 */ 0113 #define LL_FMAC_PROCESSING_STOP 0x00U /*!< Stop FMAC Processing */ 0114 #define LL_FMAC_PROCESSING_START 0x01U /*!< Start FMAC Processing */ 0115 /** 0116 * @} 0117 */ 0118 0119 /** 0120 * @} 0121 */ 0122 0123 /* External variables --------------------------------------------------------*/ 0124 /* Exported macros -----------------------------------------------------------*/ 0125 /** @defgroup FMAC_LL_Exported_Macros FMAC Exported Macros 0126 * @ingroup RTEMSBSPsARMSTM32H7 0127 * @{ 0128 */ 0129 0130 /** @defgroup FMAC_LL_EM_WRITE_READ Common Write and read registers Macros 0131 * @ingroup RTEMSBSPsARMSTM32H7 0132 * @{ 0133 */ 0134 0135 /** 0136 * @brief Write a value in FMAC register 0137 * @param __INSTANCE__ FMAC Instance 0138 * @param __REG__ Register to be written 0139 * @param __VALUE__ Value to be written in the register 0140 * @retval None 0141 */ 0142 #define LL_FMAC_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__)) 0143 0144 /** 0145 * @brief Read a value in FMAC register 0146 * @param __INSTANCE__ FMAC Instance 0147 * @param __REG__ Register to be read 0148 * @retval Register value 0149 */ 0150 #define LL_FMAC_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__) 0151 /** 0152 * @} 0153 */ 0154 0155 /** 0156 * @} 0157 */ 0158 0159 0160 /* Exported functions --------------------------------------------------------*/ 0161 0162 /** @defgroup FMAC_LL_Exported_Functions FMAC Exported Functions 0163 * @ingroup RTEMSBSPsARMSTM32H7 0164 * @{ 0165 */ 0166 0167 /** @defgroup FMAC_LL_EF_Configuration FMAC Configuration functions 0168 * @ingroup RTEMSBSPsARMSTM32H7 0169 * @{ 0170 */ 0171 0172 /** 0173 * @brief Configure X1 full watermark. 0174 * @rmtoll X1BUFCFG FULL_WM LL_FMAC_SetX1FullWatermark 0175 * @param FMACx FMAC instance 0176 * @param Watermark This parameter can be one of the following values: 0177 * @arg @ref LL_FMAC_WM_0_THRESHOLD_1 0178 * @arg @ref LL_FMAC_WM_1_THRESHOLD_2 0179 * @arg @ref LL_FMAC_WM_2_THRESHOLD_4 0180 * @arg @ref LL_FMAC_WM_3_THRESHOLD_8 0181 * @retval None 0182 */ 0183 __STATIC_INLINE void LL_FMAC_SetX1FullWatermark(FMAC_TypeDef *FMACx, uint32_t Watermark) 0184 { 0185 MODIFY_REG(FMACx->X1BUFCFG, FMAC_X1BUFCFG_FULL_WM, Watermark); 0186 } 0187 0188 /** 0189 * @brief Return X1 full watermark. 0190 * @rmtoll X1BUFCFG FULL_WM LL_FMAC_GetX1FullWatermark 0191 * @param FMACx FMAC instance 0192 * @retval uint32_t Returned value can be one of the following values: 0193 * @arg @ref LL_FMAC_WM_0_THRESHOLD_1 0194 * @arg @ref LL_FMAC_WM_1_THRESHOLD_2 0195 * @arg @ref LL_FMAC_WM_2_THRESHOLD_4 0196 * @arg @ref LL_FMAC_WM_3_THRESHOLD_8 0197 */ 0198 __STATIC_INLINE uint32_t LL_FMAC_GetX1FullWatermark(const FMAC_TypeDef *FMACx) 0199 { 0200 return (uint32_t)(READ_BIT(FMACx->X1BUFCFG, FMAC_X1BUFCFG_FULL_WM)); 0201 } 0202 0203 /** 0204 * @brief Configure X1 buffer size. 0205 * @rmtoll X1BUFCFG X1_BUF_SIZE LL_FMAC_SetX1BufferSize 0206 * @param FMACx FMAC instance 0207 * @param BufferSize Number of 16-bit words allocated to the input buffer (including the optional "headroom"). 0208 * This parameter must be a number between Min_Data=0x01 and Max_Data=0xFF. 0209 * @retval None 0210 */ 0211 __STATIC_INLINE void LL_FMAC_SetX1BufferSize(FMAC_TypeDef *FMACx, uint8_t BufferSize) 0212 { 0213 MODIFY_REG(FMACx->X1BUFCFG, FMAC_X1BUFCFG_X1_BUF_SIZE, ((uint32_t)BufferSize) << FMAC_X1BUFCFG_X1_BUF_SIZE_Pos); 0214 } 0215 0216 /** 0217 * @brief Return X1 buffer size. 0218 * @rmtoll X1BUFCFG X1_BUF_SIZE LL_FMAC_GetX1BufferSize 0219 * @param FMACx FMAC instance 0220 * @retval uint8_t Number of 16-bit words allocated to the input buffer 0221 * (including the optional "headroom") (value between Min_Data=0x01 and Max_Data=0xFF). 0222 */ 0223 __STATIC_INLINE uint8_t LL_FMAC_GetX1BufferSize(const FMAC_TypeDef *FMACx) 0224 { 0225 return (uint8_t)(READ_BIT(FMACx->X1BUFCFG, FMAC_X1BUFCFG_X1_BUF_SIZE) >> FMAC_X1BUFCFG_X1_BUF_SIZE_Pos); 0226 } 0227 0228 /** 0229 * @brief Configure X1 base. 0230 * @rmtoll X1BUFCFG X1_BASE LL_FMAC_SetX1Base 0231 * @param FMACx FMAC instance 0232 * @param Base Base address of the input buffer (X1) within the internal memory. 0233 * This parameter must be a value between Min_Data=0x00 and Max_Data=0xFF. 0234 * @retval None 0235 */ 0236 __STATIC_INLINE void LL_FMAC_SetX1Base(FMAC_TypeDef *FMACx, uint8_t Base) 0237 { 0238 MODIFY_REG(FMACx->X1BUFCFG, FMAC_X1BUFCFG_X1_BASE, ((uint32_t)Base) << FMAC_X1BUFCFG_X1_BASE_Pos); 0239 } 0240 0241 /** 0242 * @brief Return X1 base. 0243 * @rmtoll X1BUFCFG X1_BASE LL_FMAC_GetX1Base 0244 * @param FMACx FMAC instance 0245 * @retval uint8_t Base address of the input buffer (X1) within the internal memory 0246 * (value between Min_Data=0x00 and Max_Data=0xFF). 0247 */ 0248 __STATIC_INLINE uint8_t LL_FMAC_GetX1Base(const FMAC_TypeDef *FMACx) 0249 { 0250 return (uint8_t)(READ_BIT(FMACx->X1BUFCFG, FMAC_X1BUFCFG_X1_BASE) >> FMAC_X1BUFCFG_X1_BASE_Pos); 0251 } 0252 0253 /** 0254 * @brief Configure X2 buffer size. 0255 * @rmtoll X2BUFCFG X2_BUF_SIZE LL_FMAC_SetX2BufferSize 0256 * @param FMACx FMAC instance 0257 * @param BufferSize Number of 16-bit words allocated to the coefficient buffer. 0258 * This parameter must be a number between Min_Data=0x01 and Max_Data=0xFF. 0259 * @retval None 0260 */ 0261 __STATIC_INLINE void LL_FMAC_SetX2BufferSize(FMAC_TypeDef *FMACx, uint8_t BufferSize) 0262 { 0263 MODIFY_REG(FMACx->X2BUFCFG, FMAC_X2BUFCFG_X2_BUF_SIZE, ((uint32_t)BufferSize) << FMAC_X2BUFCFG_X2_BUF_SIZE_Pos); 0264 } 0265 0266 /** 0267 * @brief Return X2 buffer size. 0268 * @rmtoll X2BUFCFG X2_BUF_SIZE LL_FMAC_GetX2BufferSize 0269 * @param FMACx FMAC instance 0270 * @retval uint8_t Number of 16-bit words allocated to the coefficient buffer 0271 * (value between Min_Data=0x01 and Max_Data=0xFF). 0272 */ 0273 __STATIC_INLINE uint8_t LL_FMAC_GetX2BufferSize(const FMAC_TypeDef *FMACx) 0274 { 0275 return (uint8_t)(READ_BIT(FMACx->X2BUFCFG, FMAC_X2BUFCFG_X2_BUF_SIZE) >> FMAC_X2BUFCFG_X2_BUF_SIZE_Pos); 0276 } 0277 0278 /** 0279 * @brief Configure X2 base. 0280 * @rmtoll X2BUFCFG X2_BASE LL_FMAC_SetX2Base 0281 * @param FMACx FMAC instance 0282 * @param Base Base address of the coefficient buffer (X2) within the internal memory. 0283 * This parameter must be a value between Min_Data=0x00 and Max_Data=0xFF. 0284 * @retval None 0285 */ 0286 __STATIC_INLINE void LL_FMAC_SetX2Base(FMAC_TypeDef *FMACx, uint8_t Base) 0287 { 0288 MODIFY_REG(FMACx->X2BUFCFG, FMAC_X2BUFCFG_X2_BASE, ((uint32_t)Base) << FMAC_X2BUFCFG_X2_BASE_Pos); 0289 } 0290 0291 /** 0292 * @brief Return X2 base. 0293 * @rmtoll X2BUFCFG X2_BASE LL_FMAC_GetX2Base 0294 * @param FMACx FMAC instance 0295 * @retval uint8_t Base address of the coefficient buffer (X2) within the internal memory 0296 * (value between Min_Data=0x00 and Max_Data=0xFF). 0297 */ 0298 __STATIC_INLINE uint8_t LL_FMAC_GetX2Base(const FMAC_TypeDef *FMACx) 0299 { 0300 return (uint8_t)(READ_BIT(FMACx->X2BUFCFG, FMAC_X2BUFCFG_X2_BASE) >> FMAC_X2BUFCFG_X2_BASE_Pos); 0301 } 0302 0303 /** 0304 * @brief Configure Y empty watermark. 0305 * @rmtoll YBUFCFG EMPTY_WM LL_FMAC_SetYEmptyWatermark 0306 * @param FMACx FMAC instance 0307 * @param Watermark This parameter can be one of the following values: 0308 * @arg @ref LL_FMAC_WM_0_THRESHOLD_1 0309 * @arg @ref LL_FMAC_WM_1_THRESHOLD_2 0310 * @arg @ref LL_FMAC_WM_2_THRESHOLD_4 0311 * @arg @ref LL_FMAC_WM_3_THRESHOLD_8 0312 * @retval None 0313 */ 0314 __STATIC_INLINE void LL_FMAC_SetYEmptyWatermark(FMAC_TypeDef *FMACx, uint32_t Watermark) 0315 { 0316 MODIFY_REG(FMACx->YBUFCFG, FMAC_YBUFCFG_EMPTY_WM, Watermark); 0317 } 0318 0319 /** 0320 * @brief Return Y empty watermark. 0321 * @rmtoll YBUFCFG EMPTY_WM LL_FMAC_GetYEmptyWatermark 0322 * @param FMACx FMAC instance 0323 * @retval uint32_t Returned value can be one of the following values: 0324 * @arg @ref LL_FMAC_WM_0_THRESHOLD_1 0325 * @arg @ref LL_FMAC_WM_1_THRESHOLD_2 0326 * @arg @ref LL_FMAC_WM_2_THRESHOLD_4 0327 * @arg @ref LL_FMAC_WM_3_THRESHOLD_8 0328 */ 0329 __STATIC_INLINE uint32_t LL_FMAC_GetYEmptyWatermark(const FMAC_TypeDef *FMACx) 0330 { 0331 return (uint32_t)(READ_BIT(FMACx->YBUFCFG, FMAC_YBUFCFG_EMPTY_WM)); 0332 } 0333 0334 /** 0335 * @brief Configure Y buffer size. 0336 * @rmtoll YBUFCFG Y_BUF_SIZE LL_FMAC_SetYBufferSize 0337 * @param FMACx FMAC instance 0338 * @param BufferSize Number of 16-bit words allocated to the output buffer (including the optional "headroom"). 0339 * This parameter must be a number between Min_Data=0x01 and Max_Data=0xFF. 0340 * @retval None 0341 */ 0342 __STATIC_INLINE void LL_FMAC_SetYBufferSize(FMAC_TypeDef *FMACx, uint8_t BufferSize) 0343 { 0344 MODIFY_REG(FMACx->YBUFCFG, FMAC_YBUFCFG_Y_BUF_SIZE, ((uint32_t)BufferSize) << FMAC_YBUFCFG_Y_BUF_SIZE_Pos); 0345 } 0346 0347 /** 0348 * @brief Return Y buffer size. 0349 * @rmtoll YBUFCFG Y_BUF_SIZE LL_FMAC_GetYBufferSize 0350 * @param FMACx FMAC instance 0351 * @retval uint8_t Number of 16-bit words allocated to the output buffer 0352 * (including the optional "headroom" - value between Min_Data=0x01 and Max_Data=0xFF). 0353 */ 0354 __STATIC_INLINE uint8_t LL_FMAC_GetYBufferSize(const FMAC_TypeDef *FMACx) 0355 { 0356 return (uint8_t)(READ_BIT(FMACx->YBUFCFG, FMAC_YBUFCFG_Y_BUF_SIZE) >> FMAC_YBUFCFG_Y_BUF_SIZE_Pos); 0357 } 0358 0359 /** 0360 * @brief Configure Y base. 0361 * @rmtoll YBUFCFG Y_BASE LL_FMAC_SetYBase 0362 * @param FMACx FMAC instance 0363 * @param Base Base address of the output buffer (Y) within the internal memory. 0364 * This parameter must be a value between Min_Data=0x00 and Max_Data=0xFF. 0365 * @retval None 0366 */ 0367 __STATIC_INLINE void LL_FMAC_SetYBase(FMAC_TypeDef *FMACx, uint8_t Base) 0368 { 0369 MODIFY_REG(FMACx->YBUFCFG, FMAC_YBUFCFG_Y_BASE, ((uint32_t)Base) << FMAC_YBUFCFG_Y_BASE_Pos); 0370 } 0371 0372 /** 0373 * @brief Return Y base. 0374 * @rmtoll YBUFCFG Y_BASE LL_FMAC_GetYBase 0375 * @param FMACx FMAC instance 0376 * @retval uint8_t Base address of the output buffer (Y) within the internal memory 0377 * (value between Min_Data=0x00 and Max_Data=0xFF). 0378 */ 0379 __STATIC_INLINE uint8_t LL_FMAC_GetYBase(const FMAC_TypeDef *FMACx) 0380 { 0381 return (uint8_t)(READ_BIT(FMACx->YBUFCFG, FMAC_YBUFCFG_Y_BASE) >> FMAC_YBUFCFG_Y_BASE_Pos); 0382 } 0383 0384 /** 0385 * @brief Start FMAC processing. 0386 * @rmtoll PARAM START LL_FMAC_EnableStart 0387 * @param FMACx FMAC instance 0388 * @retval None 0389 */ 0390 __STATIC_INLINE void LL_FMAC_EnableStart(FMAC_TypeDef *FMACx) 0391 { 0392 SET_BIT(FMACx->PARAM, FMAC_PARAM_START); 0393 } 0394 0395 /** 0396 * @brief Stop FMAC processing. 0397 * @rmtoll PARAM START LL_FMAC_DisableStart 0398 * @param FMACx FMAC instance 0399 * @retval None 0400 */ 0401 __STATIC_INLINE void LL_FMAC_DisableStart(FMAC_TypeDef *FMACx) 0402 { 0403 CLEAR_BIT(FMACx->PARAM, FMAC_PARAM_START); 0404 } 0405 0406 /** 0407 * @brief Check the state of FMAC processing. 0408 * @rmtoll PARAM START LL_FMAC_IsEnabledStart 0409 * @param FMACx FMAC instance 0410 * @retval uint32_t State of bit (1 or 0). 0411 */ 0412 __STATIC_INLINE uint32_t LL_FMAC_IsEnabledStart(const FMAC_TypeDef *FMACx) 0413 { 0414 return ((READ_BIT(FMACx->PARAM, FMAC_PARAM_START) == (FMAC_PARAM_START)) ? 1UL : 0UL); 0415 } 0416 0417 /** 0418 * @brief Configure function. 0419 * @rmtoll PARAM FUNC LL_FMAC_SetFunction 0420 * @param FMACx FMAC instance 0421 * @param Function This parameter can be one of the following values: 0422 * @arg @ref LL_FMAC_FUNC_LOAD_X1 0423 * @arg @ref LL_FMAC_FUNC_LOAD_X2 0424 * @arg @ref LL_FMAC_FUNC_LOAD_Y 0425 * @arg @ref LL_FMAC_FUNC_CONVO_FIR 0426 * @arg @ref LL_FMAC_FUNC_IIR_DIRECT_FORM_1 0427 * @retval None 0428 */ 0429 __STATIC_INLINE void LL_FMAC_SetFunction(FMAC_TypeDef *FMACx, uint32_t Function) 0430 { 0431 MODIFY_REG(FMACx->PARAM, FMAC_PARAM_FUNC, Function); 0432 } 0433 0434 /** 0435 * @brief Return function. 0436 * @rmtoll PARAM FUNC LL_FMAC_GetFunction 0437 * @param FMACx FMAC instance 0438 * @retval uint32_t Returned value can be one of the following values: 0439 * @arg @ref LL_FMAC_FUNC_LOAD_X1 0440 * @arg @ref LL_FMAC_FUNC_LOAD_X2 0441 * @arg @ref LL_FMAC_FUNC_LOAD_Y 0442 * @arg @ref LL_FMAC_FUNC_CONVO_FIR 0443 * @arg @ref LL_FMAC_FUNC_IIR_DIRECT_FORM_1 0444 */ 0445 __STATIC_INLINE uint32_t LL_FMAC_GetFunction(const FMAC_TypeDef *FMACx) 0446 { 0447 return (uint32_t)(READ_BIT(FMACx->PARAM, FMAC_PARAM_FUNC)); 0448 } 0449 0450 /** 0451 * @brief Configure input parameter R. 0452 * @rmtoll PARAM R LL_FMAC_SetParamR 0453 * @param FMACx FMAC instance 0454 * @param Param Parameter R (gain, etc.). 0455 * This parameter must be a value between Min_Data=0x00 and Max_Data=0xFF. 0456 * @retval None 0457 */ 0458 __STATIC_INLINE void LL_FMAC_SetParamR(FMAC_TypeDef *FMACx, uint8_t Param) 0459 { 0460 MODIFY_REG(FMACx->PARAM, FMAC_PARAM_R, ((uint32_t)Param) << FMAC_PARAM_R_Pos); 0461 } 0462 0463 /** 0464 * @brief Return input parameter R. 0465 * @rmtoll PARAM R LL_FMAC_GetParamR 0466 * @param FMACx FMAC instance 0467 * @retval uint8_t Parameter R (gain, etc.) (value between Min_Data=0x00 and Max_Data=0xFF). 0468 */ 0469 __STATIC_INLINE uint8_t LL_FMAC_GetParamR(const FMAC_TypeDef *FMACx) 0470 { 0471 return (uint8_t)(READ_BIT(FMACx->PARAM, FMAC_PARAM_R) >> FMAC_PARAM_R_Pos); 0472 } 0473 0474 /** 0475 * @brief Configure input parameter Q. 0476 * @rmtoll PARAM Q LL_FMAC_SetParamQ 0477 * @param FMACx FMAC instance 0478 * @param Param Parameter Q (vector length, etc.). 0479 * This parameter must be a value between Min_Data=0x00 and Max_Data=0xFF. 0480 * @retval None 0481 */ 0482 __STATIC_INLINE void LL_FMAC_SetParamQ(FMAC_TypeDef *FMACx, uint8_t Param) 0483 { 0484 MODIFY_REG(FMACx->PARAM, FMAC_PARAM_Q, ((uint32_t)Param) << FMAC_PARAM_Q_Pos); 0485 } 0486 0487 /** 0488 * @brief Return input parameter Q. 0489 * @rmtoll PARAM Q LL_FMAC_GetParamQ 0490 * @param FMACx FMAC instance 0491 * @retval uint8_t Parameter Q (vector length, etc.) (value between Min_Data=0x00 and Max_Data=0xFF). 0492 */ 0493 __STATIC_INLINE uint8_t LL_FMAC_GetParamQ(const FMAC_TypeDef *FMACx) 0494 { 0495 return (uint8_t)(READ_BIT(FMACx->PARAM, FMAC_PARAM_Q) >> FMAC_PARAM_Q_Pos); 0496 } 0497 0498 /** 0499 * @brief Configure input parameter P. 0500 * @rmtoll PARAM P LL_FMAC_SetParamP 0501 * @param FMACx FMAC instance 0502 * @param Param Parameter P (vector length, number of filter taps, etc.). 0503 * This parameter must be a value between Min_Data=0x00 and Max_Data=0xFF. 0504 * @retval None 0505 */ 0506 __STATIC_INLINE void LL_FMAC_SetParamP(FMAC_TypeDef *FMACx, uint8_t Param) 0507 { 0508 MODIFY_REG(FMACx->PARAM, FMAC_PARAM_P, ((uint32_t)Param)); 0509 } 0510 0511 /** 0512 * @brief Return input parameter P. 0513 * @rmtoll PARAM P LL_FMAC_GetParamP 0514 * @param FMACx FMAC instance 0515 * @retval uint8_t Parameter P (vector length, number of filter taps, etc.) 0516 * (value between Min_Data=0x00 and Max_Data=0xFF). 0517 */ 0518 __STATIC_INLINE uint8_t LL_FMAC_GetParamP(const FMAC_TypeDef *FMACx) 0519 { 0520 return (uint8_t)(READ_BIT(FMACx->PARAM, FMAC_PARAM_P)); 0521 } 0522 0523 /** 0524 * @} 0525 */ 0526 0527 /** @defgroup FMAC_LL_EF_Reset_Management Reset_Management 0528 * @ingroup RTEMSBSPsARMSTM32H7 0529 * @{ 0530 */ 0531 0532 /** 0533 * @brief Start the FMAC reset. 0534 * @rmtoll CR RESET LL_FMAC_EnableReset 0535 * @param FMACx FMAC instance 0536 * @retval None 0537 */ 0538 __STATIC_INLINE void LL_FMAC_EnableReset(FMAC_TypeDef *FMACx) 0539 { 0540 SET_BIT(FMACx->CR, FMAC_CR_RESET); 0541 } 0542 0543 /** 0544 * @brief Check the state of the FMAC reset. 0545 * @rmtoll CR RESET LL_FMAC_IsEnabledReset 0546 * @param FMACx FMAC instance 0547 * @retval uint32_t State of bit (1 or 0). 0548 */ 0549 __STATIC_INLINE uint32_t LL_FMAC_IsEnabledReset(const FMAC_TypeDef *FMACx) 0550 { 0551 return ((READ_BIT(FMACx->CR, FMAC_CR_RESET) == (FMAC_CR_RESET)) ? 1UL : 0UL); 0552 } 0553 0554 /** 0555 * @} 0556 */ 0557 0558 /** @defgroup FMAC_LL_EF_Configuration FMAC Configuration functions 0559 * @ingroup RTEMSBSPsARMSTM32H7 0560 * @{ 0561 */ 0562 0563 /** 0564 * @brief Enable Clipping. 0565 * @rmtoll CR CLIPEN LL_FMAC_EnableClipping 0566 * @param FMACx FMAC instance 0567 * @retval None 0568 */ 0569 __STATIC_INLINE void LL_FMAC_EnableClipping(FMAC_TypeDef *FMACx) 0570 { 0571 SET_BIT(FMACx->CR, FMAC_CR_CLIPEN); 0572 } 0573 0574 /** 0575 * @brief Disable Clipping. 0576 * @rmtoll CR CLIPEN LL_FMAC_DisableClipping 0577 * @param FMACx FMAC instance 0578 * @retval None 0579 */ 0580 __STATIC_INLINE void LL_FMAC_DisableClipping(FMAC_TypeDef *FMACx) 0581 { 0582 CLEAR_BIT(FMACx->CR, FMAC_CR_CLIPEN); 0583 } 0584 0585 /** 0586 * @brief Check Clipping State. 0587 * @rmtoll CR CLIPEN LL_FMAC_IsEnabledClipping 0588 * @param FMACx FMAC instance 0589 * @retval uint32_t State of bit (1 or 0). 0590 */ 0591 __STATIC_INLINE uint32_t LL_FMAC_IsEnabledClipping(const FMAC_TypeDef *FMACx) 0592 { 0593 return ((READ_BIT(FMACx->CR, FMAC_CR_CLIPEN) == (FMAC_CR_CLIPEN)) ? 1UL : 0UL); 0594 } 0595 0596 /** 0597 * @} 0598 */ 0599 0600 /** @defgroup FMAC_LL_EF_DMA_Management DMA_Management 0601 * @ingroup RTEMSBSPsARMSTM32H7 0602 * @{ 0603 */ 0604 0605 /** 0606 * @brief Enable FMAC DMA write channel request. 0607 * @rmtoll CR DMAWEN LL_FMAC_EnableDMAReq_WRITE 0608 * @param FMACx FMAC instance 0609 * @retval None 0610 */ 0611 __STATIC_INLINE void LL_FMAC_EnableDMAReq_WRITE(FMAC_TypeDef *FMACx) 0612 { 0613 SET_BIT(FMACx->CR, FMAC_CR_DMAWEN); 0614 } 0615 0616 /** 0617 * @brief Disable FMAC DMA write channel request. 0618 * @rmtoll CR DMAWEN LL_FMAC_DisableDMAReq_WRITE 0619 * @param FMACx FMAC instance 0620 * @retval None 0621 */ 0622 __STATIC_INLINE void LL_FMAC_DisableDMAReq_WRITE(FMAC_TypeDef *FMACx) 0623 { 0624 CLEAR_BIT(FMACx->CR, FMAC_CR_DMAWEN); 0625 } 0626 0627 /** 0628 * @brief Check FMAC DMA write channel request state. 0629 * @rmtoll CR DMAWEN LL_FMAC_IsEnabledDMAReq_WRITE 0630 * @param FMACx FMAC instance 0631 * @retval uint32_t State of bit (1 or 0). 0632 */ 0633 __STATIC_INLINE uint32_t LL_FMAC_IsEnabledDMAReq_WRITE(const FMAC_TypeDef *FMACx) 0634 { 0635 return ((READ_BIT(FMACx->CR, FMAC_CR_DMAWEN) == (FMAC_CR_DMAWEN)) ? 1UL : 0UL); 0636 } 0637 0638 /** 0639 * @brief Enable FMAC DMA read channel request. 0640 * @rmtoll CR DMAREN LL_FMAC_EnableDMAReq_READ 0641 * @param FMACx FMAC instance 0642 * @retval None 0643 */ 0644 __STATIC_INLINE void LL_FMAC_EnableDMAReq_READ(FMAC_TypeDef *FMACx) 0645 { 0646 SET_BIT(FMACx->CR, FMAC_CR_DMAREN); 0647 } 0648 0649 /** 0650 * @brief Disable FMAC DMA read channel request. 0651 * @rmtoll CR DMAREN LL_FMAC_DisableDMAReq_READ 0652 * @param FMACx FMAC instance 0653 * @retval None 0654 */ 0655 __STATIC_INLINE void LL_FMAC_DisableDMAReq_READ(FMAC_TypeDef *FMACx) 0656 { 0657 CLEAR_BIT(FMACx->CR, FMAC_CR_DMAREN); 0658 } 0659 0660 /** 0661 * @brief Check FMAC DMA read channel request state. 0662 * @rmtoll CR DMAREN LL_FMAC_IsEnabledDMAReq_READ 0663 * @param FMACx FMAC instance 0664 * @retval uint32_t State of bit (1 or 0). 0665 */ 0666 __STATIC_INLINE uint32_t LL_FMAC_IsEnabledDMAReq_READ(const FMAC_TypeDef *FMACx) 0667 { 0668 return ((READ_BIT(FMACx->CR, FMAC_CR_DMAREN) == (FMAC_CR_DMAREN)) ? 1UL : 0UL); 0669 } 0670 0671 /** 0672 * @} 0673 */ 0674 0675 /** @defgroup FMAC_LL_EF_IT_Management IT_Management 0676 * @ingroup RTEMSBSPsARMSTM32H7 0677 * @{ 0678 */ 0679 0680 /** 0681 * @brief Enable FMAC saturation error interrupt. 0682 * @rmtoll CR SATIEN LL_FMAC_EnableIT_SAT 0683 * @param FMACx FMAC instance 0684 * @retval None 0685 */ 0686 __STATIC_INLINE void LL_FMAC_EnableIT_SAT(FMAC_TypeDef *FMACx) 0687 { 0688 SET_BIT(FMACx->CR, FMAC_CR_SATIEN); 0689 } 0690 0691 /** 0692 * @brief Disable FMAC saturation error interrupt. 0693 * @rmtoll CR SATIEN LL_FMAC_DisableIT_SAT 0694 * @param FMACx FMAC instance 0695 * @retval None 0696 */ 0697 __STATIC_INLINE void LL_FMAC_DisableIT_SAT(FMAC_TypeDef *FMACx) 0698 { 0699 CLEAR_BIT(FMACx->CR, FMAC_CR_SATIEN); 0700 } 0701 0702 /** 0703 * @brief Check FMAC saturation error interrupt state. 0704 * @rmtoll CR SATIEN LL_FMAC_IsEnabledIT_SAT 0705 * @param FMACx FMAC instance 0706 * @retval uint32_t State of bit (1 or 0). 0707 */ 0708 __STATIC_INLINE uint32_t LL_FMAC_IsEnabledIT_SAT(const FMAC_TypeDef *FMACx) 0709 { 0710 return ((READ_BIT(FMACx->CR, FMAC_CR_SATIEN) == (FMAC_CR_SATIEN)) ? 1UL : 0UL); 0711 } 0712 0713 /** 0714 * @brief Enable FMAC underflow error interrupt. 0715 * @rmtoll CR UNFLIEN LL_FMAC_EnableIT_UNFL 0716 * @param FMACx FMAC instance 0717 * @retval None 0718 */ 0719 __STATIC_INLINE void LL_FMAC_EnableIT_UNFL(FMAC_TypeDef *FMACx) 0720 { 0721 SET_BIT(FMACx->CR, FMAC_CR_UNFLIEN); 0722 } 0723 0724 /** 0725 * @brief Disable FMAC underflow error interrupt. 0726 * @rmtoll CR UNFLIEN LL_FMAC_DisableIT_UNFL 0727 * @param FMACx FMAC instance 0728 * @retval None 0729 */ 0730 __STATIC_INLINE void LL_FMAC_DisableIT_UNFL(FMAC_TypeDef *FMACx) 0731 { 0732 CLEAR_BIT(FMACx->CR, FMAC_CR_UNFLIEN); 0733 } 0734 0735 /** 0736 * @brief Check FMAC underflow error interrupt state. 0737 * @rmtoll CR UNFLIEN LL_FMAC_IsEnabledIT_UNFL 0738 * @param FMACx FMAC instance 0739 * @retval uint32_t State of bit (1 or 0). 0740 */ 0741 __STATIC_INLINE uint32_t LL_FMAC_IsEnabledIT_UNFL(const FMAC_TypeDef *FMACx) 0742 { 0743 return ((READ_BIT(FMACx->CR, FMAC_CR_UNFLIEN) == (FMAC_CR_UNFLIEN)) ? 1UL : 0UL); 0744 } 0745 0746 /** 0747 * @brief Enable FMAC overflow error interrupt. 0748 * @rmtoll CR OVFLIEN LL_FMAC_EnableIT_OVFL 0749 * @param FMACx FMAC instance 0750 * @retval None 0751 */ 0752 __STATIC_INLINE void LL_FMAC_EnableIT_OVFL(FMAC_TypeDef *FMACx) 0753 { 0754 SET_BIT(FMACx->CR, FMAC_CR_OVFLIEN); 0755 } 0756 0757 /** 0758 * @brief Disable FMAC overflow error interrupt. 0759 * @rmtoll CR OVFLIEN LL_FMAC_DisableIT_OVFL 0760 * @param FMACx FMAC instance 0761 * @retval None 0762 */ 0763 __STATIC_INLINE void LL_FMAC_DisableIT_OVFL(FMAC_TypeDef *FMACx) 0764 { 0765 CLEAR_BIT(FMACx->CR, FMAC_CR_OVFLIEN); 0766 } 0767 0768 /** 0769 * @brief Check FMAC overflow error interrupt state. 0770 * @rmtoll CR OVFLIEN LL_FMAC_IsEnabledIT_OVFL 0771 * @param FMACx FMAC instance 0772 * @retval uint32_t State of bit (1 or 0). 0773 */ 0774 __STATIC_INLINE uint32_t LL_FMAC_IsEnabledIT_OVFL(const FMAC_TypeDef *FMACx) 0775 { 0776 return ((READ_BIT(FMACx->CR, FMAC_CR_OVFLIEN) == (FMAC_CR_OVFLIEN)) ? 1UL : 0UL); 0777 } 0778 0779 /** 0780 * @brief Enable FMAC write interrupt. 0781 * @rmtoll CR WIEN LL_FMAC_EnableIT_WR 0782 * @param FMACx FMAC instance 0783 * @retval None 0784 */ 0785 __STATIC_INLINE void LL_FMAC_EnableIT_WR(FMAC_TypeDef *FMACx) 0786 { 0787 SET_BIT(FMACx->CR, FMAC_CR_WIEN); 0788 } 0789 0790 /** 0791 * @brief Disable FMAC write interrupt. 0792 * @rmtoll CR WIEN LL_FMAC_DisableIT_WR 0793 * @param FMACx FMAC instance 0794 * @retval None 0795 */ 0796 __STATIC_INLINE void LL_FMAC_DisableIT_WR(FMAC_TypeDef *FMACx) 0797 { 0798 CLEAR_BIT(FMACx->CR, FMAC_CR_WIEN); 0799 } 0800 0801 /** 0802 * @brief Check FMAC write interrupt state. 0803 * @rmtoll CR WIEN LL_FMAC_IsEnabledIT_WR 0804 * @param FMACx FMAC instance 0805 * @retval uint32_t State of bit (1 or 0). 0806 */ 0807 __STATIC_INLINE uint32_t LL_FMAC_IsEnabledIT_WR(const FMAC_TypeDef *FMACx) 0808 { 0809 return ((READ_BIT(FMACx->CR, FMAC_CR_WIEN) == (FMAC_CR_WIEN)) ? 1UL : 0UL); 0810 } 0811 0812 /** 0813 * @brief Enable FMAC read interrupt. 0814 * @rmtoll CR RIEN LL_FMAC_EnableIT_RD 0815 * @param FMACx FMAC instance 0816 * @retval None 0817 */ 0818 __STATIC_INLINE void LL_FMAC_EnableIT_RD(FMAC_TypeDef *FMACx) 0819 { 0820 SET_BIT(FMACx->CR, FMAC_CR_RIEN); 0821 } 0822 0823 /** 0824 * @brief Disable FMAC read interrupt. 0825 * @rmtoll CR RIEN LL_FMAC_DisableIT_RD 0826 * @param FMACx FMAC instance 0827 * @retval None 0828 */ 0829 __STATIC_INLINE void LL_FMAC_DisableIT_RD(FMAC_TypeDef *FMACx) 0830 { 0831 CLEAR_BIT(FMACx->CR, FMAC_CR_RIEN); 0832 } 0833 0834 /** 0835 * @brief Check FMAC read interrupt state. 0836 * @rmtoll CR RIEN LL_FMAC_IsEnabledIT_RD 0837 * @param FMACx FMAC instance 0838 * @retval uint32_t State of bit (1 or 0). 0839 */ 0840 __STATIC_INLINE uint32_t LL_FMAC_IsEnabledIT_RD(const FMAC_TypeDef *FMACx) 0841 { 0842 return ((READ_BIT(FMACx->CR, FMAC_CR_RIEN) == (FMAC_CR_RIEN)) ? 1UL : 0UL); 0843 } 0844 0845 /** 0846 * @} 0847 */ 0848 0849 /** @defgroup FMAC_LL_EF_FLAG_Management FLAG_Management 0850 * @ingroup RTEMSBSPsARMSTM32H7 0851 * @{ 0852 */ 0853 0854 /** 0855 * @brief Check FMAC saturation error flag state. 0856 * @rmtoll SR SAT LL_FMAC_IsActiveFlag_SAT 0857 * @param FMACx FMAC instance 0858 * @retval uint32_t State of bit (1 or 0). 0859 */ 0860 __STATIC_INLINE uint32_t LL_FMAC_IsActiveFlag_SAT(const FMAC_TypeDef *FMACx) 0861 { 0862 return ((READ_BIT(FMACx->SR, FMAC_SR_SAT) == (FMAC_SR_SAT)) ? 1UL : 0UL); 0863 } 0864 0865 /** 0866 * @brief Check FMAC underflow error flag state. 0867 * @rmtoll SR UNFL LL_FMAC_IsActiveFlag_UNFL 0868 * @param FMACx FMAC instance 0869 * @retval uint32_t State of bit (1 or 0). 0870 */ 0871 __STATIC_INLINE uint32_t LL_FMAC_IsActiveFlag_UNFL(const FMAC_TypeDef *FMACx) 0872 { 0873 return ((READ_BIT(FMACx->SR, FMAC_SR_UNFL) == (FMAC_SR_UNFL)) ? 1UL : 0UL); 0874 } 0875 0876 /** 0877 * @brief Check FMAC overflow error flag state. 0878 * @rmtoll SR OVFL LL_FMAC_IsActiveFlag_OVFL 0879 * @param FMACx FMAC instance 0880 * @retval uint32_t State of bit (1 or 0). 0881 */ 0882 __STATIC_INLINE uint32_t LL_FMAC_IsActiveFlag_OVFL(const FMAC_TypeDef *FMACx) 0883 { 0884 return ((READ_BIT(FMACx->SR, FMAC_SR_OVFL) == (FMAC_SR_OVFL)) ? 1UL : 0UL); 0885 } 0886 0887 /** 0888 * @brief Check FMAC X1 buffer full flag state. 0889 * @rmtoll SR X1FULL LL_FMAC_IsActiveFlag_X1FULL 0890 * @param FMACx FMAC instance 0891 * @retval uint32_t State of bit (1 or 0). 0892 */ 0893 __STATIC_INLINE uint32_t LL_FMAC_IsActiveFlag_X1FULL(const FMAC_TypeDef *FMACx) 0894 { 0895 return ((READ_BIT(FMACx->SR, FMAC_SR_X1FULL) == (FMAC_SR_X1FULL)) ? 1UL : 0UL); 0896 } 0897 0898 /** 0899 * @brief Check FMAC Y buffer empty flag state. 0900 * @rmtoll SR YEMPTY LL_FMAC_IsActiveFlag_YEMPTY 0901 * @param FMACx FMAC instance 0902 * @retval uint32_t State of bit (1 or 0). 0903 */ 0904 __STATIC_INLINE uint32_t LL_FMAC_IsActiveFlag_YEMPTY(const FMAC_TypeDef *FMACx) 0905 { 0906 return ((READ_BIT(FMACx->SR, FMAC_SR_YEMPTY) == (FMAC_SR_YEMPTY)) ? 1UL : 0UL); 0907 } 0908 0909 /** 0910 * @} 0911 */ 0912 0913 /** @defgroup FMAC_LL_EF_Data_Management Data_Management 0914 * @ingroup RTEMSBSPsARMSTM32H7 0915 * @{ 0916 */ 0917 0918 /** 0919 * @brief Write 16-bit input data for the FMAC processing. 0920 * @rmtoll WDATA WDATA LL_FMAC_WriteData 0921 * @param FMACx FMAC instance 0922 * @param InData 16-bit value to be provided as input data for FMAC processing. 0923 * This parameter must be a number between Min_Data=0x0000 and Max_Data=0xFFFF. 0924 * @retval None 0925 */ 0926 __STATIC_INLINE void LL_FMAC_WriteData(FMAC_TypeDef *FMACx, uint16_t InData) 0927 { 0928 WRITE_REG(FMACx->WDATA, InData); 0929 } 0930 0931 /** 0932 * @brief Return 16-bit output data of FMAC processing. 0933 * @rmtoll RDATA RDATA LL_FMAC_ReadData 0934 * @param FMACx FMAC instance 0935 * @retval uint16_t 16-bit output data of FMAC processing (value between Min_Data=0x0000 and Max_Data=0xFFFF). 0936 */ 0937 __STATIC_INLINE uint16_t LL_FMAC_ReadData(const FMAC_TypeDef *FMACx) 0938 { 0939 return (uint16_t)(READ_REG(FMACx->RDATA)); 0940 } 0941 0942 /** 0943 * @} 0944 */ 0945 0946 /** @defgroup FMAC_LL_EF_Configuration FMAC Configuration functions 0947 * @ingroup RTEMSBSPsARMSTM32H7 0948 * @{ 0949 */ 0950 0951 /** 0952 * @brief Configure memory for X1 buffer. 0953 * @rmtoll X1BUFCFG FULL_WM LL_FMAC_ConfigX1\n 0954 * X1BUFCFG X1_BASE LL_FMAC_ConfigX1\n 0955 * X1BUFCFG X1_BUF_SIZE LL_FMAC_ConfigX1 0956 * @param FMACx FMAC instance 0957 * @param Watermark This parameter can be one of the following values: 0958 * @arg @ref LL_FMAC_WM_0_THRESHOLD_1 0959 * @arg @ref LL_FMAC_WM_1_THRESHOLD_2 0960 * @arg @ref LL_FMAC_WM_2_THRESHOLD_4 0961 * @arg @ref LL_FMAC_WM_3_THRESHOLD_8 0962 * @param Base Base address of the input buffer (X1) within the internal memory. 0963 * This parameter must be a value between Min_Data=0x00 and Max_Data=0xFF. 0964 * @param BufferSize Number of 16-bit words allocated to the input buffer (including the optional "headroom"). 0965 * This parameter must be a number between Min_Data=0x01 and Max_Data=0xFF. 0966 * @retval None 0967 */ 0968 __STATIC_INLINE void LL_FMAC_ConfigX1(FMAC_TypeDef *FMACx, uint32_t Watermark, uint8_t Base, uint8_t BufferSize) 0969 { 0970 MODIFY_REG(FMACx->X1BUFCFG, FMAC_X1BUFCFG_FULL_WM | FMAC_X1BUFCFG_X1_BASE | FMAC_X1BUFCFG_X1_BUF_SIZE, 0971 Watermark | (((uint32_t)Base) << FMAC_X1BUFCFG_X1_BASE_Pos) | 0972 (((uint32_t)BufferSize) << FMAC_X1BUFCFG_X1_BUF_SIZE_Pos)); 0973 } 0974 0975 /** 0976 * @brief Configure memory for X2 buffer. 0977 * @rmtoll X2BUFCFG X2_BASE LL_FMAC_ConfigX2\n 0978 * X2BUFCFG X2_BUF_SIZE LL_FMAC_ConfigX2 0979 * @param FMACx FMAC instance 0980 * @param Base Base address of the coefficient buffer (X2) within the internal memory. 0981 * This parameter must be a value between Min_Data=0x00 and Max_Data=0xFF. 0982 * @param BufferSize Number of 16-bit words allocated to the coefficient buffer. 0983 * This parameter must be a number between Min_Data=0x01 and Max_Data=0xFF. 0984 * @retval None 0985 */ 0986 __STATIC_INLINE void LL_FMAC_ConfigX2(FMAC_TypeDef *FMACx, uint8_t Base, uint8_t BufferSize) 0987 { 0988 MODIFY_REG(FMACx->X2BUFCFG, FMAC_X2BUFCFG_X2_BASE | FMAC_X2BUFCFG_X2_BUF_SIZE, 0989 (((uint32_t)Base) << FMAC_X2BUFCFG_X2_BASE_Pos) | 0990 (((uint32_t)BufferSize) << FMAC_X2BUFCFG_X2_BUF_SIZE_Pos)); 0991 } 0992 0993 /** 0994 * @brief Configure memory for Y buffer. 0995 * @rmtoll YBUFCFG EMPTY_WM LL_FMAC_ConfigY\n 0996 * YBUFCFG Y_BASE LL_FMAC_ConfigY\n 0997 * YBUFCFG Y_BUF_SIZE LL_FMAC_ConfigY 0998 * @param FMACx FMAC instance 0999 * @param Watermark This parameter can be one of the following values: 1000 * @arg @ref LL_FMAC_WM_0_THRESHOLD_1 1001 * @arg @ref LL_FMAC_WM_1_THRESHOLD_2 1002 * @arg @ref LL_FMAC_WM_2_THRESHOLD_4 1003 * @arg @ref LL_FMAC_WM_3_THRESHOLD_8 1004 * @param Base Base address of the output buffer (Y) within the internal memory. 1005 * This parameter must be a value between Min_Data=0x00 and Max_Data=0xFF. 1006 * @param BufferSize Number of 16-bit words allocated to the output buffer (including the optional "headroom"). 1007 * This parameter must be a number between Min_Data=0x01 and Max_Data=0xFF. 1008 * @retval None 1009 */ 1010 __STATIC_INLINE void LL_FMAC_ConfigY(FMAC_TypeDef *FMACx, uint32_t Watermark, uint8_t Base, uint8_t BufferSize) 1011 { 1012 MODIFY_REG(FMACx->YBUFCFG, FMAC_YBUFCFG_EMPTY_WM | FMAC_YBUFCFG_Y_BASE | FMAC_YBUFCFG_Y_BUF_SIZE, 1013 Watermark | (((uint32_t)Base) << FMAC_YBUFCFG_Y_BASE_Pos) | 1014 (((uint32_t)BufferSize) << FMAC_YBUFCFG_Y_BUF_SIZE_Pos)); 1015 } 1016 1017 /** 1018 * @brief Configure the FMAC processing. 1019 * @rmtoll PARAM START LL_FMAC_ConfigFunc\n 1020 * PARAM FUNC LL_FMAC_ConfigFunc\n 1021 * PARAM P LL_FMAC_ConfigFunc\n 1022 * PARAM Q LL_FMAC_ConfigFunc\n 1023 * PARAM R LL_FMAC_ConfigFunc 1024 * @param FMACx FMAC instance 1025 * @param Start This parameter can be one of the following values: 1026 * @arg @ref LL_FMAC_PROCESSING_STOP 1027 * @arg @ref LL_FMAC_PROCESSING_START 1028 * @param Function This parameter can be one of the following values: 1029 * @arg @ref LL_FMAC_FUNC_LOAD_X1 1030 * @arg @ref LL_FMAC_FUNC_LOAD_X2 1031 * @arg @ref LL_FMAC_FUNC_LOAD_Y 1032 * @arg @ref LL_FMAC_FUNC_CONVO_FIR 1033 * @arg @ref LL_FMAC_FUNC_IIR_DIRECT_FORM_1 1034 * @param ParamP Parameter P (vector length, number of filter taps, etc.). 1035 * This parameter must be a value between Min_Data=0x00 and Max_Data=0xFF. 1036 * @param ParamQ Parameter Q (vector length, etc.). 1037 * This parameter must be a value between Min_Data=0x00 and Max_Data=0xFF. 1038 * @param ParamR Parameter R (gain, etc.). 1039 * This parameter must be a value between Min_Data=0x00 and Max_Data=0xFF. 1040 * @retval None 1041 */ 1042 __STATIC_INLINE void LL_FMAC_ConfigFunc(FMAC_TypeDef *FMACx, uint8_t Start, uint32_t Function, uint8_t ParamP, 1043 uint8_t ParamQ, uint8_t ParamR) 1044 { 1045 MODIFY_REG(FMACx->PARAM, FMAC_PARAM_START | FMAC_PARAM_FUNC | FMAC_PARAM_P | FMAC_PARAM_Q | FMAC_PARAM_R, 1046 (((uint32_t)Start) << FMAC_PARAM_START_Pos) | Function | (((uint32_t)ParamP) << FMAC_PARAM_P_Pos) | 1047 (((uint32_t)ParamQ) << FMAC_PARAM_Q_Pos) | (((uint32_t)ParamR) << FMAC_PARAM_R_Pos)); 1048 } 1049 1050 /** 1051 * @} 1052 */ 1053 1054 1055 1056 #if defined(USE_FULL_LL_DRIVER) || defined(__rtems__) 1057 /** @defgroup FMAC_LL_EF_Init Initialization and de-initialization functions 1058 * @ingroup RTEMSBSPsARMSTM32H7 1059 * @{ 1060 */ 1061 ErrorStatus LL_FMAC_Init(FMAC_TypeDef *FMACx); 1062 ErrorStatus LL_FMAC_DeInit(const FMAC_TypeDef *FMACx); 1063 1064 1065 /** 1066 * @} 1067 */ 1068 #endif /* USE_FULL_LL_DRIVER */ 1069 1070 /** 1071 * @} 1072 */ 1073 1074 /** 1075 * @} 1076 */ 1077 1078 #endif /* defined(FMAC) */ 1079 1080 /** 1081 * @} 1082 */ 1083 1084 #ifdef __cplusplus 1085 } 1086 #endif 1087 1088 #endif /* STM32H7xx_LL_FMAC_H */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |