1 /**
2   ******************************************************************************
3   * @file    stm32u5xx_ll_dlyb.h
4   * @author  MCD Application Team
5   * @brief   Header file of DelayBlock module.
6   ******************************************************************************
7   * @attention
8   *
9   * Copyright (c) 2021 STMicroelectronics.
10   * All rights reserved.
11   *
12   * This software is licensed under terms that can be found in the LICENSE file
13   * in the root directory of this software component.
14   * If no LICENSE file comes with this software, it is provided AS-IS.
15   *
16   ******************************************************************************
17   */
18 
19 /* Define to prevent recursive inclusion -------------------------------------*/
20 #ifndef STM32U5xx_LL_DLYB_H
21 #define STM32U5xx_LL_DLYB_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /* Includes ------------------------------------------------------------------*/
28 #include "stm32u5xx_hal_def.h"
29 
30 /** @addtogroup STM32U5xx_LL_Driver
31   * @{
32   */
33 
34 #if defined(HAL_SD_MODULE_ENABLED) || defined(HAL_QSPI_MODULE_ENABLED)|| defined(HAL_OSPI_MODULE_ENABLED)
35 
36 /** @addtogroup DLYB
37   * @{
38   */
39 
40 /* Exported types ------------------------------------------------------------*/
41 /** @defgroup DLYB_LL_Exported_Types DLYB Exported Types
42   * @{
43   */
44 
45 /**
46   * @brief  DLYB Configuration Structure definition
47  */
48 
49 typedef struct
50 {
51   uint32_t Units;                  /*!< Specifies the Delay of a unit delay cell.
52                                         This parameter can be a value between 0 and DLYB_MAX_UNIT               */
53 
54   uint32_t PhaseSel;               /*!< Specifies the Phase for the output clock.
55                                         This parameter can be a value between 0 and DLYB_MAX_SELECT             */
56 } LL_DLYB_CfgTypeDef;
57 
58 /**
59   * @}
60   */
61 
62 /* Exported constants --------------------------------------------------------*/
63 /** @defgroup DLYB_Exported_Constants DLYB Exported Constants
64   * @{
65   */
66 
67 #define DLYB_MAX_UNIT   ((uint32_t)0x00000080U) /*!< Max UNIT value (128)  */
68 #define DLYB_MAX_SELECT ((uint32_t)0x0000000CU) /*!< Max SELECT value (12)  */
69 
70 /** @defgroup DLYB_LL_Flags DLYB Flags
71   * @{
72   */
73 
74 #define DLYB_FLAG_LNGF DLYB_CFGR_LNGF
75 
76 /**
77   * @}
78   */
79 
80 /**
81   * @}
82   */
83 
84 /* Exported functions --------------------------------------------------------*/
85 
86 /** @defgroup DLYB_LL_Exported_Functions DLYB Exported Functions
87   * @{
88   */
89 
90 /** @defgroup DLYB_LL_Configuration Configuration functions
91   * @{
92   */
93 
94 /**
95   * @brief  DLYB Enable
96   * @param  DLYBx DLYB Instance
97   * @retval None
98   */
99 
LL_DLYB_Enable(DLYB_TypeDef * DLYBx)100 __STATIC_INLINE void LL_DLYB_Enable(DLYB_TypeDef *DLYBx)
101 {
102   SET_BIT(DLYBx->CR, DLYB_CR_DEN);
103 }
104 
105 /** @brief  Disable the DLYB.
106   * @param  DLYBx DLYB Instance.
107   * @retval None
108   */
109 
LL_DLYB_Disable(DLYB_TypeDef * DLYBx)110 __STATIC_INLINE void LL_DLYB_Disable(DLYB_TypeDef *DLYBx)
111 {
112   CLEAR_BIT(DLYBx->CR, DLYB_CR_DEN);
113 }
114 
115 /**
116   * @}
117   */
118 
119 
120 /** @addtogroup DLYB_Control_Functions DLYB Control functions
121   * @{
122   */
123 
124 void LL_DLYB_SetDelay(DLYB_TypeDef *DLYBx, LL_DLYB_CfgTypeDef  *pdlyb_cfg);
125 void LL_DLYB_GetDelay(DLYB_TypeDef *DLYBx, LL_DLYB_CfgTypeDef *pdlyb_cfg);
126 uint32_t LL_DLYB_GetClockPeriod(DLYB_TypeDef *DLYBx, LL_DLYB_CfgTypeDef *pdlyb_cfg);
127 
128 /**
129   * @}
130   */
131 
132 /**
133   * @}
134   */
135 
136 /**
137   * @}
138   */
139 
140 #endif /* HAL_SD_MODULE_ENABLED || HAL_QSPI_MODULE_ENABLED || HAL_OSPI_MODULE_ENABLED */
141 
142 /**
143   * @}
144   */
145 
146 #ifdef __cplusplus
147 }
148 #endif
149 
150 #endif /* STM32U5xx_LL_DLYB_H */
151