1 /**
2   ******************************************************************************
3   * @file    stm32f7xx_hal_mdios.h
4   * @author  MCD Application Team
5   * @brief   Header file of MDIOS HAL module.
6   ******************************************************************************
7   * @attention
8   *
9   * Copyright (c) 2017 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 __STM32F7xx_HAL_MDIOS_H
21 #define __STM32F7xx_HAL_MDIOS_H
22 
23 #ifdef __cplusplus
24  extern "C" {
25 #endif
26 
27 /* Includes ------------------------------------------------------------------*/
28 #include "stm32f7xx_hal_def.h"
29 
30 #if defined (MDIOS)
31 
32 /** @addtogroup STM32F7xx_HAL_Driver
33   * @{
34   */
35 
36 /** @addtogroup MDIOS
37   * @{
38   */
39 
40 /* Exported types ------------------------------------------------------------*/
41 /** @defgroup MDIOS_Exported_Types MDIOS Exported Types
42   * @{
43   */
44 
45 /** @defgroup MDIOS_Exported_Types_Group1 MDIOS State structures definition
46   * @{
47   */
48 
49 typedef enum
50 {
51   HAL_MDIOS_STATE_RESET             = 0x00U,    /*!< Peripheral not yet Initialized or disabled         */
52   HAL_MDIOS_STATE_READY             = 0x01U,    /*!< Peripheral Initialized and ready for use           */
53   HAL_MDIOS_STATE_BUSY              = 0x02U,    /*!< an internal process is ongoing                     */
54   HAL_MDIOS_STATE_ERROR             = 0x04U     /*!< Reception process is ongoing                       */
55 }HAL_MDIOS_StateTypeDef;
56 
57 /**
58   * @}
59   */
60 
61 /** @defgroup MDIOS_Exported_Types_Group2 MDIOS Init Structure definition
62   * @{
63   */
64 
65 typedef struct
66 {
67   uint32_t PortAddress;           /*!< Specifies the MDIOS port address.
68                                        This parameter can be a value from 0 to 31 */
69   uint32_t PreambleCheck;         /*!< Specifies whether the preamble check is enabled or disabled.
70                                        This parameter can be a value of @ref MDIOS_Preamble_Check */
71 }MDIOS_InitTypeDef;
72 
73 /**
74   * @}
75   */
76 
77 /** @defgroup MDIOS_Exported_Types_Group4 MDIOS handle Structure definition
78   * @{
79   */
80 
81 #if ( USE_HAL_MDIOS_REGISTER_CALLBACKS == 1 )
82 typedef struct __MDIOS_HandleTypeDef
83 #else
84 typedef struct
85 #endif /* USE_HAL_MDIOS_REGISTER_CALLBACKS */
86 {
87   MDIOS_TypeDef                *Instance;     /*!< Register base address       */
88 
89   MDIOS_InitTypeDef            Init;          /*!< MDIOS Init Structure        */
90 
91   __IO HAL_MDIOS_StateTypeDef  State;         /*!< MDIOS communication state   */
92 
93   HAL_LockTypeDef              Lock;          /*!< MDIOS Lock                  */
94 
95 #if (USE_HAL_MDIOS_REGISTER_CALLBACKS == 1)
96 
97   void    (* WriteCpltCallback)  ( struct __MDIOS_HandleTypeDef * hmdios);  /*!< MDIOS Write Complete Callback */
98   void    (* ReadCpltCallback)   ( struct __MDIOS_HandleTypeDef * hmdios);  /*!< MDIOS Read  Complete Callback */
99   void    (* ErrorCallback)      ( struct __MDIOS_HandleTypeDef * hmdios);  /*!< MDIOS Error Callback          */
100   void    (* WakeUpCallback)     ( struct __MDIOS_HandleTypeDef * hmdios);  /*!< MDIOS Wake UP Callback        */
101   void    (* MspInitCallback)    ( struct __MDIOS_HandleTypeDef * hmdios);  /*!< MDIOS Msp Init callback       */
102   void    (* MspDeInitCallback)  ( struct __MDIOS_HandleTypeDef * hmdios);  /*!< MDIOS Msp DeInit callback     */
103 
104 #endif  /* USE_HAL_MDIOS_REGISTER_CALLBACKS */
105 
106 }MDIOS_HandleTypeDef;
107 
108 #if ( USE_HAL_MDIOS_REGISTER_CALLBACKS == 1)
109 /**
110   * @brief  HAL MDIOS Callback ID enumeration definition
111   */
112 typedef enum
113 {
114   HAL_MDIOS_MSPINIT_CB_ID            = 0x00U,    /*!< MDIOS MspInit callback ID           */
115   HAL_MDIOS_MSPDEINIT_CB_ID          = 0x01U,    /*!< MDIOS MspDeInit callback ID         */
116   HAL_MDIOS_WRITE_COMPLETE_CB_ID     = 0x02U,    /*!< MDIOS Write Complete Callback ID    */
117   HAL_MDIOS_READ_COMPLETE_CB_ID      = 0x03U,    /*!< MDIOS Read Complete Callback ID     */
118   HAL_MDIOS_ERROR_CB_ID              = 0x04U,    /*!< MDIOS Error Callback ID             */
119   HAL_MDIOS_WAKEUP_CB_ID             = 0x05U     /*!< MDIOS Wake UP Callback ID           */
120 }HAL_MDIOS_CallbackIDTypeDef;
121 
122 /**
123   * @brief  HAL MDIOS Callback pointer definition
124   */
125 typedef  void (*pMDIOS_CallbackTypeDef)(MDIOS_HandleTypeDef * hmdios); /*!< pointer to an MDIOS callback function */
126 
127 #endif /* USE_HAL_MDIOS_REGISTER_CALLBACKS */
128 
129 /**
130   * @}
131   */
132 
133 /**
134   * @}
135   */
136 
137 /* Exported constants --------------------------------------------------------*/
138 /** @defgroup MDIOS_Exported_Constants MDIOS Exported Constants
139   * @{
140   */
141 
142 /** @defgroup MDIOS_Preamble_Check  MDIOS Preamble Check
143   * @{
144   */
145 #define MDIOS_PREAMBLE_CHECK_ENABLE      ((uint32_t)0x00000000U)
146 #define MDIOS_PREAMBLE_CHECK_DISABLE     MDIOS_CR_DPC
147 /**
148   * @}
149   */
150 
151 /** @defgroup MDIOS_Input_Output_Registers_Definitions MDIOS Input Output Registers Definitions
152   * @{
153   */
154 #define MDIOS_REG0                      ((uint32_t)0x00000000U)
155 #define MDIOS_REG1                      ((uint32_t)0x00000001U)
156 #define MDIOS_REG2                      ((uint32_t)0x00000002U)
157 #define MDIOS_REG3                      ((uint32_t)0x00000003U)
158 #define MDIOS_REG4                      ((uint32_t)0x00000004U)
159 #define MDIOS_REG5                      ((uint32_t)0x00000005U)
160 #define MDIOS_REG6                      ((uint32_t)0x00000006U)
161 #define MDIOS_REG7                      ((uint32_t)0x00000007U)
162 #define MDIOS_REG8                      ((uint32_t)0x00000008U)
163 #define MDIOS_REG9                      ((uint32_t)0x00000009U)
164 #define MDIOS_REG10                     ((uint32_t)0x0000000AU)
165 #define MDIOS_REG11                     ((uint32_t)0x0000000BU)
166 #define MDIOS_REG12                     ((uint32_t)0x0000000CU)
167 #define MDIOS_REG13                     ((uint32_t)0x0000000DU)
168 #define MDIOS_REG14                     ((uint32_t)0x0000000EU)
169 #define MDIOS_REG15                     ((uint32_t)0x0000000FU)
170 #define MDIOS_REG16                     ((uint32_t)0x00000010U)
171 #define MDIOS_REG17                     ((uint32_t)0x00000011U)
172 #define MDIOS_REG18                     ((uint32_t)0x00000012U)
173 #define MDIOS_REG19                     ((uint32_t)0x00000013U)
174 #define MDIOS_REG20                     ((uint32_t)0x00000014U)
175 #define MDIOS_REG21                     ((uint32_t)0x00000015U)
176 #define MDIOS_REG22                     ((uint32_t)0x00000016U)
177 #define MDIOS_REG23                     ((uint32_t)0x00000017U)
178 #define MDIOS_REG24                     ((uint32_t)0x00000018U)
179 #define MDIOS_REG25                     ((uint32_t)0x00000019U)
180 #define MDIOS_REG26                     ((uint32_t)0x0000001AU)
181 #define MDIOS_REG27                     ((uint32_t)0x0000001BU)
182 #define MDIOS_REG28                     ((uint32_t)0x0000001CU)
183 #define MDIOS_REG29                     ((uint32_t)0x0000001DU)
184 #define MDIOS_REG30                     ((uint32_t)0x0000001EU)
185 #define MDIOS_REG31                     ((uint32_t)0x0000001FU)
186 /**
187   * @}
188   */
189 
190 /** @defgroup MDIOS_Registers_Flags  MDIOS Registers Flags
191   * @{
192   */
193 #define MDIOS_REG0_FLAG			((uint32_t)0x00000001U)
194 #define	MDIOS_REG1_FLAG			((uint32_t)0x00000002U)
195 #define	MDIOS_REG2_FLAG			((uint32_t)0x00000004U)
196 #define	MDIOS_REG3_FLAG			((uint32_t)0x00000008U)
197 #define	MDIOS_REG4_FLAG			((uint32_t)0x00000010U)
198 #define	MDIOS_REG5_FLAG			((uint32_t)0x00000020U)
199 #define	MDIOS_REG6_FLAG			((uint32_t)0x00000040U)
200 #define	MDIOS_REG7_FLAG			((uint32_t)0x00000080U)
201 #define	MDIOS_REG8_FLAG			((uint32_t)0x00000100U)
202 #define	MDIOS_REG9_FLAG			((uint32_t)0x00000200U)
203 #define	MDIOS_REG10_FLAG		((uint32_t)0x00000400U)
204 #define	MDIOS_REG11_FLAG		((uint32_t)0x00000800U)
205 #define	MDIOS_REG12_FLAG		((uint32_t)0x00001000U)
206 #define	MDIOS_REG13_FLAG		((uint32_t)0x00002000U)
207 #define	MDIOS_REG14_FLAG		((uint32_t)0x00004000U)
208 #define	MDIOS_REG15_FLAG		((uint32_t)0x00008000U)
209 #define	MDIOS_REG16_FLAG		((uint32_t)0x00010000U)
210 #define	MDIOS_REG17_FLAG		((uint32_t)0x00020000U)
211 #define	MDIOS_REG18_FLAG		((uint32_t)0x00040000U)
212 #define	MDIOS_REG19_FLAG		((uint32_t)0x00080000U)
213 #define	MDIOS_REG20_FLAG		((uint32_t)0x00100000U)
214 #define	MDIOS_REG21_FLAG		((uint32_t)0x00200000U)
215 #define	MDIOS_REG22_FLAG		((uint32_t)0x00400000U)
216 #define	MDIOS_REG23_FLAG		((uint32_t)0x00800000U)
217 #define	MDIOS_REG24_FLAG		((uint32_t)0x01000000U)
218 #define	MDIOS_REG25_FLAG		((uint32_t)0x02000000U)
219 #define	MDIOS_REG26_FLAG		((uint32_t)0x04000000U)
220 #define	MDIOS_REG27_FLAG		((uint32_t)0x08000000U)
221 #define	MDIOS_REG28_FLAG		((uint32_t)0x10000000U)
222 #define	MDIOS_REG29_FLAG		((uint32_t)0x20000000U)
223 #define	MDIOS_REG30_FLAG		((uint32_t)0x40000000U)
224 #define	MDIOS_REG31_FLAG		((uint32_t)0x80000000U)
225 #define	MDIOS_ALLREG_FLAG		((uint32_t)0xFFFFFFFFU)
226 /**
227   * @}
228   */
229 
230 /** @defgroup MDIOS_Interrupt_sources Interrupt Sources
231   * @{
232   */
233 #define MDIOS_IT_WRITE                   MDIOS_CR_WRIE
234 #define MDIOS_IT_READ                    MDIOS_CR_RDIE
235 #define MDIOS_IT_ERROR                   MDIOS_CR_EIE
236 /**
237   * @}
238   */
239 
240 /** @defgroup MDIOS_Interrupt_Flags  MDIOS Interrupt Flags
241   * @{
242   */
243 #define	MDIOS_TURNAROUND_ERROR_FLAG       MDIOS_SR_TERF
244 #define	MDIOS_START_ERROR_FLAG            MDIOS_SR_SERF
245 #define	MDIOS_PREAMBLE_ERROR_FLAG         MDIOS_SR_PERF
246 /**
247   * @}
248   */
249 
250  /** @defgroup MDIOS_Wakeup_Line  MDIOS Wakeup Line
251   * @{
252   */
253 #define MDIOS_WAKEUP_EXTI_LINE  ((uint32_t)0x01000000)  /* !<  EXTI Line 24 */
254 /**
255   * @}
256   */
257 
258 /**
259   * @}
260   */
261 /* Exported macros -----------------------------------------------------------*/
262 /** @defgroup MDIOS_Exported_Macros MDIOS Exported Macros
263   * @{
264   */
265 
266 /** @brief Reset MDIOS handle state
267   * @param  __HANDLE__ MDIOS handle.
268   * @retval None
269   */
270 #if (USE_HAL_MDIOS_REGISTER_CALLBACKS == 1)
271 #define __HAL_MDIOS_RESET_HANDLE_STATE(__HANDLE__)  do{                                                  \
272                                                        (__HANDLE__)->State = HAL_MDIOS_STATE_RESET;      \
273                                                        (__HANDLE__)->MspInitCallback = NULL;             \
274                                                        (__HANDLE__)->MspDeInitCallback = NULL;           \
275                                                      } while(0)
276 #else
277 #define __HAL_MDIOS_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_MDIOS_STATE_RESET)
278 #endif /* USE_HAL_MDIOS_REGISTER_CALLBACKS */
279 
280 /**
281   * @brief  Enable/Disable the MDIOS peripheral.
282   * @param  __HANDLE__ specifies the MDIOS handle.
283   * @retval None
284   */
285 #define __HAL_MDIOS_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= MDIOS_CR_EN)
286 #define __HAL_MDIOS_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~MDIOS_CR_EN)
287 
288 
289 /**
290   * @brief  Enable the MDIOS device interrupt.
291   * @param  __HANDLE__ specifies the MDIOS handle.
292   * @param  __INTERRUPT__  specifies the MDIOS interrupt sources to be enabled.
293   *         This parameter can be one or a combination of the following values:
294   *            @arg MDIOS_IT_WRITE: Register write interrupt
295   *            @arg MDIOS_IT_READ: Register read interrupt
296   *            @arg MDIOS_IT_ERROR: Error interrupt
297   * @retval None
298   */
299 #define __HAL_MDIOS_ENABLE_IT(__HANDLE__, __INTERRUPT__)  ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
300 
301 /**
302   * @brief  Disable the MDIOS device interrupt.
303   * @param  __HANDLE__ specifies the MDIOS handle.
304   * @param  __INTERRUPT__  specifies the MDIOS interrupt sources to be disabled.
305   *         This parameter can be one or a combination of the following values:
306   *            @arg MDIOS_IT_WRITE: Register write interrupt
307   *            @arg MDIOS_IT_READ: Register read interrupt
308   *            @arg MDIOS_IT_ERROR: Error interrupt
309   * @retval None
310   */
311 #define __HAL_MDIOS_DISABLE_IT(__HANDLE__, __INTERRUPT__)  ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
312 
313 /** @brief Set MDIOS slave get write register flag
314   * @param  __HANDLE__ specifies the MDIOS handle.
315   * @param  __FLAG__ specifies the write register flag
316   * @retval The state of write flag
317   */
318 #define __HAL_MDIOS_GET_WRITE_FLAG(__HANDLE__, __FLAG__)      ((__HANDLE__)->Instance->WRFR &  (__FLAG__))
319 
320 /** @brief MDIOS slave get read register flag
321   * @param  __HANDLE__ specifies the MDIOS handle.
322   * @param  __FLAG__ specifies the read register flag
323   * @retval The state of read flag
324   */
325 #define __HAL_MDIOS_GET_READ_FLAG(__HANDLE__, __FLAG__)        ((__HANDLE__)->Instance->RDFR &  (__FLAG__))
326 
327 /** @brief MDIOS slave get interrupt
328   * @param  __HANDLE__ specifies the MDIOS handle.
329   * @param  __FLAG__  specifies the Error flag.
330   *         This parameter can be one or a combination of the following values:
331   *            @arg MDIOS_TURNARROUND_ERROR_FLAG: Register write interrupt
332   *            @arg MDIOS_START_ERROR_FLAG: Register read interrupt
333   *            @arg MDIOS_PREAMBLE_ERROR_FLAG: Error interrupt
334   * @retval The state of the error flag
335   */
336 #define __HAL_MDIOS_GET_ERROR_FLAG(__HANDLE__, __FLAG__)       ((__HANDLE__)->Instance->SR &  (__FLAG__))
337 
338 /** @brief  MDIOS slave clear interrupt
339   * @param  __HANDLE__ specifies the MDIOS handle.
340   * @param  __FLAG__  specifies the Error flag.
341   *         This parameter can be one or a combination of the following values:
342   *            @arg MDIOS_TURNARROUND_ERROR_FLAG: Register write interrupt
343   *            @arg MDIOS_START_ERROR_FLAG: Register read interrupt
344   *            @arg MDIOS_PREAMBLE_ERROR_FLAG: Error interrupt
345   * @retval none
346   */
347 #define __HAL_MDIOS_CLEAR_ERROR_FLAG(__HANDLE__, __FLAG__)       ((__HANDLE__)->Instance->CLRFR) |= (__FLAG__)
348 
349 /**
350   * @brief  Checks whether the specified MDIOS interrupt is set or not.
351   * @param  __HANDLE__ specifies the MDIOS handle.
352   * @param  __INTERRUPT__  specifies the MDIOS interrupt sources
353   *            This parameter can be one or a combination of the following values:
354   *            @arg MDIOS_IT_WRITE: Register write interrupt
355   *            @arg MDIOS_IT_READ: Register read interrupt
356   *            @arg MDIOS_IT_ERROR: Error interrupt
357   * @retval The state of the interrupt source
358   */
359 #define __HAL_MDIOS_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR & (__INTERRUPT__))
360 
361 /**
362   * @brief Enable the MDIOS WAKEUP Exti Line.
363   * @retval None.
364   */
365 #define __HAL_MDIOS_WAKEUP_EXTI_ENABLE_IT()   (EXTI->IMR |= (MDIOS_WAKEUP_EXTI_LINE))
366 
367 /**
368   * @brief Disable the MDIOS WAKEUP Exti Line.
369   * @retval None.
370   */
371 #define __HAL_MDIOS_WAKEUP_EXTI_DISABLE_IT()   (EXTI->IMR &= ~(MDIOS_WAKEUP_EXTI_LINE))
372 
373 /**
374   * @brief Enable event on MDIOS WAKEUP Exti Line.
375   * @retval None.
376   */
377 #define __HAL_MDIOS_WAKEUP_EXTI_ENABLE_EVENT()   (EXTI->EMR |= (MDIOS_WAKEUP_EXTI_LINE))
378 
379 /**
380   * @brief Disable event on MDIOS WAKEUP Exti Line.
381   * @retval None.
382   */
383 #define __HAL_MDIOS_WAKEUP_EXTI_DISABLE_EVENT()   (EXTI->EMR &= ~(MDIOS_WAKEUP_EXTI_LINE))
384 
385 /**
386   * @brief checks whether the specified MDIOS WAKEUP Exti interrupt flag is set or not.
387   * @retval EXTI MDIOS WAKEUP Line Status.
388   */
389 #define __HAL_MDIOS_WAKEUP_EXTI_GET_FLAG()  (EXTI->PR & (MDIOS_WAKEUP_EXTI_LINE))
390 
391 /**
392   * @brief Clear the MDIOS WAKEUP Exti flag.
393   * @retval None.
394   */
395 #define __HAL_MDIOS_WAKEUP_EXTI_CLEAR_FLAG() (EXTI->PR = (MDIOS_WAKEUP_EXTI_LINE))
396 
397 /**
398   * @brief  Enables rising edge trigger to the MDIOS External interrupt line.
399   * @retval None
400   */
401 #define __HAL_MDIOS_WAKEUP_EXTI_ENABLE_RISING_EDGE_TRIGGER()  EXTI->RTSR |= MDIOS_WAKEUP_EXTI_LINE
402 
403 /**
404   * @brief  Disables the rising edge trigger to the MDIOS External interrupt line.
405   * @retval None
406   */
407 #define __HAL_MDIOS_WAKEUP_EXTI_DISABLE_RISING_EDGE_TRIGGER()  EXTI->RTSR &= ~(MDIOS_WAKEUP_EXTI_LINE)
408 
409 /**
410   * @brief  Enables falling edge trigger to the MDIOS External interrupt line.
411   * @retval None
412   */
413 #define __HAL_MDIOS_WAKEUP_EXTI_ENABLE_FALLING_EDGE_TRIGGER()  EXTI->FTSR |= (MDIOS_WAKEUP_EXTI_LINE)
414 
415 /**
416   * @brief  Disables falling edge trigger to the MDIOS External interrupt line.
417   * @retval None
418   */
419 #define __HAL_MDIOS_WAKEUP_EXTI_DISABLE_FALLING_EDGE_TRIGGER()  EXTI->FTSR &= ~(MDIOS_WAKEUP_EXTI_LINE)
420 
421 /**
422   * @brief  Enables rising/falling edge trigger to the MDIOS External interrupt line.
423   * @retval None
424   */
425 #define __HAL_MDIOS_WAKEUP_EXTI_ENABLE_FALLINGRISING_TRIGGER()  EXTI->RTSR |= MDIOS_WAKEUP_EXTI_LINE;\
426                                                                 EXTI->FTSR |= MDIOS_WAKEUP_EXTI_LINE
427 
428 /**
429   * @brief  Disables rising/falling edge trigger to the MDIOS External interrupt line.
430   * @retval None
431   */
432 #define __HAL_MDIOS_WAKEUP_EXTI_DISABLE_FALLINGRISING_TRIGGER()  EXTI->RTSR &= ~(MDIOS_WAKEUP_EXTI_LINE);\
433                                                                  EXTI->FTSR &= ~(MDIOS_WAKEUP_EXTI_LINE)
434 /**
435   * @brief  Generates a Software interrupt on selected EXTI line.
436   * @retval None
437   */
438 #define __HAL_MDIOS_WAKEUP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= (MDIOS_WAKEUP_EXTI_LINE))
439 
440 /**
441   * @}
442   */
443 
444 /* Exported functions --------------------------------------------------------*/
445 /** @defgroup MDIOS_Exported_Functions MDIOS Exported Functions
446   * @{
447   */
448 
449 /** @addtogroup MDIOS_Exported_Functions_Group1
450   * @{
451   */
452 HAL_StatusTypeDef HAL_MDIOS_Init(MDIOS_HandleTypeDef *hmdios);
453 HAL_StatusTypeDef HAL_MDIOS_DeInit(MDIOS_HandleTypeDef *hmdios);
454 void HAL_MDIOS_MspInit(MDIOS_HandleTypeDef *hmdios);
455 void  HAL_MDIOS_MspDeInit(MDIOS_HandleTypeDef *hmdios);
456 /* Callbacks Register/UnRegister functions  ***********************************/
457 #if (USE_HAL_MDIOS_REGISTER_CALLBACKS == 1)
458 HAL_StatusTypeDef HAL_MDIOS_RegisterCallback(MDIOS_HandleTypeDef *hmdios, HAL_MDIOS_CallbackIDTypeDef CallbackID, pMDIOS_CallbackTypeDef pCallback);
459 HAL_StatusTypeDef HAL_MDIOS_UnRegisterCallback(MDIOS_HandleTypeDef *hmdios, HAL_MDIOS_CallbackIDTypeDef CallbackID);
460 #endif /* USE_HAL_MDIOS_REGISTER_CALLBACKS */
461 /**
462   * @}
463   */
464 
465 /** @addtogroup MDIOS_Exported_Functions_Group2
466   * @{
467   */
468 HAL_StatusTypeDef HAL_MDIOS_WriteReg(MDIOS_HandleTypeDef *hmdios,  uint32_t RegNum, uint16_t Data);
469 HAL_StatusTypeDef HAL_MDIOS_ReadReg(MDIOS_HandleTypeDef *hmdios,  uint32_t RegNum, uint16_t *pData);
470 
471 uint32_t HAL_MDIOS_GetWrittenRegAddress(MDIOS_HandleTypeDef *hmdios);
472 uint32_t HAL_MDIOS_GetReadRegAddress(MDIOS_HandleTypeDef *hmdios);
473 HAL_StatusTypeDef HAL_MDIOS_ClearWriteRegAddress(MDIOS_HandleTypeDef *hmdios, uint32_t RegNum);
474 HAL_StatusTypeDef HAL_MDIOS_ClearReadRegAddress(MDIOS_HandleTypeDef *hmdios, uint32_t RegNum);
475 
476 HAL_StatusTypeDef HAL_MDIOS_EnableEvents(MDIOS_HandleTypeDef *hmdios);
477 void HAL_MDIOS_IRQHandler(MDIOS_HandleTypeDef *hmdios);
478 void HAL_MDIOS_WriteCpltCallback(MDIOS_HandleTypeDef *hmdios);
479 void HAL_MDIOS_ReadCpltCallback(MDIOS_HandleTypeDef *hmdios);
480 void HAL_MDIOS_ErrorCallback(MDIOS_HandleTypeDef *hmdios);
481 void HAL_MDIOS_WakeUpCallback(MDIOS_HandleTypeDef *hmdios);
482 /**
483   * @}
484   */
485 
486 /** @addtogroup MDIOS_Exported_Functions_Group3
487   * @{
488   */
489 uint32_t HAL_MDIOS_GetError(MDIOS_HandleTypeDef *hmdios);
490 HAL_MDIOS_StateTypeDef HAL_MDIOS_GetState(MDIOS_HandleTypeDef *hmdios);
491 /**
492   * @}
493   */
494 
495 /**
496   * @}
497   */
498 
499 /* Private types -------------------------------------------------------------*/
500 /** @defgroup MDIOS_Private_Types MDIOS Private Types
501   * @{
502   */
503 
504 /**
505   * @}
506   */
507 
508 /* Private variables ---------------------------------------------------------*/
509 /** @defgroup MDIOS_Private_Variables MDIOS Private Variables
510   * @{
511   */
512 
513 /**
514   * @}
515   */
516 
517 /* Private constants ---------------------------------------------------------*/
518 /** @defgroup MDIOS_Private_Constants MDIOS Private Constants
519   * @{
520   */
521 
522 /**
523   * @}
524   */
525 
526 /* Private macros ------------------------------------------------------------*/
527 /** @defgroup MDIOS_Private_Macros MDIOS Private Macros
528   * @{
529   */
530 
531 #define IS_MDIOS_PORTADDRESS(__ADDR__) ((__ADDR__) < 32)
532 
533 #define IS_MDIOS_REGISTER(__REGISTER__) ((__REGISTER__) < 32)
534 
535 #define IS_MDIOS_PREAMBLECHECK(__PREAMBLECHECK__) (((__PREAMBLECHECK__) == MDIOS_PREAMBLE_CHECK_ENABLE) || \
536                                                    ((__PREAMBLECHECK__) == MDIOS_PREAMBLE_CHECK_DISABLE))
537 
538  /**
539   * @}
540   */
541 
542 /* Private functions ---------------------------------------------------------*/
543 /** @defgroup MDIOS_Private_Functions MDIOS Private Functions
544   * @{
545   */
546 
547 /**
548   * @}
549   */
550 
551 
552 /**
553   * @}
554   */
555 
556 /**
557   * @}
558   */
559 
560 #endif /* MDIOS */
561 
562 #ifdef __cplusplus
563 }
564 #endif
565 
566 #endif /* __STM32F7xx_HAL_MDIOS_H */
567 
568