stm32f7xx_hal_mdios.h
Go to the documentation of this file.
1 
20 /* Define to prevent recursive inclusion -------------------------------------*/
21 #ifndef __STM32F7xx_HAL_MDIOS_H
22 #define __STM32F7xx_HAL_MDIOS_H
23 
24 #ifdef __cplusplus
25  extern "C" {
26 #endif
27 
28 /* Includes ------------------------------------------------------------------*/
29 #include "stm32f7xx_hal_def.h"
30 
31 #if defined (MDIOS)
32 
41 /* Exported types ------------------------------------------------------------*/
50 typedef enum
51 {
52  HAL_MDIOS_STATE_RESET = 0x00U,
53  HAL_MDIOS_STATE_READY = 0x01U,
54  HAL_MDIOS_STATE_BUSY = 0x02U,
55  HAL_MDIOS_STATE_ERROR = 0x04U
56 }HAL_MDIOS_StateTypeDef;
57 
66 typedef struct
67 {
68  uint32_t PortAddress;
70  uint32_t PreambleCheck;
72 }MDIOS_InitTypeDef;
73 
82 #if ( USE_HAL_MDIOS_REGISTER_CALLBACKS == 1 )
83 typedef struct __MDIOS_HandleTypeDef
84 #else
85 typedef struct
86 #endif /* USE_HAL_MDIOS_REGISTER_CALLBACKS */
87 {
88  MDIOS_TypeDef *Instance;
90  MDIOS_InitTypeDef Init;
92  __IO HAL_MDIOS_StateTypeDef State;
94  HAL_LockTypeDef Lock;
96 #if (USE_HAL_MDIOS_REGISTER_CALLBACKS == 1)
97 
98  void (* WriteCpltCallback) ( struct __MDIOS_HandleTypeDef * hmdios);
99  void (* ReadCpltCallback) ( struct __MDIOS_HandleTypeDef * hmdios);
100  void (* ErrorCallback) ( struct __MDIOS_HandleTypeDef * hmdios);
101  void (* WakeUpCallback) ( struct __MDIOS_HandleTypeDef * hmdios);
102  void (* MspInitCallback) ( struct __MDIOS_HandleTypeDef * hmdios);
103  void (* MspDeInitCallback) ( struct __MDIOS_HandleTypeDef * hmdios);
105 #endif /* USE_HAL_MDIOS_REGISTER_CALLBACKS */
106 
107 }MDIOS_HandleTypeDef;
108 
109 #if ( USE_HAL_MDIOS_REGISTER_CALLBACKS == 1)
110 
113 typedef enum
114 {
115  HAL_MDIOS_MSPINIT_CB_ID = 0x00U,
116  HAL_MDIOS_MSPDEINIT_CB_ID = 0x01U,
117  HAL_MDIOS_WRITE_COMPLETE_CB_ID = 0x02U,
118  HAL_MDIOS_READ_COMPLETE_CB_ID = 0x03U,
119  HAL_MDIOS_ERROR_CB_ID = 0x04U,
120  HAL_MDIOS_WAKEUP_CB_ID = 0x05U
121 }HAL_MDIOS_CallbackIDTypeDef;
122 
126 typedef void (*pMDIOS_CallbackTypeDef)(MDIOS_HandleTypeDef * hmdios);
128 #endif /* USE_HAL_MDIOS_REGISTER_CALLBACKS */
129 
138 /* Exported constants --------------------------------------------------------*/
146 #define MDIOS_PREAMBLE_CHECK_ENABLE ((uint32_t)0x00000000U)
147 #define MDIOS_PREAMBLE_CHECK_DISABLE MDIOS_CR_DPC
148 
155 #define MDIOS_REG0 ((uint32_t)0x00000000U)
156 #define MDIOS_REG1 ((uint32_t)0x00000001U)
157 #define MDIOS_REG2 ((uint32_t)0x00000002U)
158 #define MDIOS_REG3 ((uint32_t)0x00000003U)
159 #define MDIOS_REG4 ((uint32_t)0x00000004U)
160 #define MDIOS_REG5 ((uint32_t)0x00000005U)
161 #define MDIOS_REG6 ((uint32_t)0x00000006U)
162 #define MDIOS_REG7 ((uint32_t)0x00000007U)
163 #define MDIOS_REG8 ((uint32_t)0x00000008U)
164 #define MDIOS_REG9 ((uint32_t)0x00000009U)
165 #define MDIOS_REG10 ((uint32_t)0x0000000AU)
166 #define MDIOS_REG11 ((uint32_t)0x0000000BU)
167 #define MDIOS_REG12 ((uint32_t)0x0000000CU)
168 #define MDIOS_REG13 ((uint32_t)0x0000000DU)
169 #define MDIOS_REG14 ((uint32_t)0x0000000EU)
170 #define MDIOS_REG15 ((uint32_t)0x0000000FU)
171 #define MDIOS_REG16 ((uint32_t)0x00000010U)
172 #define MDIOS_REG17 ((uint32_t)0x00000011U)
173 #define MDIOS_REG18 ((uint32_t)0x00000012U)
174 #define MDIOS_REG19 ((uint32_t)0x00000013U)
175 #define MDIOS_REG20 ((uint32_t)0x00000014U)
176 #define MDIOS_REG21 ((uint32_t)0x00000015U)
177 #define MDIOS_REG22 ((uint32_t)0x00000016U)
178 #define MDIOS_REG23 ((uint32_t)0x00000017U)
179 #define MDIOS_REG24 ((uint32_t)0x00000018U)
180 #define MDIOS_REG25 ((uint32_t)0x00000019U)
181 #define MDIOS_REG26 ((uint32_t)0x0000001AU)
182 #define MDIOS_REG27 ((uint32_t)0x0000001BU)
183 #define MDIOS_REG28 ((uint32_t)0x0000001CU)
184 #define MDIOS_REG29 ((uint32_t)0x0000001DU)
185 #define MDIOS_REG30 ((uint32_t)0x0000001EU)
186 #define MDIOS_REG31 ((uint32_t)0x0000001FU)
187 
194 #define MDIOS_REG0_FLAG ((uint32_t)0x00000001U)
195 #define MDIOS_REG1_FLAG ((uint32_t)0x00000002U)
196 #define MDIOS_REG2_FLAG ((uint32_t)0x00000004U)
197 #define MDIOS_REG3_FLAG ((uint32_t)0x00000008U)
198 #define MDIOS_REG4_FLAG ((uint32_t)0x00000010U)
199 #define MDIOS_REG5_FLAG ((uint32_t)0x00000020U)
200 #define MDIOS_REG6_FLAG ((uint32_t)0x00000040U)
201 #define MDIOS_REG7_FLAG ((uint32_t)0x00000080U)
202 #define MDIOS_REG8_FLAG ((uint32_t)0x00000100U)
203 #define MDIOS_REG9_FLAG ((uint32_t)0x00000200U)
204 #define MDIOS_REG10_FLAG ((uint32_t)0x00000400U)
205 #define MDIOS_REG11_FLAG ((uint32_t)0x00000800U)
206 #define MDIOS_REG12_FLAG ((uint32_t)0x00001000U)
207 #define MDIOS_REG13_FLAG ((uint32_t)0x00002000U)
208 #define MDIOS_REG14_FLAG ((uint32_t)0x00004000U)
209 #define MDIOS_REG15_FLAG ((uint32_t)0x00008000U)
210 #define MDIOS_REG16_FLAG ((uint32_t)0x00010000U)
211 #define MDIOS_REG17_FLAG ((uint32_t)0x00020000U)
212 #define MDIOS_REG18_FLAG ((uint32_t)0x00040000U)
213 #define MDIOS_REG19_FLAG ((uint32_t)0x00080000U)
214 #define MDIOS_REG20_FLAG ((uint32_t)0x00100000U)
215 #define MDIOS_REG21_FLAG ((uint32_t)0x00200000U)
216 #define MDIOS_REG22_FLAG ((uint32_t)0x00400000U)
217 #define MDIOS_REG23_FLAG ((uint32_t)0x00800000U)
218 #define MDIOS_REG24_FLAG ((uint32_t)0x01000000U)
219 #define MDIOS_REG25_FLAG ((uint32_t)0x02000000U)
220 #define MDIOS_REG26_FLAG ((uint32_t)0x04000000U)
221 #define MDIOS_REG27_FLAG ((uint32_t)0x08000000U)
222 #define MDIOS_REG28_FLAG ((uint32_t)0x10000000U)
223 #define MDIOS_REG29_FLAG ((uint32_t)0x20000000U)
224 #define MDIOS_REG30_FLAG ((uint32_t)0x40000000U)
225 #define MDIOS_REG31_FLAG ((uint32_t)0x80000000U)
226 #define MDIOS_ALLREG_FLAG ((uint32_t)0xFFFFFFFFU)
227 
234 #define MDIOS_IT_WRITE MDIOS_CR_WRIE
235 #define MDIOS_IT_READ MDIOS_CR_RDIE
236 #define MDIOS_IT_ERROR MDIOS_CR_EIE
237 
244 #define MDIOS_TURNAROUND_ERROR_FLAG MDIOS_SR_TERF
245 #define MDIOS_START_ERROR_FLAG MDIOS_SR_SERF
246 #define MDIOS_PREAMBLE_ERROR_FLAG MDIOS_SR_PERF
247 
254 #define MDIOS_WAKEUP_EXTI_LINE ((uint32_t)0x01000000) /* !< EXTI Line 24 */
255 
262 /* Exported macros -----------------------------------------------------------*/
271 #if (USE_HAL_MDIOS_REGISTER_CALLBACKS == 1)
272 #define __HAL_MDIOS_RESET_HANDLE_STATE(__HANDLE__) do{ \
273  (__HANDLE__)->State = HAL_MDIOS_STATE_RESET; \
274  (__HANDLE__)->MspInitCallback = NULL; \
275  (__HANDLE__)->MspDeInitCallback = NULL; \
276  } while(0)
277 #else
278 #define __HAL_MDIOS_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_MDIOS_STATE_RESET)
279 #endif /* USE_HAL_MDIOS_REGISTER_CALLBACKS */
280 
286 #define __HAL_MDIOS_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= MDIOS_CR_EN)
287 #define __HAL_MDIOS_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~MDIOS_CR_EN)
288 
289 
300 #define __HAL_MDIOS_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
301 
312 #define __HAL_MDIOS_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
313 
319 #define __HAL_MDIOS_GET_WRITE_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->WRFR & (__FLAG__))
320 
326 #define __HAL_MDIOS_GET_READ_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->RDFR & (__FLAG__))
327 
337 #define __HAL_MDIOS_GET_ERROR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR & (__FLAG__))
338 
348 #define __HAL_MDIOS_CLEAR_ERROR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->CLRFR) |= (__FLAG__)
349 
360 #define __HAL_MDIOS_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR & (__INTERRUPT__))
361 
366 #define __HAL_MDIOS_WAKEUP_EXTI_ENABLE_IT() (EXTI->IMR |= (MDIOS_WAKEUP_EXTI_LINE))
367 
372 #define __HAL_MDIOS_WAKEUP_EXTI_DISABLE_IT() (EXTI->IMR &= ~(MDIOS_WAKEUP_EXTI_LINE))
373 
378 #define __HAL_MDIOS_WAKEUP_EXTI_ENABLE_EVENT() (EXTI->EMR |= (MDIOS_WAKEUP_EXTI_LINE))
379 
384 #define __HAL_MDIOS_WAKEUP_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(MDIOS_WAKEUP_EXTI_LINE))
385 
390 #define __HAL_MDIOS_WAKEUP_EXTI_GET_FLAG() (EXTI->PR & (MDIOS_WAKEUP_EXTI_LINE))
391 
396 #define __HAL_MDIOS_WAKEUP_EXTI_CLEAR_FLAG() (EXTI->PR = (MDIOS_WAKEUP_EXTI_LINE))
397 
402 #define __HAL_MDIOS_WAKEUP_EXTI_ENABLE_RISING_EDGE_TRIGGER() EXTI->RTSR |= MDIOS_WAKEUP_EXTI_LINE
403 
408 #define __HAL_MDIOS_WAKEUP_EXTI_DISABLE_RISING_EDGE_TRIGGER() EXTI->RTSR &= ~(MDIOS_WAKEUP_EXTI_LINE)
409 
414 #define __HAL_MDIOS_WAKEUP_EXTI_ENABLE_FALLING_EDGE_TRIGGER() EXTI->FTSR |= (MDIOS_WAKEUP_EXTI_LINE)
415 
420 #define __HAL_MDIOS_WAKEUP_EXTI_DISABLE_FALLING_EDGE_TRIGGER() EXTI->FTSR &= ~(MDIOS_WAKEUP_EXTI_LINE)
421 
426 #define __HAL_MDIOS_WAKEUP_EXTI_ENABLE_FALLINGRISING_TRIGGER() EXTI->RTSR |= MDIOS_WAKEUP_EXTI_LINE;\
427  EXTI->FTSR |= MDIOS_WAKEUP_EXTI_LINE
428 
433 #define __HAL_MDIOS_WAKEUP_EXTI_DISABLE_FALLINGRISING_TRIGGER() EXTI->RTSR &= ~(MDIOS_WAKEUP_EXTI_LINE);\
434  EXTI->FTSR &= ~(MDIOS_WAKEUP_EXTI_LINE)
435 
439 #define __HAL_MDIOS_WAKEUP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= (MDIOS_WAKEUP_EXTI_LINE))
440 
445 /* Exported functions --------------------------------------------------------*/
453 HAL_StatusTypeDef HAL_MDIOS_Init(MDIOS_HandleTypeDef *hmdios);
454 HAL_StatusTypeDef HAL_MDIOS_DeInit(MDIOS_HandleTypeDef *hmdios);
455 void HAL_MDIOS_MspInit(MDIOS_HandleTypeDef *hmdios);
456 void HAL_MDIOS_MspDeInit(MDIOS_HandleTypeDef *hmdios);
457 /* Callbacks Register/UnRegister functions ***********************************/
458 #if (USE_HAL_MDIOS_REGISTER_CALLBACKS == 1)
459 HAL_StatusTypeDef HAL_MDIOS_RegisterCallback(MDIOS_HandleTypeDef *hmdios, HAL_MDIOS_CallbackIDTypeDef CallbackID, pMDIOS_CallbackTypeDef pCallback);
460 HAL_StatusTypeDef HAL_MDIOS_UnRegisterCallback(MDIOS_HandleTypeDef *hmdios, HAL_MDIOS_CallbackIDTypeDef CallbackID);
461 #endif /* USE_HAL_MDIOS_REGISTER_CALLBACKS */
462 
469 HAL_StatusTypeDef HAL_MDIOS_WriteReg(MDIOS_HandleTypeDef *hmdios, uint32_t RegNum, uint16_t Data);
470 HAL_StatusTypeDef HAL_MDIOS_ReadReg(MDIOS_HandleTypeDef *hmdios, uint32_t RegNum, uint16_t *pData);
471 
472 uint32_t HAL_MDIOS_GetWrittenRegAddress(MDIOS_HandleTypeDef *hmdios);
473 uint32_t HAL_MDIOS_GetReadRegAddress(MDIOS_HandleTypeDef *hmdios);
474 HAL_StatusTypeDef HAL_MDIOS_ClearWriteRegAddress(MDIOS_HandleTypeDef *hmdios, uint32_t RegNum);
475 HAL_StatusTypeDef HAL_MDIOS_ClearReadRegAddress(MDIOS_HandleTypeDef *hmdios, uint32_t RegNum);
476 
477 HAL_StatusTypeDef HAL_MDIOS_EnableEvents(MDIOS_HandleTypeDef *hmdios);
478 void HAL_MDIOS_IRQHandler(MDIOS_HandleTypeDef *hmdios);
479 void HAL_MDIOS_WriteCpltCallback(MDIOS_HandleTypeDef *hmdios);
480 void HAL_MDIOS_ReadCpltCallback(MDIOS_HandleTypeDef *hmdios);
481 void HAL_MDIOS_ErrorCallback(MDIOS_HandleTypeDef *hmdios);
482 void HAL_MDIOS_WakeUpCallback(MDIOS_HandleTypeDef *hmdios);
490 uint32_t HAL_MDIOS_GetError(MDIOS_HandleTypeDef *hmdios);
491 HAL_MDIOS_StateTypeDef HAL_MDIOS_GetState(MDIOS_HandleTypeDef *hmdios);
500 /* Private types -------------------------------------------------------------*/
509 /* Private variables ---------------------------------------------------------*/
518 /* Private constants ---------------------------------------------------------*/
527 /* Private macros ------------------------------------------------------------*/
532 #define IS_MDIOS_PORTADDRESS(__ADDR__) ((__ADDR__) < 32)
533 
534 #define IS_MDIOS_REGISTER(__REGISTER__) ((__REGISTER__) < 32)
535 
536 #define IS_MDIOS_PREAMBLECHECK(__PREAMBLECHECK__) (((__PREAMBLECHECK__) == MDIOS_PREAMBLE_CHECK_ENABLE) || \
537  ((__PREAMBLECHECK__) == MDIOS_PREAMBLE_CHECK_DISABLE))
538 
543 /* Private functions ---------------------------------------------------------*/
561 #endif /* MDIOS */
562 
563 #ifdef __cplusplus
564 }
565 #endif
566 
567 #endif /* __STM32F7xx_HAL_MDIOS_H */
568 
569 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
__IO
#define __IO
Definition: imxrt1050/imxrt1050-evkb/CMSIS/core_cm7.h:237
Init
napi_value Init(napi_env env, napi_value exports)
Definition: porcupine/demo/c/pvrecorder/node/pv_recorder_napi.c:197
HAL_StatusTypeDef
HAL_StatusTypeDef
HAL Status structures definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:40
MDIOS_TypeDef
MDIOS.
Definition: stm32f769xx.h:1212
HAL_LockTypeDef
HAL_LockTypeDef
HAL Lock structures definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:51
stm32f7xx_hal_def.h
This file contains HAL common defines, enumeration, macros and structures definitions.


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:53