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