Merge pull request #10592 from iNavFlight/MrD_Update-parameter-description
[inav.git] / lib / main / STM32F7 / Drivers / STM32F7xx_HAL_Driver / Inc / stm32f7xx_hal_spdifrx.h
blob72bc3157a829acadaa91463c26199c452edc35be
1 /**
2 ******************************************************************************
3 * @file stm32f7xx_hal_spdifrx.h
4 * @author MCD Application Team
5 * @version V1.2.2
6 * @date 14-April-2017
7 * @brief Header file of SPDIFRX HAL module.
8 ******************************************************************************
9 * @attention
11 * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
13 * Redistribution and use in source and binary forms, with or without modification,
14 * are permitted provided that the following conditions are met:
15 * 1. Redistributions of source code must retain the above copyright notice,
16 * this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 ******************************************************************************
36 */
38 /* Define to prevent recursive inclusion -------------------------------------*/
39 #ifndef __STM32F7xx_HAL_SPDIFRX_H
40 #define __STM32F7xx_HAL_SPDIFRX_H
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
46 /* Includes ------------------------------------------------------------------*/
47 #include "stm32f7xx_hal_def.h"
49 #if defined (SPDIFRX)
51 /** @addtogroup STM32F7xx_HAL_Driver
52 * @{
55 /** @addtogroup SPDIFRX
56 * @{
57 */
59 /* Exported types ------------------------------------------------------------*/
60 /** @defgroup SPDIFRX_Exported_Types SPDIFRX Exported Types
61 * @{
64 /**
65 * @brief SPDIFRX Init structure definition
67 typedef struct
69 uint32_t InputSelection; /*!< Specifies the SPDIF input selection.
70 This parameter can be a value of @ref SPDIFRX_Input_Selection */
72 uint32_t Retries; /*!< Specifies the Maximum allowed re-tries during synchronization phase.
73 This parameter can be a value of @ref SPDIFRX_Max_Retries */
75 uint32_t WaitForActivity; /*!< Specifies the wait for activity on SPDIF selected input.
76 This parameter can be a value of @ref SPDIFRX_Wait_For_Activity. */
78 uint32_t ChannelSelection; /*!< Specifies whether the control flow will take the channel status from channel A or B.
79 This parameter can be a value of @ref SPDIFRX_Channel_Selection */
81 uint32_t DataFormat; /*!< Specifies the Data samples format (LSB, MSB, ...).
82 This parameter can be a value of @ref SPDIFRX_Data_Format */
84 uint32_t StereoMode; /*!< Specifies whether the peripheral is in stereo or mono mode.
85 This parameter can be a value of @ref SPDIFRX_Stereo_Mode */
87 uint32_t PreambleTypeMask; /*!< Specifies whether The preamble type bits are copied or not into the received frame.
88 This parameter can be a value of @ref SPDIFRX_PT_Mask */
90 uint32_t ChannelStatusMask; /*!< Specifies whether the channel status and user bits are copied or not into the received frame.
91 This parameter can be a value of @ref SPDIFRX_ChannelStatus_Mask */
93 uint32_t ValidityBitMask; /*!< Specifies whether the validity bit is copied or not into the received frame.
94 This parameter can be a value of @ref SPDIFRX_V_Mask */
96 uint32_t ParityErrorMask; /*!< Specifies whether the parity error bit is copied or not into the received frame.
97 This parameter can be a value of @ref SPDIFRX_PE_Mask */
99 }SPDIFRX_InitTypeDef;
101 /**
102 * @brief SPDIFRX SetDataFormat structure definition
104 typedef struct
106 uint32_t DataFormat; /*!< Specifies the Data samples format (LSB, MSB, ...).
107 This parameter can be a value of @ref SPDIFRX_Data_Format */
109 uint32_t StereoMode; /*!< Specifies whether the peripheral is in stereo or mono mode.
110 This parameter can be a value of @ref SPDIFRX_Stereo_Mode */
112 uint32_t PreambleTypeMask; /*!< Specifies whether The preamble type bits are copied or not into the received frame.
113 This parameter can be a value of @ref SPDIFRX_PT_Mask */
115 uint32_t ChannelStatusMask; /*!< Specifies whether the channel status and user bits are copied or not into the received frame.
116 This parameter can be a value of @ref SPDIFRX_ChannelStatus_Mask */
118 uint32_t ValidityBitMask; /*!< Specifies whether the validity bit is copied or not into the received frame.
119 This parameter can be a value of @ref SPDIFRX_V_Mask */
121 uint32_t ParityErrorMask; /*!< Specifies whether the parity error bit is copied or not into the received frame.
122 This parameter can be a value of @ref SPDIFRX_PE_Mask */
124 }SPDIFRX_SetDataFormatTypeDef;
126 /**
127 * @brief HAL State structures definition
129 typedef enum
131 HAL_SPDIFRX_STATE_RESET = 0x00U, /*!< SPDIFRX not yet initialized or disabled */
132 HAL_SPDIFRX_STATE_READY = 0x01U, /*!< SPDIFRX initialized and ready for use */
133 HAL_SPDIFRX_STATE_BUSY = 0x02U, /*!< SPDIFRX internal process is ongoing */
134 HAL_SPDIFRX_STATE_BUSY_RX = 0x03U, /*!< SPDIFRX internal Data Flow RX process is ongoing */
135 HAL_SPDIFRX_STATE_BUSY_CX = 0x04U, /*!< SPDIFRX internal Control Flow RX process is ongoing */
136 HAL_SPDIFRX_STATE_ERROR = 0x07U /*!< SPDIFRX error state */
137 }HAL_SPDIFRX_StateTypeDef;
139 /**
140 * @brief SPDIFRX handle Structure definition
142 typedef struct
144 SPDIFRX_TypeDef *Instance; /* SPDIFRX registers base address */
146 SPDIFRX_InitTypeDef Init; /* SPDIFRX communication parameters */
148 uint32_t *pRxBuffPtr; /* Pointer to SPDIFRX Rx transfer buffer */
150 uint32_t *pCsBuffPtr; /* Pointer to SPDIFRX Cx transfer buffer */
152 __IO uint16_t RxXferSize; /* SPDIFRX Rx transfer size */
154 __IO uint16_t RxXferCount; /* SPDIFRX Rx transfer counter
155 (This field is initialized at the
156 same value as transfer size at the
157 beginning of the transfer and
158 decremented when a sample is received.
159 NbSamplesReceived = RxBufferSize-RxBufferCount) */
161 __IO uint16_t CsXferSize; /* SPDIFRX Rx transfer size */
163 __IO uint16_t CsXferCount; /* SPDIFRX Rx transfer counter
164 (This field is initialized at the
165 same value as transfer size at the
166 beginning of the transfer and
167 decremented when a sample is received.
168 NbSamplesReceived = RxBufferSize-RxBufferCount) */
170 DMA_HandleTypeDef *hdmaCsRx; /* SPDIFRX EC60958_channel_status and user_information DMA handle parameters */
172 DMA_HandleTypeDef *hdmaDrRx; /* SPDIFRX Rx DMA handle parameters */
174 __IO HAL_LockTypeDef Lock; /* SPDIFRX locking object */
176 __IO HAL_SPDIFRX_StateTypeDef State; /* SPDIFRX communication state */
178 __IO uint32_t ErrorCode; /* SPDIFRX Error code */
180 }SPDIFRX_HandleTypeDef;
182 * @}
185 /* Exported constants --------------------------------------------------------*/
186 /** @defgroup SPDIFRX_Exported_Constants SPDIFRX Exported Constants
187 * @{
189 /** @defgroup SPDIFRX_ErrorCode SPDIFRX Error Code
190 * @{
192 #define HAL_SPDIFRX_ERROR_NONE ((uint32_t)0x00000000U) /*!< No error */
193 #define HAL_SPDIFRX_ERROR_TIMEOUT ((uint32_t)0x00000001U) /*!< Timeout error */
194 #define HAL_SPDIFRX_ERROR_OVR ((uint32_t)0x00000002U) /*!< OVR error */
195 #define HAL_SPDIFRX_ERROR_PE ((uint32_t)0x00000004U) /*!< Parity error */
196 #define HAL_SPDIFRX_ERROR_DMA ((uint32_t)0x00000008U) /*!< DMA transfer error */
197 #define HAL_SPDIFRX_ERROR_UNKNOWN ((uint32_t)0x00000010U) /*!< Unknown Error error */
199 * @}
202 /** @defgroup SPDIFRX_Input_Selection SPDIFRX Input Selection
203 * @{
205 #define SPDIFRX_INPUT_IN0 ((uint32_t)0x00000000U)
206 #define SPDIFRX_INPUT_IN1 ((uint32_t)0x00010000U)
207 #define SPDIFRX_INPUT_IN2 ((uint32_t)0x00020000U)
208 #define SPDIFRX_INPUT_IN3 ((uint32_t)0x00030000U)
210 * @}
213 /** @defgroup SPDIFRX_Max_Retries SPDIFRX Maximum Retries
214 * @{
216 #define SPDIFRX_MAXRETRIES_NONE ((uint32_t)0x00000000U)
217 #define SPDIFRX_MAXRETRIES_3 ((uint32_t)0x00001000U)
218 #define SPDIFRX_MAXRETRIES_15 ((uint32_t)0x00002000U)
219 #define SPDIFRX_MAXRETRIES_63 ((uint32_t)0x00003000U)
221 * @}
224 /** @defgroup SPDIFRX_Wait_For_Activity SPDIFRX Wait For Activity
225 * @{
227 #define SPDIFRX_WAITFORACTIVITY_OFF ((uint32_t)0x00000000U)
228 #define SPDIFRX_WAITFORACTIVITY_ON ((uint32_t)SPDIFRX_CR_WFA)
230 * @}
233 /** @defgroup SPDIFRX_PT_Mask SPDIFRX Preamble Type Mask
234 * @{
236 #define SPDIFRX_PREAMBLETYPEMASK_OFF ((uint32_t)0x00000000U)
237 #define SPDIFRX_PREAMBLETYPEMASK_ON ((uint32_t)SPDIFRX_CR_PTMSK)
239 * @}
242 /** @defgroup SPDIFRX_ChannelStatus_Mask SPDIFRX Channel Status Mask
243 * @{
245 #define SPDIFRX_CHANNELSTATUS_OFF ((uint32_t)0x00000000U) /* The channel status and user bits are copied into the SPDIF_DR */
246 #define SPDIFRX_CHANNELSTATUS_ON ((uint32_t)SPDIFRX_CR_CUMSK) /* The channel status and user bits are not copied into the SPDIF_DR, zeros are written instead*/
248 * @}
251 /** @defgroup SPDIFRX_V_Mask SPDIFRX Validity Mask
252 * @{
254 #define SPDIFRX_VALIDITYMASK_OFF ((uint32_t)0x00000000U)
255 #define SPDIFRX_VALIDITYMASK_ON ((uint32_t)SPDIFRX_CR_VMSK)
257 * @}
260 /** @defgroup SPDIFRX_PE_Mask SPDIFRX Parity Error Mask
261 * @{
263 #define SPDIFRX_PARITYERRORMASK_OFF ((uint32_t)0x00000000U)
264 #define SPDIFRX_PARITYERRORMASK_ON ((uint32_t)SPDIFRX_CR_PMSK)
266 * @}
269 /** @defgroup SPDIFRX_Channel_Selection SPDIFRX Channel Selection
270 * @{
272 #define SPDIFRX_CHANNEL_A ((uint32_t)0x00000000U)
273 #define SPDIFRX_CHANNEL_B ((uint32_t)SPDIFRX_CR_CHSEL)
275 * @}
278 /** @defgroup SPDIFRX_Data_Format SPDIFRX Data Format
279 * @{
281 #define SPDIFRX_DATAFORMAT_LSB ((uint32_t)0x00000000U)
282 #define SPDIFRX_DATAFORMAT_MSB ((uint32_t)0x00000010U)
283 #define SPDIFRX_DATAFORMAT_32BITS ((uint32_t)0x00000020U)
285 * @}
288 /** @defgroup SPDIFRX_Stereo_Mode SPDIFRX Stereo Mode
289 * @{
291 #define SPDIFRX_STEREOMODE_DISABLE ((uint32_t)0x00000000U)
292 #define SPDIFRX_STEREOMODE_ENABLE ((uint32_t)SPDIFRX_CR_RXSTEO)
294 * @}
297 /** @defgroup SPDIFRX_State SPDIFRX State
298 * @{
301 #define SPDIFRX_STATE_IDLE ((uint32_t)0xFFFFFFFCU)
302 #define SPDIFRX_STATE_SYNC ((uint32_t)0x00000001U)
303 #define SPDIFRX_STATE_RCV ((uint32_t)SPDIFRX_CR_SPDIFEN)
305 * @}
308 /** @defgroup SPDIFRX_Interrupts_Definition SPDIFRX Interrupts Definition
309 * @{
311 #define SPDIFRX_IT_RXNE ((uint32_t)SPDIFRX_IMR_RXNEIE)
312 #define SPDIFRX_IT_CSRNE ((uint32_t)SPDIFRX_IMR_CSRNEIE)
313 #define SPDIFRX_IT_PERRIE ((uint32_t)SPDIFRX_IMR_PERRIE)
314 #define SPDIFRX_IT_OVRIE ((uint32_t)SPDIFRX_IMR_OVRIE)
315 #define SPDIFRX_IT_SBLKIE ((uint32_t)SPDIFRX_IMR_SBLKIE)
316 #define SPDIFRX_IT_SYNCDIE ((uint32_t)SPDIFRX_IMR_SYNCDIE)
317 #define SPDIFRX_IT_IFEIE ((uint32_t)SPDIFRX_IMR_IFEIE )
319 * @}
322 /** @defgroup SPDIFRX_Flags_Definition SPDIFRX Flags Definition
323 * @{
325 #define SPDIFRX_FLAG_RXNE ((uint32_t)SPDIFRX_SR_RXNE)
326 #define SPDIFRX_FLAG_CSRNE ((uint32_t)SPDIFRX_SR_CSRNE)
327 #define SPDIFRX_FLAG_PERR ((uint32_t)SPDIFRX_SR_PERR)
328 #define SPDIFRX_FLAG_OVR ((uint32_t)SPDIFRX_SR_OVR)
329 #define SPDIFRX_FLAG_SBD ((uint32_t)SPDIFRX_SR_SBD)
330 #define SPDIFRX_FLAG_SYNCD ((uint32_t)SPDIFRX_SR_SYNCD)
331 #define SPDIFRX_FLAG_FERR ((uint32_t)SPDIFRX_SR_FERR)
332 #define SPDIFRX_FLAG_SERR ((uint32_t)SPDIFRX_SR_SERR)
333 #define SPDIFRX_FLAG_TERR ((uint32_t)SPDIFRX_SR_TERR)
335 * @}
339 * @}
342 /* Exported macros -----------------------------------------------------------*/
343 /** @defgroup SPDIFRX_Exported_macros SPDIFRX Exported Macros
344 * @{
347 /** @brief Reset SPDIFRX handle state
348 * @param __HANDLE__: SPDIFRX handle.
349 * @retval None
351 #define __HAL_SPDIFRX_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = (uint16_t)SPDIFRX_CR_SPDIFEN)
353 /** @brief Disable the specified SPDIFRX peripheral (IDLE State).
354 * @param __HANDLE__: specifies the SPDIFRX Handle.
355 * @retval None
357 #define __HAL_SPDIFRX_IDLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= SPDIFRX_STATE_IDLE)
359 /** @brief Enable the specified SPDIFRX peripheral (SYNC State).
360 * @param __HANDLE__: specifies the SPDIFRX Handle.
361 * @retval None
363 #define __HAL_SPDIFRX_SYNC(__HANDLE__) ((__HANDLE__)->Instance->CR |= SPDIFRX_STATE_SYNC)
366 /** @brief Enable the specified SPDIFRX peripheral (RCV State).
367 * @param __HANDLE__: specifies the SPDIFRX Handle.
368 * @retval None
370 #define __HAL_SPDIFRX_RCV(__HANDLE__) ((__HANDLE__)->Instance->CR |= SPDIFRX_STATE_RCV)
373 /** @brief Enable or disable the specified SPDIFRX interrupts.
374 * @param __HANDLE__: specifies the SPDIFRX Handle.
375 * @param __INTERRUPT__: specifies the interrupt source to enable or disable.
376 * This parameter can be one of the following values:
377 * @arg SPDIFRX_IT_RXNE
378 * @arg SPDIFRX_IT_CSRNE
379 * @arg SPDIFRX_IT_PERRIE
380 * @arg SPDIFRX_IT_OVRIE
381 * @arg SPDIFRX_IT_SBLKIE
382 * @arg SPDIFRX_IT_SYNCDIE
383 * @arg SPDIFRX_IT_IFEIE
384 * @retval None
386 #define __HAL_SPDIFRX_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IMR |= (__INTERRUPT__))
387 #define __HAL_SPDIFRX_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IMR &= (uint16_t)(~(__INTERRUPT__)))
389 /** @brief Checks if the specified SPDIFRX interrupt source is enabled or disabled.
390 * @param __HANDLE__: specifies the SPDIFRX Handle.
391 * @param __INTERRUPT__: specifies the SPDIFRX interrupt source to check.
392 * This parameter can be one of the following values:
393 * @arg SPDIFRX_IT_RXNE
394 * @arg SPDIFRX_IT_CSRNE
395 * @arg SPDIFRX_IT_PERRIE
396 * @arg SPDIFRX_IT_OVRIE
397 * @arg SPDIFRX_IT_SBLKIE
398 * @arg SPDIFRX_IT_SYNCDIE
399 * @arg SPDIFRX_IT_IFEIE
400 * @retval The new state of __IT__ (TRUE or FALSE).
402 #define __HAL_SPDIFRX_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->IMR & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
404 /** @brief Checks whether the specified SPDIFRX flag is set or not.
405 * @param __HANDLE__: specifies the SPDIFRX Handle.
406 * @param __FLAG__: specifies the flag to check.
407 * This parameter can be one of the following values:
408 * @arg SPDIFRX_FLAG_RXNE
409 * @arg SPDIFRX_FLAG_CSRNE
410 * @arg SPDIFRX_FLAG_PERR
411 * @arg SPDIFRX_FLAG_OVR
412 * @arg SPDIFRX_FLAG_SBD
413 * @arg SPDIFRX_FLAG_SYNCD
414 * @arg SPDIFRX_FLAG_FERR
415 * @arg SPDIFRX_FLAG_SERR
416 * @arg SPDIFRX_FLAG_TERR
417 * @retval The new state of __FLAG__ (TRUE or FALSE).
419 #define __HAL_SPDIFRX_GET_FLAG(__HANDLE__, __FLAG__) ((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__))
421 /** @brief Clears the specified SPDIFRX SR flag, in setting the proper IFCR register bit.
422 * @param __HANDLE__: specifies the USART Handle.
423 * @param __IT_CLEAR__: specifies the interrupt clear register flag that needs to be set
424 * to clear the corresponding interrupt
425 * This parameter can be one of the following values:
426 * @arg SPDIFRX_FLAG_PERR
427 * @arg SPDIFRX_FLAG_OVR
428 * @arg SPDIFRX_SR_SBD
429 * @arg SPDIFRX_SR_SYNCD
430 * @retval None
432 #define __HAL_SPDIFRX_CLEAR_IT(__HANDLE__, __IT_CLEAR__) ((__HANDLE__)->Instance->IFCR = (uint32_t)(__IT_CLEAR__))
435 * @}
438 /* Exported functions --------------------------------------------------------*/
439 /** @addtogroup SPDIFRX_Exported_Functions
440 * @{
443 /** @addtogroup SPDIFRX_Exported_Functions_Group1
444 * @{
446 /* Initialization/de-initialization functions **********************************/
447 HAL_StatusTypeDef HAL_SPDIFRX_Init(SPDIFRX_HandleTypeDef *hspdif);
448 HAL_StatusTypeDef HAL_SPDIFRX_DeInit (SPDIFRX_HandleTypeDef *hspdif);
449 void HAL_SPDIFRX_MspInit(SPDIFRX_HandleTypeDef *hspdif);
450 void HAL_SPDIFRX_MspDeInit(SPDIFRX_HandleTypeDef *hspdif);
451 HAL_StatusTypeDef HAL_SPDIFRX_SetDataFormat(SPDIFRX_HandleTypeDef *hspdif, SPDIFRX_SetDataFormatTypeDef sDataFormat);
453 * @}
456 /** @addtogroup SPDIFRX_Exported_Functions_Group2
457 * @{
459 /* I/O operation functions ***************************************************/
460 /* Blocking mode: Polling */
461 HAL_StatusTypeDef HAL_SPDIFRX_ReceiveDataFlow(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size, uint32_t Timeout);
462 HAL_StatusTypeDef HAL_SPDIFRX_ReceiveControlFlow(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size, uint32_t Timeout);
464 /* Non-Blocking mode: Interrupt */
465 HAL_StatusTypeDef HAL_SPDIFRX_ReceiveControlFlow_IT(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size);
466 HAL_StatusTypeDef HAL_SPDIFRX_ReceiveDataFlow_IT(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size);
467 void HAL_SPDIFRX_IRQHandler(SPDIFRX_HandleTypeDef *hspdif);
469 /* Non-Blocking mode: DMA */
470 HAL_StatusTypeDef HAL_SPDIFRX_ReceiveControlFlow_DMA(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size);
471 HAL_StatusTypeDef HAL_SPDIFRX_ReceiveDataFlow_DMA(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size);
473 HAL_StatusTypeDef HAL_SPDIFRX_DMAStop(SPDIFRX_HandleTypeDef *hspdif);
475 /* Callbacks used in non blocking modes (Interrupt and DMA) *******************/
476 void HAL_SPDIFRX_RxHalfCpltCallback(SPDIFRX_HandleTypeDef *hspdif);
477 void HAL_SPDIFRX_RxCpltCallback(SPDIFRX_HandleTypeDef *hspdif);
478 void HAL_SPDIFRX_ErrorCallback(SPDIFRX_HandleTypeDef *hspdif);
479 void HAL_SPDIFRX_CxHalfCpltCallback(SPDIFRX_HandleTypeDef *hspdif);
480 void HAL_SPDIFRX_CxCpltCallback(SPDIFRX_HandleTypeDef *hspdif);
482 * @}
485 /** @addtogroup SPDIFRX_Exported_Functions_Group3
486 * @{
488 /* Peripheral Control and State functions ************************************/
489 HAL_SPDIFRX_StateTypeDef HAL_SPDIFRX_GetState(SPDIFRX_HandleTypeDef *hspdif);
490 uint32_t HAL_SPDIFRX_GetError(SPDIFRX_HandleTypeDef *hspdif);
492 * @}
496 * @}
498 /* Private types -------------------------------------------------------------*/
499 /* Private variables ---------------------------------------------------------*/
500 /* Private constants ---------------------------------------------------------*/
501 /* Private macros ------------------------------------------------------------*/
502 /** @defgroup SPDIFRX_Private_Macros SPDIFRX Private Macros
503 * @{
505 #define IS_SPDIFRX_INPUT_SELECT(INPUT) (((INPUT) == SPDIFRX_INPUT_IN1) || \
506 ((INPUT) == SPDIFRX_INPUT_IN2) || \
507 ((INPUT) == SPDIFRX_INPUT_IN3) || \
508 ((INPUT) == SPDIFRX_INPUT_IN0))
509 #define IS_SPDIFRX_MAX_RETRIES(RET) (((RET) == SPDIFRX_MAXRETRIES_NONE) || \
510 ((RET) == SPDIFRX_MAXRETRIES_3) || \
511 ((RET) == SPDIFRX_MAXRETRIES_15) || \
512 ((RET) == SPDIFRX_MAXRETRIES_63))
513 #define IS_SPDIFRX_WAIT_FOR_ACTIVITY(VAL) (((VAL) == SPDIFRX_WAITFORACTIVITY_ON) || \
514 ((VAL) == SPDIFRX_WAITFORACTIVITY_OFF))
515 #define IS_PREAMBLE_TYPE_MASK(VAL) (((VAL) == SPDIFRX_PREAMBLETYPEMASK_ON) || \
516 ((VAL) == SPDIFRX_PREAMBLETYPEMASK_OFF))
517 #define IS_VALIDITY_MASK(VAL) (((VAL) == SPDIFRX_VALIDITYMASK_OFF) || \
518 ((VAL) == SPDIFRX_VALIDITYMASK_ON))
519 #define IS_PARITY_ERROR_MASK(VAL) (((VAL) == SPDIFRX_PARITYERRORMASK_OFF) || \
520 ((VAL) == SPDIFRX_PARITYERRORMASK_ON))
521 #define IS_SPDIFRX_CHANNEL(CHANNEL) (((CHANNEL) == SPDIFRX_CHANNEL_A) || \
522 ((CHANNEL) == SPDIFRX_CHANNEL_B))
523 #define IS_SPDIFRX_DATA_FORMAT(FORMAT) (((FORMAT) == SPDIFRX_DATAFORMAT_LSB) || \
524 ((FORMAT) == SPDIFRX_DATAFORMAT_MSB) || \
525 ((FORMAT) == SPDIFRX_DATAFORMAT_32BITS))
526 #define IS_STEREO_MODE(MODE) (((MODE) == SPDIFRX_STEREOMODE_DISABLE) || \
527 ((MODE) == SPDIFRX_STEREOMODE_ENABLE))
529 #define IS_CHANNEL_STATUS_MASK(VAL) (((VAL) == SPDIFRX_CHANNELSTATUS_ON) || \
530 ((VAL) == SPDIFRX_CHANNELSTATUS_OFF))
531 /**
532 * @}
535 /* Private functions ---------------------------------------------------------*/
536 /** @defgroup SPDIFRX_Private_Functions SPDIFRX Private Functions
537 * @{
540 * @}
544 * @}
548 * @}
551 #endif /* SPDIFRX */
553 #ifdef __cplusplus
555 #endif
558 #endif /* __STM32F7xx_HAL_SPDIFRX_H */
560 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/