2 ******************************************************************************
3 * @file stm32h7xx_hal_mdios.h
4 * @author MCD Application Team
5 * @brief Header file of MDIOS HAL module.
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 ******************************************************************************
20 /* Define to prevent recursive inclusion -------------------------------------*/
21 #ifndef STM32H7xx_HAL_MDIOS_H
22 #define STM32H7xx_HAL_MDIOS_H
29 /* Includes ------------------------------------------------------------------*/
30 #include "stm32h7xx_hal_def.h"
34 /** @addtogroup STM32H7xx_HAL_Driver
42 /* Exported types ------------------------------------------------------------*/
43 /** @defgroup MDIOS_Exported_Types MDIOS Exported Types
47 /** @defgroup MDIOS_Exported_Types_Group1 MDIOS State structures definition
53 HAL_MDIOS_STATE_RESET
= 0x00U
, /*!< Peripheral not yet Initialized or disabled */
54 HAL_MDIOS_STATE_READY
= 0x01U
, /*!< Peripheral Initialized and ready for use */
55 HAL_MDIOS_STATE_BUSY
= 0x02U
, /*!< an internal process is ongoing */
56 HAL_MDIOS_STATE_ERROR
= 0x04U
/*!< Reception process is ongoing */
57 }HAL_MDIOS_StateTypeDef
;
63 /** @defgroup MDIOS_Exported_Types_Group2 MDIOS Init Structure definition
69 uint32_t PortAddress
; /*!< Specifies the MDIOS port address.
70 This parameter can be a value from 0 to 31 */
71 uint32_t PreambleCheck
; /*!< Specifies whether the preamble check is enabled or disabled.
72 This parameter can be a value of @ref MDIOS_Preamble_Check */
79 /** @defgroup MDIOS_Exported_Types_Group4 MDIOS handle Structure definition
83 #if (USE_HAL_MDIOS_REGISTER_CALLBACKS == 1)
84 typedef struct __MDIOS_HandleTypeDef
89 MDIOS_TypeDef
*Instance
; /*!< Register base address */
91 MDIOS_InitTypeDef Init
; /*!< MDIOS Init Structure */
93 __IO HAL_MDIOS_StateTypeDef State
; /*!< MDIOS communication state
94 This parameter can be a value of of @ref HAL_MDIOS_StateTypeDef */
96 __IO
uint32_t ErrorCode
; /*!< Holds the global Error code of the MDIOS HAL status machine
97 This parameter can be a value of of @ref MDIOS_Error_Code */
99 HAL_LockTypeDef Lock
; /*!< MDIOS Lock */
101 #if (USE_HAL_MDIOS_REGISTER_CALLBACKS == 1)
103 void (* WriteCpltCallback
) ( struct __MDIOS_HandleTypeDef
* hmdios
); /*!< MDIOS Write Complete Callback */
104 void (* ReadCpltCallback
) ( struct __MDIOS_HandleTypeDef
* hmdios
); /*!< MDIOS Read Complete Callback */
105 void (* ErrorCallback
) ( struct __MDIOS_HandleTypeDef
* hmdios
); /*!< MDIOS Error Callback */
106 void (* WakeUpCallback
) ( struct __MDIOS_HandleTypeDef
* hmdios
); /*!< MDIOS Wake UP Callback */
108 void (* MspInitCallback
) ( struct __MDIOS_HandleTypeDef
* hmdios
); /*!< MDIOS Msp Init callback */
109 void (* MspDeInitCallback
) ( struct __MDIOS_HandleTypeDef
* hmdios
); /*!< MDIOS Msp DeInit callback */
111 #endif /* USE_HAL_MDIOS_REGISTER_CALLBACKS */
112 }MDIOS_HandleTypeDef
;
118 #if (USE_HAL_MDIOS_REGISTER_CALLBACKS == 1)
120 * @brief HAL MDIOS Callback ID enumeration definition
124 HAL_MDIOS_MSPINIT_CB_ID
= 0x00U
, /*!< MDIOS MspInit callback ID */
125 HAL_MDIOS_MSPDEINIT_CB_ID
= 0x01U
, /*!< MDIOS MspDeInit callback ID */
127 HAL_MDIOS_WRITE_COMPLETE_CB_ID
= 0x02U
, /*!< MDIOS Write Complete Callback ID */
128 HAL_MDIOS_READ_COMPLETE_CB_ID
= 0x03U
, /*!< MDIOS Read Complete Callback ID */
129 HAL_MDIOS_ERROR_CB_ID
= 0x04U
, /*!< MDIOS Error Callback ID */
130 HAL_MDIOS_WAKEUP_CB_ID
= 0x05U
/*!< MDIOS Wake UP Callback ID */
131 }HAL_MDIOS_CallbackIDTypeDef
;
134 * @brief HAL MDIOS Callback pointer definition
136 typedef void (*pMDIOS_CallbackTypeDef
)(MDIOS_HandleTypeDef
* hmdios
); /*!< pointer to an MDIOS callback function */
138 #endif /* USE_HAL_MDIOS_REGISTER_CALLBACKS */
144 /* Exported constants --------------------------------------------------------*/
145 /** @defgroup MDIOS_Exported_Constants MDIOS Exported Constants
149 /** @defgroup MDIOS_Preamble_Check MDIOS Preamble Check
152 #define MDIOS_PREAMBLE_CHECK_ENABLE ((uint32_t)0x00000000U)
153 #define MDIOS_PREAMBLE_CHECK_DISABLE MDIOS_CR_DPC
158 /** @defgroup MDIOS_Input_Output_Registers_Definitions MDIOS Input Output Registers Definitions
161 #define MDIOS_REG0 ((uint32_t)0x00000000U)
162 #define MDIOS_REG1 ((uint32_t)0x00000001U)
163 #define MDIOS_REG2 ((uint32_t)0x00000002U)
164 #define MDIOS_REG3 ((uint32_t)0x00000003U)
165 #define MDIOS_REG4 ((uint32_t)0x00000004U)
166 #define MDIOS_REG5 ((uint32_t)0x00000005U)
167 #define MDIOS_REG6 ((uint32_t)0x00000006U)
168 #define MDIOS_REG7 ((uint32_t)0x00000007U)
169 #define MDIOS_REG8 ((uint32_t)0x00000008U)
170 #define MDIOS_REG9 ((uint32_t)0x00000009U)
171 #define MDIOS_REG10 ((uint32_t)0x0000000AU)
172 #define MDIOS_REG11 ((uint32_t)0x0000000BU)
173 #define MDIOS_REG12 ((uint32_t)0x0000000CU)
174 #define MDIOS_REG13 ((uint32_t)0x0000000DU)
175 #define MDIOS_REG14 ((uint32_t)0x0000000EU)
176 #define MDIOS_REG15 ((uint32_t)0x0000000FU)
177 #define MDIOS_REG16 ((uint32_t)0x00000010U)
178 #define MDIOS_REG17 ((uint32_t)0x00000011U)
179 #define MDIOS_REG18 ((uint32_t)0x00000012U)
180 #define MDIOS_REG19 ((uint32_t)0x00000013U)
181 #define MDIOS_REG20 ((uint32_t)0x00000014U)
182 #define MDIOS_REG21 ((uint32_t)0x00000015U)
183 #define MDIOS_REG22 ((uint32_t)0x00000016U)
184 #define MDIOS_REG23 ((uint32_t)0x00000017U)
185 #define MDIOS_REG24 ((uint32_t)0x00000018U)
186 #define MDIOS_REG25 ((uint32_t)0x00000019U)
187 #define MDIOS_REG26 ((uint32_t)0x0000001AU)
188 #define MDIOS_REG27 ((uint32_t)0x0000001BU)
189 #define MDIOS_REG28 ((uint32_t)0x0000001CU)
190 #define MDIOS_REG29 ((uint32_t)0x0000001DU)
191 #define MDIOS_REG30 ((uint32_t)0x0000001EU)
192 #define MDIOS_REG31 ((uint32_t)0x0000001FU)
197 /** @defgroup MDIOS_Registers_Flags MDIOS Registers Flags
200 #define MDIOS_REG0_FLAG ((uint32_t)0x00000001U)
201 #define MDIOS_REG1_FLAG ((uint32_t)0x00000002U)
202 #define MDIOS_REG2_FLAG ((uint32_t)0x00000004U)
203 #define MDIOS_REG3_FLAG ((uint32_t)0x00000008U)
204 #define MDIOS_REG4_FLAG ((uint32_t)0x00000010U)
205 #define MDIOS_REG5_FLAG ((uint32_t)0x00000020U)
206 #define MDIOS_REG6_FLAG ((uint32_t)0x00000040U)
207 #define MDIOS_REG7_FLAG ((uint32_t)0x00000080U)
208 #define MDIOS_REG8_FLAG ((uint32_t)0x00000100U)
209 #define MDIOS_REG9_FLAG ((uint32_t)0x00000200U)
210 #define MDIOS_REG10_FLAG ((uint32_t)0x00000400U)
211 #define MDIOS_REG11_FLAG ((uint32_t)0x00000800U)
212 #define MDIOS_REG12_FLAG ((uint32_t)0x00001000U)
213 #define MDIOS_REG13_FLAG ((uint32_t)0x00002000U)
214 #define MDIOS_REG14_FLAG ((uint32_t)0x00004000U)
215 #define MDIOS_REG15_FLAG ((uint32_t)0x00008000U)
216 #define MDIOS_REG16_FLAG ((uint32_t)0x00010000U)
217 #define MDIOS_REG17_FLAG ((uint32_t)0x00020000U)
218 #define MDIOS_REG18_FLAG ((uint32_t)0x00040000U)
219 #define MDIOS_REG19_FLAG ((uint32_t)0x00080000U)
220 #define MDIOS_REG20_FLAG ((uint32_t)0x00100000U)
221 #define MDIOS_REG21_FLAG ((uint32_t)0x00200000U)
222 #define MDIOS_REG22_FLAG ((uint32_t)0x00400000U)
223 #define MDIOS_REG23_FLAG ((uint32_t)0x00800000U)
224 #define MDIOS_REG24_FLAG ((uint32_t)0x01000000U)
225 #define MDIOS_REG25_FLAG ((uint32_t)0x02000000U)
226 #define MDIOS_REG26_FLAG ((uint32_t)0x04000000U)
227 #define MDIOS_REG27_FLAG ((uint32_t)0x08000000U)
228 #define MDIOS_REG28_FLAG ((uint32_t)0x10000000U)
229 #define MDIOS_REG29_FLAG ((uint32_t)0x20000000U)
230 #define MDIOS_REG30_FLAG ((uint32_t)0x40000000U)
231 #define MDIOS_REG31_FLAG ((uint32_t)0x80000000U)
232 #define MDIOS_ALLREG_FLAG ((uint32_t)0xFFFFFFFFU)
237 /** @defgroup MDIOS_Interrupt_sources Interrupt Sources
240 #define MDIOS_IT_WRITE MDIOS_CR_WRIE
241 #define MDIOS_IT_READ MDIOS_CR_RDIE
242 #define MDIOS_IT_ERROR MDIOS_CR_EIE
247 /** @defgroup MDIOS_Interrupt_Flags MDIOS Interrupt Flags
250 #define MDIOS_TURNAROUND_ERROR_FLAG MDIOS_SR_TERF
251 #define MDIOS_START_ERROR_FLAG MDIOS_SR_SERF
252 #define MDIOS_PREAMBLE_ERROR_FLAG MDIOS_SR_PERF
257 /** @defgroup MDIOS_Error_Code MDIOS Error Code
260 #define HAL_MDIOS_ERROR_NONE ((uint32_t)0x00000000U) /*!< No error */
261 #define HAL_MDIOS_ERROR_PARAM ((uint32_t)0x00000001U) /*!< Busy error */
262 #define HAL_MDIOS_ERROR_BUSY ((uint32_t)0x00000002U) /*!< Parameter error */
263 #define HAL_MDIOS_ERROR_TIMEOUT ((uint32_t)0x00000004U) /*!< Timeout error */
264 #define HAL_MDIOS_ERROR_DATA ((uint32_t)0x00000010U) /*!< Data transfer error */
265 #if (USE_HAL_MDIOS_REGISTER_CALLBACKS == 1)
266 #define HAL_MDIOS_ERROR_INVALID_CALLBACK ((uint32_t)0x00000020U) /*!< Invalid Callback error */
267 #endif /* USE_HAL_MDIOS_REGISTER_CALLBACKS */
272 /** @defgroup MDIOS_Wakeup_Line MDIOS Wakeup Line
275 #define MDIOS_WAKEUP_EXTI_LINE ((uint32_t)0x00000400) /* !< 42 - 32 = 10 */
283 /* Exported macros -----------------------------------------------------------*/
284 /** @defgroup MDIOS_Exported_Macros MDIOS Exported Macros
288 /** @brief Reset MDIOS handle state
289 * @param __HANDLE__: MDIOS handle.
292 #if (USE_HAL_MDIOS_REGISTER_CALLBACKS == 1)
293 #define __HAL_MDIOS_RESET_HANDLE_STATE(__HANDLE__) do{ \
294 (__HANDLE__)->State = HAL_MDIOS_STATE_RESET; \
295 (__HANDLE__)->MspInitCallback = NULL; \
296 (__HANDLE__)->MspDeInitCallback = NULL; \
299 #define __HAL_MDIOS_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_MDIOS_STATE_RESET)
300 #endif /*USE_HAL_MDIOS_REGISTER_CALLBACKS */
303 * @brief Enable/Disable the MDIOS peripheral.
304 * @param __HANDLE__: specifies the MDIOS handle.
307 #define __HAL_MDIOS_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= MDIOS_CR_EN)
308 #define __HAL_MDIOS_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~MDIOS_CR_EN)
312 * @brief Enable the MDIOS device interrupt.
313 * @param __HANDLE__: specifies the MDIOS handle.
314 * @param __INTERRUPT__ : specifies the MDIOS interrupt sources to be enabled.
315 * This parameter can be one or a combination of the following values:
316 * @arg MDIOS_IT_WRITE: Register write interrupt
317 * @arg MDIOS_IT_READ: Register read interrupt
318 * @arg MDIOS_IT_ERROR: Error interrupt
321 #define __HAL_MDIOS_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
324 * @brief Disable the MDIOS device interrupt.
325 * @param __HANDLE__: specifies the MDIOS handle.
326 * @param __INTERRUPT__ : specifies the MDIOS interrupt sources to be disabled.
327 * This parameter can be one or a combination of the following values:
328 * @arg MDIOS_IT_WRITE: Register write interrupt
329 * @arg MDIOS_IT_READ: Register read interrupt
330 * @arg MDIOS_IT_ERROR: Error interrupt
333 #define __HAL_MDIOS_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
335 /** @brief Set MDIOS slave get write register flag
336 * @param __HANDLE__: specifies the MDIOS handle.
337 * @param __FLAG__: specifies the write register flag
338 * @retval The state of write flag
340 #define __HAL_MDIOS_GET_WRITE_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->WRFR & (__FLAG__))
342 /** @brief MDIOS slave get read register flag
343 * @param __HANDLE__: specifies the MDIOS handle.
344 * @param __FLAG__: specifies the read register flag
345 * @retval The state of read flag
347 #define __HAL_MDIOS_GET_READ_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->RDFR & (__FLAG__))
349 /** @brief MDIOS slave get interrupt
350 * @param __HANDLE__: specifies the MDIOS handle.
351 * @param __FLAG__ : specifies the Error flag.
352 * This parameter can be one or a combination of the following values:
353 * @arg MDIOS_TURNARROUND_ERROR_FLAG: Register write interrupt
354 * @arg MDIOS_START_ERROR_FLAG: Register read interrupt
355 * @arg MDIOS_PREAMBLE_ERROR_FLAG: Error interrupt
356 * @retval The state of the error flag
358 #define __HAL_MDIOS_GET_ERROR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR & (__FLAG__))
360 /** @brief MDIOS slave clear interrupt
361 * @param __HANDLE__: specifies the MDIOS handle.
362 * @param __FLAG__ : specifies the Error flag.
363 * This parameter can be one or a combination of the following values:
364 * @arg MDIOS_TURNARROUND_ERROR_FLAG: Register write interrupt
365 * @arg MDIOS_START_ERROR_FLAG: Register read interrupt
366 * @arg MDIOS_PREAMBLE_ERROR_FLAG: Error interrupt
369 #define __HAL_MDIOS_CLEAR_ERROR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->CLRFR) |= (__FLAG__)
372 * @brief Checks whether the specified MDIOS interrupt is set or not.
373 * @param __HANDLE__: specifies the MDIOS handle.
374 * @param __INTERRUPT__ : specifies the MDIOS interrupt sources
375 * This parameter can be one or a combination of the following values:
376 * @arg MDIOS_IT_WRITE: Register write interrupt
377 * @arg MDIOS_IT_READ: Register read interrupt
378 * @arg MDIOS_IT_ERROR: Error interrupt
379 * @retval The state of the interrupt source
381 #define __HAL_MDIOS_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR & (__INTERRUPT__))
384 * @brief Enable the MDIOS WAKEUP Exti Line.
385 * @param __EXTI_LINE__: specifies the MDIOS WAKEUP Exti sources to be enabled.
386 * This parameter can be:
387 * @arg MDIOS_WAKEUP_EXTI_LINE
390 #define __HAL_MDIOS_WAKEUP_EXTI_ENABLE_IT(__EXTI_LINE__) (EXTI->IMR2 |= (__EXTI_LINE__))
392 #if defined(DUAL_CORE)
394 * @brief Enable the MDIOS WAKEUP Exti Line by Domain2.
395 * @param __EXTI_LINE__: specifies the MDIOS WAKEUP Exti sources to be enabled.
396 * This parameter can be:
397 * @arg MDIOS_WAKEUP_EXTI_LINE
400 #define __HAL_MDIOS_WAKEUP_EXTID2_ENABLE_IT(__EXTI_LINE__) (EXTI->C2IMR2 |= (__EXTI_LINE__))
404 * @brief checks whether the specified MDIOS WAKEUP Exti interrupt flag is set or not.
405 * @param __EXTI_LINE__: specifies the MDIOS WAKEUP Exti sources to be cleared.
406 * This parameter can be:
407 * @arg MDIOS_WAKEUP_EXTI_LINE
408 * @retval EXTI MDIOS WAKEUP Line Status.
410 #define __HAL_MDIOS_WAKEUP_EXTI_GET_FLAG(__EXTI_LINE__) (EXTI->PR2 & (__EXTI_LINE__))
412 #if defined(DUAL_CORE)
414 * @brief checks whether the specified MDIOS WAKEUP Exti interrupt flag is set or not.
415 * @param __EXTI_LINE__: specifies the MDIOS WAKEUP Exti sources to be cleared.
416 * This parameter can be:
417 * @arg MDIOS_WAKEUP_EXTI_LINE
418 * @retval EXTI MDIOS WAKEUP Line Status.
420 #define __HAL_MDIOS_WAKEUP_EXTID2_GET_FLAG(__EXTI_LINE__) (EXTI->C2PR2 & (__EXTI_LINE__))
423 * @brief Clear the MDIOS WAKEUP Exti flag.
424 * @param __EXTI_LINE__: specifies the MDIOS WAKEUP Exti sources to be cleared.
425 * This parameter can be:
426 * @arg MDIOS_WAKEUP_EXTI_LINE
429 #define __HAL_MDIOS_WAKEUP_EXTI_CLEAR_FLAG(__EXTI_LINE__) (EXTI->PR2 = (__EXTI_LINE__))
431 #if defined(DUAL_CORE)
433 * @brief Clear the MDIOS WAKEUP Exti flag.
434 * @param __EXTI_LINE__: specifies the MDIOS WAKEUP Exti sources to be cleared.
435 * This parameter can be:
436 * @arg MDIOS_WAKEUP_EXTI_LINE
439 #define __HAL_MDIOS_WAKEUP_EXTID2_CLEAR_FLAG(__EXTI_LINE__) (EXTI->C2PR2 = (__EXTI_LINE__))
443 * @brief enable rising edge interrupt on selected EXTI line.
444 * @param __EXTI_LINE__: specifies the MDIOS WAKEUP EXTI sources to be disabled.
445 * This parameter can be:
446 * @arg MDIOS_WAKEUP_EXTI_LINE
449 #define __HAL_MDIOS_WAKEUP_EXTI_ENABLE_RISING_EDGE(__EXTI_LINE__) (EXTI->FTSR2 &= ~(__EXTI_LINE__)); \
450 (EXTI->RTSR2 |= (__EXTI_LINE__))
453 * @brief enable falling edge interrupt on selected EXTI line.
454 * @param __EXTI_LINE__: specifies the MDIOS WAKEUP EXTI sources to be disabled.
455 * This parameter can be:
456 * @arg MDIOS_WAKEUP_EXTI_LINE
459 #define __HAL_MDIOS_WAKEUP_EXTI_ENABLE_FALLING_EDGE(__EXTI_LINE__) (EXTI->RTSR2 &= ~(__EXTI_LINE__));\
460 (EXTI->FTSR2 |= (__EXTI_LINE__))
463 * @brief enable falling edge interrupt on selected EXTI line.
464 * @param __EXTI_LINE__: specifies the MDIOS WAKEUP EXTI sources to be disabled.
465 * This parameter can be:
466 * @arg MDIOS_WAKEUP_EXTI_LINE
469 #define __HAL_MDIOS_WAKEUP_EXTI_ENABLE_RISING_FALLING_EDGE(__EXTI_LINE__) (EXTI->RTSR2 |= (__EXTI_LINE__));\
470 (EXTI->FTSR2 |= (__EXTI_LINE__))
473 * @brief Generates a Software interrupt on selected EXTI line.
474 * @param __EXTI_LINE__: specifies the MDIOS WAKEUP EXTI sources to be disabled.
475 * This parameter can be:
476 * @arg MDIOS_WAKEUP_EXTI_LINE
479 #define __HAL_MDIOS_WAKEUP_EXTI_GENERATE_SWIT(__EXTI_LINE__) (EXTI->SWIER2 |= (__EXTI_LINE__))
485 /* Exported functions --------------------------------------------------------*/
486 /** @defgroup MDIOS_Exported_Functions MDIOS Exported Functions
490 /** @addtogroup MDIOS_Exported_Functions_Group1
493 HAL_StatusTypeDef
HAL_MDIOS_Init(MDIOS_HandleTypeDef
*hmdios
);
494 HAL_StatusTypeDef
HAL_MDIOS_DeInit(MDIOS_HandleTypeDef
*hmdios
);
495 void HAL_MDIOS_MspInit(MDIOS_HandleTypeDef
*hmdios
);
496 void HAL_MDIOS_MspDeInit(MDIOS_HandleTypeDef
*hmdios
);
498 /* Callbacks Register/UnRegister functions ***********************************/
499 #if (USE_HAL_MDIOS_REGISTER_CALLBACKS == 1)
500 HAL_StatusTypeDef
HAL_MDIOS_RegisterCallback(MDIOS_HandleTypeDef
*hmdios
, HAL_MDIOS_CallbackIDTypeDef CallbackID
, pMDIOS_CallbackTypeDef pCallback
);
501 HAL_StatusTypeDef
HAL_MDIOS_UnRegisterCallback(MDIOS_HandleTypeDef
*hmdios
, HAL_MDIOS_CallbackIDTypeDef CallbackID
);
502 #endif /* USE_HAL_MDIOS_REGISTER_CALLBACKS */
507 /** @addtogroup MDIOS_Exported_Functions_Group2
510 HAL_StatusTypeDef
HAL_MDIOS_WriteReg(MDIOS_HandleTypeDef
*hmdios
, uint32_t RegNum
, uint16_t Data
);
511 HAL_StatusTypeDef
HAL_MDIOS_ReadReg(MDIOS_HandleTypeDef
*hmdios
, uint32_t RegNum
, uint16_t *pData
);
513 uint32_t HAL_MDIOS_GetWrittenRegAddress(MDIOS_HandleTypeDef
*hmdios
);
514 uint32_t HAL_MDIOS_GetReadRegAddress(MDIOS_HandleTypeDef
*hmdios
);
515 HAL_StatusTypeDef
HAL_MDIOS_ClearWriteRegAddress(MDIOS_HandleTypeDef
*hmdios
, uint32_t RegNum
);
516 HAL_StatusTypeDef
HAL_MDIOS_ClearReadRegAddress(MDIOS_HandleTypeDef
*hmdios
, uint32_t RegNum
);
518 HAL_StatusTypeDef
HAL_MDIOS_EnableEvents(MDIOS_HandleTypeDef
*hmdios
);
519 void HAL_MDIOS_IRQHandler(MDIOS_HandleTypeDef
*hmdios
);
520 void HAL_MDIOS_WriteCpltCallback(MDIOS_HandleTypeDef
*hmdios
);
521 void HAL_MDIOS_ReadCpltCallback(MDIOS_HandleTypeDef
*hmdios
);
522 void HAL_MDIOS_ErrorCallback(MDIOS_HandleTypeDef
*hmdios
);
523 void HAL_MDIOS_WakeUpCallback(MDIOS_HandleTypeDef
*hmdios
);
528 /** @addtogroup MDIOS_Exported_Functions_Group3
531 uint32_t HAL_MDIOS_GetError(MDIOS_HandleTypeDef
*hmdios
);
532 HAL_MDIOS_StateTypeDef
HAL_MDIOS_GetState(MDIOS_HandleTypeDef
*hmdios
);
541 /* Private types -------------------------------------------------------------*/
542 /** @defgroup MDIOS_Private_Types MDIOS Private Types
550 /* Private variables ---------------------------------------------------------*/
551 /** @defgroup MDIOS_Private_Variables MDIOS Private Variables
559 /* Private constants ---------------------------------------------------------*/
560 /** @defgroup MDIOS_Private_Constants MDIOS Private Constants
568 /* Private macros ------------------------------------------------------------*/
569 /** @defgroup MDIOS_Private_Macros MDIOS Private Macros
573 #define IS_MDIOS_PORTADDRESS(__ADDR__) ((__ADDR__) < 32U)
575 #define IS_MDIOS_REGISTER(__REGISTER__) ((__REGISTER__) < 32U)
577 #define IS_MDIOS_PREAMBLECHECK(__PREAMBLECHECK__) (((__PREAMBLECHECK__) == MDIOS_PREAMBLE_CHECK_ENABLE) || \
578 ((__PREAMBLECHECK__) == MDIOS_PREAMBLE_CHECK_DISABLE))
584 /* Private functions ---------------------------------------------------------*/
585 /** @defgroup MDIOS_Private_Functions MDIOS Private Functions
608 #endif /* STM32H7xx_HAL_MDIOS_H */
610 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/