inport from local
Dependents: Hobbyking_Cheetah_0511
targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_spdifrx.h@0:85b3fd62ea1a, 2020-03-16 (annotated)
- Committer:
- NYX
- Date:
- Mon Mar 16 06:35:48 2020 +0000
- Revision:
- 0:85b3fd62ea1a
reinport to mbed;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
NYX | 0:85b3fd62ea1a | 1 | /** |
NYX | 0:85b3fd62ea1a | 2 | ****************************************************************************** |
NYX | 0:85b3fd62ea1a | 3 | * @file stm32f4xx_hal_spdifrx.h |
NYX | 0:85b3fd62ea1a | 4 | * @author MCD Application Team |
NYX | 0:85b3fd62ea1a | 5 | * @version V1.7.1 |
NYX | 0:85b3fd62ea1a | 6 | * @date 14-April-2017 |
NYX | 0:85b3fd62ea1a | 7 | * @brief Header file of SPDIFRX HAL module. |
NYX | 0:85b3fd62ea1a | 8 | ****************************************************************************** |
NYX | 0:85b3fd62ea1a | 9 | * @attention |
NYX | 0:85b3fd62ea1a | 10 | * |
NYX | 0:85b3fd62ea1a | 11 | * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2> |
NYX | 0:85b3fd62ea1a | 12 | * |
NYX | 0:85b3fd62ea1a | 13 | * Redistribution and use in source and binary forms, with or without modification, |
NYX | 0:85b3fd62ea1a | 14 | * are permitted provided that the following conditions are met: |
NYX | 0:85b3fd62ea1a | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
NYX | 0:85b3fd62ea1a | 16 | * this list of conditions and the following disclaimer. |
NYX | 0:85b3fd62ea1a | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
NYX | 0:85b3fd62ea1a | 18 | * this list of conditions and the following disclaimer in the documentation |
NYX | 0:85b3fd62ea1a | 19 | * and/or other materials provided with the distribution. |
NYX | 0:85b3fd62ea1a | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
NYX | 0:85b3fd62ea1a | 21 | * may be used to endorse or promote products derived from this software |
NYX | 0:85b3fd62ea1a | 22 | * without specific prior written permission. |
NYX | 0:85b3fd62ea1a | 23 | * |
NYX | 0:85b3fd62ea1a | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
NYX | 0:85b3fd62ea1a | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
NYX | 0:85b3fd62ea1a | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
NYX | 0:85b3fd62ea1a | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
NYX | 0:85b3fd62ea1a | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
NYX | 0:85b3fd62ea1a | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
NYX | 0:85b3fd62ea1a | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
NYX | 0:85b3fd62ea1a | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
NYX | 0:85b3fd62ea1a | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
NYX | 0:85b3fd62ea1a | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
NYX | 0:85b3fd62ea1a | 34 | * |
NYX | 0:85b3fd62ea1a | 35 | ****************************************************************************** |
NYX | 0:85b3fd62ea1a | 36 | */ |
NYX | 0:85b3fd62ea1a | 37 | |
NYX | 0:85b3fd62ea1a | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
NYX | 0:85b3fd62ea1a | 39 | #ifndef __STM32F4xx_HAL_SPDIFRX_H |
NYX | 0:85b3fd62ea1a | 40 | #define __STM32F4xx_HAL_SPDIFRX_H |
NYX | 0:85b3fd62ea1a | 41 | |
NYX | 0:85b3fd62ea1a | 42 | #ifdef __cplusplus |
NYX | 0:85b3fd62ea1a | 43 | extern "C" { |
NYX | 0:85b3fd62ea1a | 44 | #endif |
NYX | 0:85b3fd62ea1a | 45 | |
NYX | 0:85b3fd62ea1a | 46 | #if defined(STM32F446xx) |
NYX | 0:85b3fd62ea1a | 47 | |
NYX | 0:85b3fd62ea1a | 48 | /* Includes ------------------------------------------------------------------*/ |
NYX | 0:85b3fd62ea1a | 49 | #include "stm32f4xx_hal_def.h" |
NYX | 0:85b3fd62ea1a | 50 | |
NYX | 0:85b3fd62ea1a | 51 | /** @addtogroup STM32F4xx_HAL_Driver |
NYX | 0:85b3fd62ea1a | 52 | * @{ |
NYX | 0:85b3fd62ea1a | 53 | */ |
NYX | 0:85b3fd62ea1a | 54 | |
NYX | 0:85b3fd62ea1a | 55 | /** @addtogroup SPDIFRX |
NYX | 0:85b3fd62ea1a | 56 | * @{ |
NYX | 0:85b3fd62ea1a | 57 | */ |
NYX | 0:85b3fd62ea1a | 58 | |
NYX | 0:85b3fd62ea1a | 59 | /* Exported types ------------------------------------------------------------*/ |
NYX | 0:85b3fd62ea1a | 60 | /** @defgroup SPDIFRX_Exported_Types SPDIFRX Exported Types |
NYX | 0:85b3fd62ea1a | 61 | * @{ |
NYX | 0:85b3fd62ea1a | 62 | */ |
NYX | 0:85b3fd62ea1a | 63 | |
NYX | 0:85b3fd62ea1a | 64 | /** |
NYX | 0:85b3fd62ea1a | 65 | * @brief SPDIFRX Init structure definition |
NYX | 0:85b3fd62ea1a | 66 | */ |
NYX | 0:85b3fd62ea1a | 67 | typedef struct |
NYX | 0:85b3fd62ea1a | 68 | { |
NYX | 0:85b3fd62ea1a | 69 | uint32_t InputSelection; /*!< Specifies the SPDIF input selection. |
NYX | 0:85b3fd62ea1a | 70 | This parameter can be a value of @ref SPDIFRX_Input_Selection */ |
NYX | 0:85b3fd62ea1a | 71 | |
NYX | 0:85b3fd62ea1a | 72 | uint32_t Retries; /*!< Specifies the Maximum allowed re-tries during synchronization phase. |
NYX | 0:85b3fd62ea1a | 73 | This parameter can be a value of @ref SPDIFRX_Max_Retries */ |
NYX | 0:85b3fd62ea1a | 74 | |
NYX | 0:85b3fd62ea1a | 75 | uint32_t WaitForActivity; /*!< Specifies the wait for activity on SPDIF selected input. |
NYX | 0:85b3fd62ea1a | 76 | This parameter can be a value of @ref SPDIFRX_Wait_For_Activity. */ |
NYX | 0:85b3fd62ea1a | 77 | |
NYX | 0:85b3fd62ea1a | 78 | uint32_t ChannelSelection; /*!< Specifies whether the control flow will take the channel status from channel A or B. |
NYX | 0:85b3fd62ea1a | 79 | This parameter can be a value of @ref SPDIFRX_Channel_Selection */ |
NYX | 0:85b3fd62ea1a | 80 | |
NYX | 0:85b3fd62ea1a | 81 | uint32_t DataFormat; /*!< Specifies the Data samples format (LSB, MSB, ...). |
NYX | 0:85b3fd62ea1a | 82 | This parameter can be a value of @ref SPDIFRX_Data_Format */ |
NYX | 0:85b3fd62ea1a | 83 | |
NYX | 0:85b3fd62ea1a | 84 | uint32_t StereoMode; /*!< Specifies whether the peripheral is in stereo or mono mode. |
NYX | 0:85b3fd62ea1a | 85 | This parameter can be a value of @ref SPDIFRX_Stereo_Mode */ |
NYX | 0:85b3fd62ea1a | 86 | |
NYX | 0:85b3fd62ea1a | 87 | uint32_t PreambleTypeMask; /*!< Specifies whether The preamble type bits are copied or not into the received frame. |
NYX | 0:85b3fd62ea1a | 88 | This parameter can be a value of @ref SPDIFRX_PT_Mask */ |
NYX | 0:85b3fd62ea1a | 89 | |
NYX | 0:85b3fd62ea1a | 90 | uint32_t ChannelStatusMask; /*!< Specifies whether the channel status and user bits are copied or not into the received frame. |
NYX | 0:85b3fd62ea1a | 91 | This parameter can be a value of @ref SPDIFRX_ChannelStatus_Mask */ |
NYX | 0:85b3fd62ea1a | 92 | |
NYX | 0:85b3fd62ea1a | 93 | uint32_t ValidityBitMask; /*!< Specifies whether the validity bit is copied or not into the received frame. |
NYX | 0:85b3fd62ea1a | 94 | This parameter can be a value of @ref SPDIFRX_V_Mask */ |
NYX | 0:85b3fd62ea1a | 95 | |
NYX | 0:85b3fd62ea1a | 96 | uint32_t ParityErrorMask; /*!< Specifies whether the parity error bit is copied or not into the received frame. |
NYX | 0:85b3fd62ea1a | 97 | This parameter can be a value of @ref SPDIFRX_PE_Mask */ |
NYX | 0:85b3fd62ea1a | 98 | }SPDIFRX_InitTypeDef; |
NYX | 0:85b3fd62ea1a | 99 | |
NYX | 0:85b3fd62ea1a | 100 | /** |
NYX | 0:85b3fd62ea1a | 101 | * @brief SPDIFRX SetDataFormat structure definition |
NYX | 0:85b3fd62ea1a | 102 | */ |
NYX | 0:85b3fd62ea1a | 103 | typedef struct |
NYX | 0:85b3fd62ea1a | 104 | { |
NYX | 0:85b3fd62ea1a | 105 | uint32_t DataFormat; /*!< Specifies the Data samples format (LSB, MSB, ...). |
NYX | 0:85b3fd62ea1a | 106 | This parameter can be a value of @ref SPDIFRX_Data_Format */ |
NYX | 0:85b3fd62ea1a | 107 | |
NYX | 0:85b3fd62ea1a | 108 | uint32_t StereoMode; /*!< Specifies whether the peripheral is in stereo or mono mode. |
NYX | 0:85b3fd62ea1a | 109 | This parameter can be a value of @ref SPDIFRX_Stereo_Mode */ |
NYX | 0:85b3fd62ea1a | 110 | |
NYX | 0:85b3fd62ea1a | 111 | uint32_t PreambleTypeMask; /*!< Specifies whether The preamble type bits are copied or not into the received frame. |
NYX | 0:85b3fd62ea1a | 112 | This parameter can be a value of @ref SPDIFRX_PT_Mask */ |
NYX | 0:85b3fd62ea1a | 113 | |
NYX | 0:85b3fd62ea1a | 114 | uint32_t ChannelStatusMask; /*!< Specifies whether the channel status and user bits are copied or not into the received frame. |
NYX | 0:85b3fd62ea1a | 115 | This parameter can be a value of @ref SPDIFRX_ChannelStatus_Mask */ |
NYX | 0:85b3fd62ea1a | 116 | |
NYX | 0:85b3fd62ea1a | 117 | uint32_t ValidityBitMask; /*!< Specifies whether the validity bit is copied or not into the received frame. |
NYX | 0:85b3fd62ea1a | 118 | This parameter can be a value of @ref SPDIFRX_V_Mask */ |
NYX | 0:85b3fd62ea1a | 119 | |
NYX | 0:85b3fd62ea1a | 120 | uint32_t ParityErrorMask; /*!< Specifies whether the parity error bit is copied or not into the received frame. |
NYX | 0:85b3fd62ea1a | 121 | This parameter can be a value of @ref SPDIFRX_PE_Mask */ |
NYX | 0:85b3fd62ea1a | 122 | }SPDIFRX_SetDataFormatTypeDef; |
NYX | 0:85b3fd62ea1a | 123 | |
NYX | 0:85b3fd62ea1a | 124 | /** |
NYX | 0:85b3fd62ea1a | 125 | * @brief HAL State structures definition |
NYX | 0:85b3fd62ea1a | 126 | */ |
NYX | 0:85b3fd62ea1a | 127 | typedef enum |
NYX | 0:85b3fd62ea1a | 128 | { |
NYX | 0:85b3fd62ea1a | 129 | HAL_SPDIFRX_STATE_RESET = 0x00U, /*!< SPDIFRX not yet initialized or disabled */ |
NYX | 0:85b3fd62ea1a | 130 | HAL_SPDIFRX_STATE_READY = 0x01U, /*!< SPDIFRX initialized and ready for use */ |
NYX | 0:85b3fd62ea1a | 131 | HAL_SPDIFRX_STATE_BUSY = 0x02U, /*!< SPDIFRX internal process is ongoing */ |
NYX | 0:85b3fd62ea1a | 132 | HAL_SPDIFRX_STATE_BUSY_RX = 0x03U, /*!< SPDIFRX internal Data Flow RX process is ongoing */ |
NYX | 0:85b3fd62ea1a | 133 | HAL_SPDIFRX_STATE_BUSY_CX = 0x04U, /*!< SPDIFRX internal Control Flow RX process is ongoing */ |
NYX | 0:85b3fd62ea1a | 134 | HAL_SPDIFRX_STATE_ERROR = 0x07U /*!< SPDIFRX error state */ |
NYX | 0:85b3fd62ea1a | 135 | }HAL_SPDIFRX_StateTypeDef; |
NYX | 0:85b3fd62ea1a | 136 | |
NYX | 0:85b3fd62ea1a | 137 | /** |
NYX | 0:85b3fd62ea1a | 138 | * @brief SPDIFRX handle Structure definition |
NYX | 0:85b3fd62ea1a | 139 | */ |
NYX | 0:85b3fd62ea1a | 140 | typedef struct |
NYX | 0:85b3fd62ea1a | 141 | { |
NYX | 0:85b3fd62ea1a | 142 | SPDIFRX_TypeDef *Instance; /* SPDIFRX registers base address */ |
NYX | 0:85b3fd62ea1a | 143 | |
NYX | 0:85b3fd62ea1a | 144 | SPDIFRX_InitTypeDef Init; /* SPDIFRX communication parameters */ |
NYX | 0:85b3fd62ea1a | 145 | |
NYX | 0:85b3fd62ea1a | 146 | uint32_t *pRxBuffPtr; /* Pointer to SPDIFRX Rx transfer buffer */ |
NYX | 0:85b3fd62ea1a | 147 | |
NYX | 0:85b3fd62ea1a | 148 | uint32_t *pCsBuffPtr; /* Pointer to SPDIFRX Cx transfer buffer */ |
NYX | 0:85b3fd62ea1a | 149 | |
NYX | 0:85b3fd62ea1a | 150 | __IO uint16_t RxXferSize; /* SPDIFRX Rx transfer size */ |
NYX | 0:85b3fd62ea1a | 151 | |
NYX | 0:85b3fd62ea1a | 152 | __IO uint16_t RxXferCount; /* SPDIFRX Rx transfer counter |
NYX | 0:85b3fd62ea1a | 153 | (This field is initialized at the |
NYX | 0:85b3fd62ea1a | 154 | same value as transfer size at the |
NYX | 0:85b3fd62ea1a | 155 | beginning of the transfer and |
NYX | 0:85b3fd62ea1a | 156 | decremented when a sample is received. |
NYX | 0:85b3fd62ea1a | 157 | NbSamplesReceived = RxBufferSize-RxBufferCount) */ |
NYX | 0:85b3fd62ea1a | 158 | |
NYX | 0:85b3fd62ea1a | 159 | __IO uint16_t CsXferSize; /* SPDIFRX Rx transfer size */ |
NYX | 0:85b3fd62ea1a | 160 | |
NYX | 0:85b3fd62ea1a | 161 | __IO uint16_t CsXferCount; /* SPDIFRX Rx transfer counter |
NYX | 0:85b3fd62ea1a | 162 | (This field is initialized at the |
NYX | 0:85b3fd62ea1a | 163 | same value as transfer size at the |
NYX | 0:85b3fd62ea1a | 164 | beginning of the transfer and |
NYX | 0:85b3fd62ea1a | 165 | decremented when a sample is received. |
NYX | 0:85b3fd62ea1a | 166 | NbSamplesReceived = RxBufferSize-RxBufferCount) */ |
NYX | 0:85b3fd62ea1a | 167 | |
NYX | 0:85b3fd62ea1a | 168 | DMA_HandleTypeDef *hdmaCsRx; /* SPDIFRX EC60958_channel_status and user_information DMA handle parameters */ |
NYX | 0:85b3fd62ea1a | 169 | |
NYX | 0:85b3fd62ea1a | 170 | DMA_HandleTypeDef *hdmaDrRx; /* SPDIFRX Rx DMA handle parameters */ |
NYX | 0:85b3fd62ea1a | 171 | |
NYX | 0:85b3fd62ea1a | 172 | __IO HAL_LockTypeDef Lock; /* SPDIFRX locking object */ |
NYX | 0:85b3fd62ea1a | 173 | |
NYX | 0:85b3fd62ea1a | 174 | __IO HAL_SPDIFRX_StateTypeDef State; /* SPDIFRX communication state */ |
NYX | 0:85b3fd62ea1a | 175 | |
NYX | 0:85b3fd62ea1a | 176 | __IO uint32_t ErrorCode; /* SPDIFRX Error code */ |
NYX | 0:85b3fd62ea1a | 177 | }SPDIFRX_HandleTypeDef; |
NYX | 0:85b3fd62ea1a | 178 | /** |
NYX | 0:85b3fd62ea1a | 179 | * @} |
NYX | 0:85b3fd62ea1a | 180 | */ |
NYX | 0:85b3fd62ea1a | 181 | |
NYX | 0:85b3fd62ea1a | 182 | /* Exported constants --------------------------------------------------------*/ |
NYX | 0:85b3fd62ea1a | 183 | /** @defgroup SPDIFRX_Exported_Constants SPDIFRX Exported Constants |
NYX | 0:85b3fd62ea1a | 184 | * @{ |
NYX | 0:85b3fd62ea1a | 185 | */ |
NYX | 0:85b3fd62ea1a | 186 | /** @defgroup SPDIFRX_ErrorCode SPDIFRX Error Code |
NYX | 0:85b3fd62ea1a | 187 | * @{ |
NYX | 0:85b3fd62ea1a | 188 | */ |
NYX | 0:85b3fd62ea1a | 189 | #define HAL_SPDIFRX_ERROR_NONE 0x00000000U /*!< No error */ |
NYX | 0:85b3fd62ea1a | 190 | #define HAL_SPDIFRX_ERROR_TIMEOUT 0x00000001U /*!< Timeout error */ |
NYX | 0:85b3fd62ea1a | 191 | #define HAL_SPDIFRX_ERROR_OVR 0x00000002U /*!< OVR error */ |
NYX | 0:85b3fd62ea1a | 192 | #define HAL_SPDIFRX_ERROR_PE 0x00000004U /*!< Parity error */ |
NYX | 0:85b3fd62ea1a | 193 | #define HAL_SPDIFRX_ERROR_DMA 0x00000008U /*!< DMA transfer error */ |
NYX | 0:85b3fd62ea1a | 194 | #define HAL_SPDIFRX_ERROR_UNKNOWN 0x00000010U /*!< Unknown Error error */ |
NYX | 0:85b3fd62ea1a | 195 | /** |
NYX | 0:85b3fd62ea1a | 196 | * @} |
NYX | 0:85b3fd62ea1a | 197 | */ |
NYX | 0:85b3fd62ea1a | 198 | |
NYX | 0:85b3fd62ea1a | 199 | /** @defgroup SPDIFRX_Input_Selection SPDIFRX Input Selection |
NYX | 0:85b3fd62ea1a | 200 | * @{ |
NYX | 0:85b3fd62ea1a | 201 | */ |
NYX | 0:85b3fd62ea1a | 202 | #define SPDIFRX_INPUT_IN0 0x00000000U |
NYX | 0:85b3fd62ea1a | 203 | #define SPDIFRX_INPUT_IN1 0x00010000U |
NYX | 0:85b3fd62ea1a | 204 | #define SPDIFRX_INPUT_IN2 0x00020000U |
NYX | 0:85b3fd62ea1a | 205 | #define SPDIFRX_INPUT_IN3 0x00030000U |
NYX | 0:85b3fd62ea1a | 206 | /** |
NYX | 0:85b3fd62ea1a | 207 | * @} |
NYX | 0:85b3fd62ea1a | 208 | */ |
NYX | 0:85b3fd62ea1a | 209 | |
NYX | 0:85b3fd62ea1a | 210 | /** @defgroup SPDIFRX_Max_Retries SPDIFRX Maximum Retries |
NYX | 0:85b3fd62ea1a | 211 | * @{ |
NYX | 0:85b3fd62ea1a | 212 | */ |
NYX | 0:85b3fd62ea1a | 213 | #define SPDIFRX_MAXRETRIES_NONE 0x00000000U |
NYX | 0:85b3fd62ea1a | 214 | #define SPDIFRX_MAXRETRIES_3 0x00001000U |
NYX | 0:85b3fd62ea1a | 215 | #define SPDIFRX_MAXRETRIES_15 0x00002000U |
NYX | 0:85b3fd62ea1a | 216 | #define SPDIFRX_MAXRETRIES_63 0x00003000U |
NYX | 0:85b3fd62ea1a | 217 | /** |
NYX | 0:85b3fd62ea1a | 218 | * @} |
NYX | 0:85b3fd62ea1a | 219 | */ |
NYX | 0:85b3fd62ea1a | 220 | |
NYX | 0:85b3fd62ea1a | 221 | /** @defgroup SPDIFRX_Wait_For_Activity SPDIFRX Wait For Activity |
NYX | 0:85b3fd62ea1a | 222 | * @{ |
NYX | 0:85b3fd62ea1a | 223 | */ |
NYX | 0:85b3fd62ea1a | 224 | #define SPDIFRX_WAITFORACTIVITY_OFF 0x00000000U |
NYX | 0:85b3fd62ea1a | 225 | #define SPDIFRX_WAITFORACTIVITY_ON ((uint32_t)SPDIFRX_CR_WFA) |
NYX | 0:85b3fd62ea1a | 226 | /** |
NYX | 0:85b3fd62ea1a | 227 | * @} |
NYX | 0:85b3fd62ea1a | 228 | */ |
NYX | 0:85b3fd62ea1a | 229 | |
NYX | 0:85b3fd62ea1a | 230 | /** @defgroup SPDIFRX_PT_Mask SPDIFRX Preamble Type Mask |
NYX | 0:85b3fd62ea1a | 231 | * @{ |
NYX | 0:85b3fd62ea1a | 232 | */ |
NYX | 0:85b3fd62ea1a | 233 | #define SPDIFRX_PREAMBLETYPEMASK_OFF 0x00000000U |
NYX | 0:85b3fd62ea1a | 234 | #define SPDIFRX_PREAMBLETYPEMASK_ON ((uint32_t)SPDIFRX_CR_PTMSK) |
NYX | 0:85b3fd62ea1a | 235 | /** |
NYX | 0:85b3fd62ea1a | 236 | * @} |
NYX | 0:85b3fd62ea1a | 237 | */ |
NYX | 0:85b3fd62ea1a | 238 | |
NYX | 0:85b3fd62ea1a | 239 | /** @defgroup SPDIFRX_ChannelStatus_Mask SPDIFRX Channel Status Mask |
NYX | 0:85b3fd62ea1a | 240 | * @{ |
NYX | 0:85b3fd62ea1a | 241 | */ |
NYX | 0:85b3fd62ea1a | 242 | #define SPDIFRX_CHANNELSTATUS_OFF 0x00000000U /* The channel status and user bits are copied into the SPDIF_DR */ |
NYX | 0:85b3fd62ea1a | 243 | #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*/ |
NYX | 0:85b3fd62ea1a | 244 | /** |
NYX | 0:85b3fd62ea1a | 245 | * @} |
NYX | 0:85b3fd62ea1a | 246 | */ |
NYX | 0:85b3fd62ea1a | 247 | |
NYX | 0:85b3fd62ea1a | 248 | /** @defgroup SPDIFRX_V_Mask SPDIFRX Validity Mask |
NYX | 0:85b3fd62ea1a | 249 | * @{ |
NYX | 0:85b3fd62ea1a | 250 | */ |
NYX | 0:85b3fd62ea1a | 251 | #define SPDIFRX_VALIDITYMASK_OFF 0x00000000U |
NYX | 0:85b3fd62ea1a | 252 | #define SPDIFRX_VALIDITYMASK_ON ((uint32_t)SPDIFRX_CR_VMSK) |
NYX | 0:85b3fd62ea1a | 253 | /** |
NYX | 0:85b3fd62ea1a | 254 | * @} |
NYX | 0:85b3fd62ea1a | 255 | */ |
NYX | 0:85b3fd62ea1a | 256 | |
NYX | 0:85b3fd62ea1a | 257 | /** @defgroup SPDIFRX_PE_Mask SPDIFRX Parity Error Mask |
NYX | 0:85b3fd62ea1a | 258 | * @{ |
NYX | 0:85b3fd62ea1a | 259 | */ |
NYX | 0:85b3fd62ea1a | 260 | #define SPDIFRX_PARITYERRORMASK_OFF 0x00000000U |
NYX | 0:85b3fd62ea1a | 261 | #define SPDIFRX_PARITYERRORMASK_ON ((uint32_t)SPDIFRX_CR_PMSK) |
NYX | 0:85b3fd62ea1a | 262 | /** |
NYX | 0:85b3fd62ea1a | 263 | * @} |
NYX | 0:85b3fd62ea1a | 264 | */ |
NYX | 0:85b3fd62ea1a | 265 | |
NYX | 0:85b3fd62ea1a | 266 | /** @defgroup SPDIFRX_Channel_Selection SPDIFRX Channel Selection |
NYX | 0:85b3fd62ea1a | 267 | * @{ |
NYX | 0:85b3fd62ea1a | 268 | */ |
NYX | 0:85b3fd62ea1a | 269 | #define SPDIFRX_CHANNEL_A 0x00000000U |
NYX | 0:85b3fd62ea1a | 270 | #define SPDIFRX_CHANNEL_B ((uint32_t)SPDIFRX_CR_CHSEL) |
NYX | 0:85b3fd62ea1a | 271 | /** |
NYX | 0:85b3fd62ea1a | 272 | * @} |
NYX | 0:85b3fd62ea1a | 273 | */ |
NYX | 0:85b3fd62ea1a | 274 | |
NYX | 0:85b3fd62ea1a | 275 | /** @defgroup SPDIFRX_Data_Format SPDIFRX Data Format |
NYX | 0:85b3fd62ea1a | 276 | * @{ |
NYX | 0:85b3fd62ea1a | 277 | */ |
NYX | 0:85b3fd62ea1a | 278 | #define SPDIFRX_DATAFORMAT_LSB 0x00000000U |
NYX | 0:85b3fd62ea1a | 279 | #define SPDIFRX_DATAFORMAT_MSB 0x00000010U |
NYX | 0:85b3fd62ea1a | 280 | #define SPDIFRX_DATAFORMAT_32BITS 0x00000020U |
NYX | 0:85b3fd62ea1a | 281 | /** |
NYX | 0:85b3fd62ea1a | 282 | * @} |
NYX | 0:85b3fd62ea1a | 283 | */ |
NYX | 0:85b3fd62ea1a | 284 | |
NYX | 0:85b3fd62ea1a | 285 | /** @defgroup SPDIFRX_Stereo_Mode SPDIFRX Stereo Mode |
NYX | 0:85b3fd62ea1a | 286 | * @{ |
NYX | 0:85b3fd62ea1a | 287 | */ |
NYX | 0:85b3fd62ea1a | 288 | #define SPDIFRX_STEREOMODE_DISABLE 0x00000000U |
NYX | 0:85b3fd62ea1a | 289 | #define SPDIFRX_STEREOMODE_ENABLE ((uint32_t)SPDIFRX_CR_RXSTEO) |
NYX | 0:85b3fd62ea1a | 290 | /** |
NYX | 0:85b3fd62ea1a | 291 | * @} |
NYX | 0:85b3fd62ea1a | 292 | */ |
NYX | 0:85b3fd62ea1a | 293 | |
NYX | 0:85b3fd62ea1a | 294 | /** @defgroup SPDIFRX_State SPDIFRX State |
NYX | 0:85b3fd62ea1a | 295 | * @{ |
NYX | 0:85b3fd62ea1a | 296 | */ |
NYX | 0:85b3fd62ea1a | 297 | |
NYX | 0:85b3fd62ea1a | 298 | #define SPDIFRX_STATE_IDLE 0xFFFFFFFCU |
NYX | 0:85b3fd62ea1a | 299 | #define SPDIFRX_STATE_SYNC 0x00000001U |
NYX | 0:85b3fd62ea1a | 300 | #define SPDIFRX_STATE_RCV ((uint32_t)SPDIFRX_CR_SPDIFEN) |
NYX | 0:85b3fd62ea1a | 301 | /** |
NYX | 0:85b3fd62ea1a | 302 | * @} |
NYX | 0:85b3fd62ea1a | 303 | */ |
NYX | 0:85b3fd62ea1a | 304 | |
NYX | 0:85b3fd62ea1a | 305 | /** @defgroup SPDIFRX_Interrupts_Definition SPDIFRX Interrupts Definition |
NYX | 0:85b3fd62ea1a | 306 | * @{ |
NYX | 0:85b3fd62ea1a | 307 | */ |
NYX | 0:85b3fd62ea1a | 308 | #define SPDIFRX_IT_RXNE ((uint32_t)SPDIFRX_IMR_RXNEIE) |
NYX | 0:85b3fd62ea1a | 309 | #define SPDIFRX_IT_CSRNE ((uint32_t)SPDIFRX_IMR_CSRNEIE) |
NYX | 0:85b3fd62ea1a | 310 | #define SPDIFRX_IT_PERRIE ((uint32_t)SPDIFRX_IMR_PERRIE) |
NYX | 0:85b3fd62ea1a | 311 | #define SPDIFRX_IT_OVRIE ((uint32_t)SPDIFRX_IMR_OVRIE) |
NYX | 0:85b3fd62ea1a | 312 | #define SPDIFRX_IT_SBLKIE ((uint32_t)SPDIFRX_IMR_SBLKIE) |
NYX | 0:85b3fd62ea1a | 313 | #define SPDIFRX_IT_SYNCDIE ((uint32_t)SPDIFRX_IMR_SYNCDIE) |
NYX | 0:85b3fd62ea1a | 314 | #define SPDIFRX_IT_IFEIE ((uint32_t)SPDIFRX_IMR_IFEIE ) |
NYX | 0:85b3fd62ea1a | 315 | /** |
NYX | 0:85b3fd62ea1a | 316 | * @} |
NYX | 0:85b3fd62ea1a | 317 | */ |
NYX | 0:85b3fd62ea1a | 318 | |
NYX | 0:85b3fd62ea1a | 319 | /** @defgroup SPDIFRX_Flags_Definition SPDIFRX Flags Definition |
NYX | 0:85b3fd62ea1a | 320 | * @{ |
NYX | 0:85b3fd62ea1a | 321 | */ |
NYX | 0:85b3fd62ea1a | 322 | #define SPDIFRX_FLAG_RXNE ((uint32_t)SPDIFRX_SR_RXNE) |
NYX | 0:85b3fd62ea1a | 323 | #define SPDIFRX_FLAG_CSRNE ((uint32_t)SPDIFRX_SR_CSRNE) |
NYX | 0:85b3fd62ea1a | 324 | #define SPDIFRX_FLAG_PERR ((uint32_t)SPDIFRX_SR_PERR) |
NYX | 0:85b3fd62ea1a | 325 | #define SPDIFRX_FLAG_OVR ((uint32_t)SPDIFRX_SR_OVR) |
NYX | 0:85b3fd62ea1a | 326 | #define SPDIFRX_FLAG_SBD ((uint32_t)SPDIFRX_SR_SBD) |
NYX | 0:85b3fd62ea1a | 327 | #define SPDIFRX_FLAG_SYNCD ((uint32_t)SPDIFRX_SR_SYNCD) |
NYX | 0:85b3fd62ea1a | 328 | #define SPDIFRX_FLAG_FERR ((uint32_t)SPDIFRX_SR_FERR) |
NYX | 0:85b3fd62ea1a | 329 | #define SPDIFRX_FLAG_SERR ((uint32_t)SPDIFRX_SR_SERR) |
NYX | 0:85b3fd62ea1a | 330 | #define SPDIFRX_FLAG_TERR ((uint32_t)SPDIFRX_SR_TERR) |
NYX | 0:85b3fd62ea1a | 331 | /** |
NYX | 0:85b3fd62ea1a | 332 | * @} |
NYX | 0:85b3fd62ea1a | 333 | */ |
NYX | 0:85b3fd62ea1a | 334 | |
NYX | 0:85b3fd62ea1a | 335 | /** |
NYX | 0:85b3fd62ea1a | 336 | * @} |
NYX | 0:85b3fd62ea1a | 337 | */ |
NYX | 0:85b3fd62ea1a | 338 | |
NYX | 0:85b3fd62ea1a | 339 | /* Exported macros -----------------------------------------------------------*/ |
NYX | 0:85b3fd62ea1a | 340 | /** @defgroup SPDIFRX_Exported_macros SPDIFRX Exported Macros |
NYX | 0:85b3fd62ea1a | 341 | * @{ |
NYX | 0:85b3fd62ea1a | 342 | */ |
NYX | 0:85b3fd62ea1a | 343 | |
NYX | 0:85b3fd62ea1a | 344 | /** @brief Reset SPDIFRX handle state |
NYX | 0:85b3fd62ea1a | 345 | * @param __HANDLE__: SPDIFRX handle. |
NYX | 0:85b3fd62ea1a | 346 | * @retval None |
NYX | 0:85b3fd62ea1a | 347 | */ |
NYX | 0:85b3fd62ea1a | 348 | #define __HAL_SPDIFRX_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = (uint16_t)SPDIFRX_CR_SPDIFEN) |
NYX | 0:85b3fd62ea1a | 349 | |
NYX | 0:85b3fd62ea1a | 350 | /** @brief Disable the specified SPDIFRX peripheral (IDLE State). |
NYX | 0:85b3fd62ea1a | 351 | * @param __HANDLE__: specifies the SPDIFRX Handle. |
NYX | 0:85b3fd62ea1a | 352 | * @retval None |
NYX | 0:85b3fd62ea1a | 353 | */ |
NYX | 0:85b3fd62ea1a | 354 | #define __HAL_SPDIFRX_IDLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= SPDIFRX_STATE_IDLE) |
NYX | 0:85b3fd62ea1a | 355 | |
NYX | 0:85b3fd62ea1a | 356 | /** @brief Enable the specified SPDIFRX peripheral (SYNC State). |
NYX | 0:85b3fd62ea1a | 357 | * @param __HANDLE__: specifies the SPDIFRX Handle. |
NYX | 0:85b3fd62ea1a | 358 | * @retval None |
NYX | 0:85b3fd62ea1a | 359 | */ |
NYX | 0:85b3fd62ea1a | 360 | #define __HAL_SPDIFRX_SYNC(__HANDLE__) ((__HANDLE__)->Instance->CR |= SPDIFRX_STATE_SYNC) |
NYX | 0:85b3fd62ea1a | 361 | |
NYX | 0:85b3fd62ea1a | 362 | |
NYX | 0:85b3fd62ea1a | 363 | /** @brief Enable the specified SPDIFRX peripheral (RCV State). |
NYX | 0:85b3fd62ea1a | 364 | * @param __HANDLE__: specifies the SPDIFRX Handle. |
NYX | 0:85b3fd62ea1a | 365 | * @retval None |
NYX | 0:85b3fd62ea1a | 366 | */ |
NYX | 0:85b3fd62ea1a | 367 | #define __HAL_SPDIFRX_RCV(__HANDLE__) ((__HANDLE__)->Instance->CR |= SPDIFRX_STATE_RCV) |
NYX | 0:85b3fd62ea1a | 368 | |
NYX | 0:85b3fd62ea1a | 369 | /** @brief Enable or disable the specified SPDIFRX interrupts. |
NYX | 0:85b3fd62ea1a | 370 | * @param __HANDLE__: specifies the SPDIFRX Handle. |
NYX | 0:85b3fd62ea1a | 371 | * @param __INTERRUPT__: specifies the interrupt source to enable or disable. |
NYX | 0:85b3fd62ea1a | 372 | * This parameter can be one of the following values: |
NYX | 0:85b3fd62ea1a | 373 | * @arg SPDIFRX_IT_RXNE |
NYX | 0:85b3fd62ea1a | 374 | * @arg SPDIFRX_IT_CSRNE |
NYX | 0:85b3fd62ea1a | 375 | * @arg SPDIFRX_IT_PERRIE |
NYX | 0:85b3fd62ea1a | 376 | * @arg SPDIFRX_IT_OVRIE |
NYX | 0:85b3fd62ea1a | 377 | * @arg SPDIFRX_IT_SBLKIE |
NYX | 0:85b3fd62ea1a | 378 | * @arg SPDIFRX_IT_SYNCDIE |
NYX | 0:85b3fd62ea1a | 379 | * @arg SPDIFRX_IT_IFEIE |
NYX | 0:85b3fd62ea1a | 380 | * @retval None |
NYX | 0:85b3fd62ea1a | 381 | */ |
NYX | 0:85b3fd62ea1a | 382 | #define __HAL_SPDIFRX_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IMR |= (__INTERRUPT__)) |
NYX | 0:85b3fd62ea1a | 383 | #define __HAL_SPDIFRX_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IMR &= (uint16_t)(~(__INTERRUPT__))) |
NYX | 0:85b3fd62ea1a | 384 | |
NYX | 0:85b3fd62ea1a | 385 | /** @brief Checks if the specified SPDIFRX interrupt source is enabled or disabled. |
NYX | 0:85b3fd62ea1a | 386 | * @param __HANDLE__: specifies the SPDIFRX Handle. |
NYX | 0:85b3fd62ea1a | 387 | * @param __INTERRUPT__: specifies the SPDIFRX interrupt source to check. |
NYX | 0:85b3fd62ea1a | 388 | * This parameter can be one of the following values: |
NYX | 0:85b3fd62ea1a | 389 | * @arg SPDIFRX_IT_RXNE |
NYX | 0:85b3fd62ea1a | 390 | * @arg SPDIFRX_IT_CSRNE |
NYX | 0:85b3fd62ea1a | 391 | * @arg SPDIFRX_IT_PERRIE |
NYX | 0:85b3fd62ea1a | 392 | * @arg SPDIFRX_IT_OVRIE |
NYX | 0:85b3fd62ea1a | 393 | * @arg SPDIFRX_IT_SBLKIE |
NYX | 0:85b3fd62ea1a | 394 | * @arg SPDIFRX_IT_SYNCDIE |
NYX | 0:85b3fd62ea1a | 395 | * @arg SPDIFRX_IT_IFEIE |
NYX | 0:85b3fd62ea1a | 396 | * @retval The new state of __IT__ (TRUE or FALSE). |
NYX | 0:85b3fd62ea1a | 397 | */ |
NYX | 0:85b3fd62ea1a | 398 | #define __HAL_SPDIFRX_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->IMR & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET) |
NYX | 0:85b3fd62ea1a | 399 | |
NYX | 0:85b3fd62ea1a | 400 | /** @brief Checks whether the specified SPDIFRX flag is set or not. |
NYX | 0:85b3fd62ea1a | 401 | * @param __HANDLE__: specifies the SPDIFRX Handle. |
NYX | 0:85b3fd62ea1a | 402 | * @param __FLAG__: specifies the flag to check. |
NYX | 0:85b3fd62ea1a | 403 | * This parameter can be one of the following values: |
NYX | 0:85b3fd62ea1a | 404 | * @arg SPDIFRX_FLAG_RXNE |
NYX | 0:85b3fd62ea1a | 405 | * @arg SPDIFRX_FLAG_CSRNE |
NYX | 0:85b3fd62ea1a | 406 | * @arg SPDIFRX_FLAG_PERR |
NYX | 0:85b3fd62ea1a | 407 | * @arg SPDIFRX_FLAG_OVR |
NYX | 0:85b3fd62ea1a | 408 | * @arg SPDIFRX_FLAG_SBD |
NYX | 0:85b3fd62ea1a | 409 | * @arg SPDIFRX_FLAG_SYNCD |
NYX | 0:85b3fd62ea1a | 410 | * @arg SPDIFRX_FLAG_FERR |
NYX | 0:85b3fd62ea1a | 411 | * @arg SPDIFRX_FLAG_SERR |
NYX | 0:85b3fd62ea1a | 412 | * @arg SPDIFRX_FLAG_TERR |
NYX | 0:85b3fd62ea1a | 413 | * @retval The new state of __FLAG__ (TRUE or FALSE). |
NYX | 0:85b3fd62ea1a | 414 | */ |
NYX | 0:85b3fd62ea1a | 415 | #define __HAL_SPDIFRX_GET_FLAG(__HANDLE__, __FLAG__) ((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__)) |
NYX | 0:85b3fd62ea1a | 416 | |
NYX | 0:85b3fd62ea1a | 417 | /** @brief Clears the specified SPDIFRX SR flag, in setting the proper IFCR register bit. |
NYX | 0:85b3fd62ea1a | 418 | * @param __HANDLE__: specifies the USART Handle. |
NYX | 0:85b3fd62ea1a | 419 | * @param __IT_CLEAR__: specifies the interrupt clear register flag that needs to be set |
NYX | 0:85b3fd62ea1a | 420 | * to clear the corresponding interrupt |
NYX | 0:85b3fd62ea1a | 421 | * This parameter can be one of the following values: |
NYX | 0:85b3fd62ea1a | 422 | * @arg SPDIFRX_FLAG_PERR |
NYX | 0:85b3fd62ea1a | 423 | * @arg SPDIFRX_FLAG_OVR |
NYX | 0:85b3fd62ea1a | 424 | * @arg SPDIFRX_SR_SBD |
NYX | 0:85b3fd62ea1a | 425 | * @arg SPDIFRX_SR_SYNCD |
NYX | 0:85b3fd62ea1a | 426 | * @retval None |
NYX | 0:85b3fd62ea1a | 427 | */ |
NYX | 0:85b3fd62ea1a | 428 | #define __HAL_SPDIFRX_CLEAR_IT(__HANDLE__, __IT_CLEAR__) ((__HANDLE__)->Instance->IFCR = (uint32_t)(__IT_CLEAR__)) |
NYX | 0:85b3fd62ea1a | 429 | |
NYX | 0:85b3fd62ea1a | 430 | /** |
NYX | 0:85b3fd62ea1a | 431 | * @} |
NYX | 0:85b3fd62ea1a | 432 | */ |
NYX | 0:85b3fd62ea1a | 433 | |
NYX | 0:85b3fd62ea1a | 434 | /* Exported functions --------------------------------------------------------*/ |
NYX | 0:85b3fd62ea1a | 435 | /** @addtogroup SPDIFRX_Exported_Functions |
NYX | 0:85b3fd62ea1a | 436 | * @{ |
NYX | 0:85b3fd62ea1a | 437 | */ |
NYX | 0:85b3fd62ea1a | 438 | |
NYX | 0:85b3fd62ea1a | 439 | /** @addtogroup SPDIFRX_Exported_Functions_Group1 |
NYX | 0:85b3fd62ea1a | 440 | * @{ |
NYX | 0:85b3fd62ea1a | 441 | */ |
NYX | 0:85b3fd62ea1a | 442 | /* Initialization/de-initialization functions **********************************/ |
NYX | 0:85b3fd62ea1a | 443 | HAL_StatusTypeDef HAL_SPDIFRX_Init(SPDIFRX_HandleTypeDef *hspdif); |
NYX | 0:85b3fd62ea1a | 444 | HAL_StatusTypeDef HAL_SPDIFRX_DeInit (SPDIFRX_HandleTypeDef *hspdif); |
NYX | 0:85b3fd62ea1a | 445 | void HAL_SPDIFRX_MspInit(SPDIFRX_HandleTypeDef *hspdif); |
NYX | 0:85b3fd62ea1a | 446 | void HAL_SPDIFRX_MspDeInit(SPDIFRX_HandleTypeDef *hspdif); |
NYX | 0:85b3fd62ea1a | 447 | HAL_StatusTypeDef HAL_SPDIFRX_SetDataFormat(SPDIFRX_HandleTypeDef *hspdif, SPDIFRX_SetDataFormatTypeDef sDataFormat); |
NYX | 0:85b3fd62ea1a | 448 | /** |
NYX | 0:85b3fd62ea1a | 449 | * @} |
NYX | 0:85b3fd62ea1a | 450 | */ |
NYX | 0:85b3fd62ea1a | 451 | |
NYX | 0:85b3fd62ea1a | 452 | /** @addtogroup SPDIFRX_Exported_Functions_Group2 |
NYX | 0:85b3fd62ea1a | 453 | * @{ |
NYX | 0:85b3fd62ea1a | 454 | */ |
NYX | 0:85b3fd62ea1a | 455 | /* I/O operation functions ***************************************************/ |
NYX | 0:85b3fd62ea1a | 456 | /* Blocking mode: Polling */ |
NYX | 0:85b3fd62ea1a | 457 | HAL_StatusTypeDef HAL_SPDIFRX_ReceiveDataFlow(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size, uint32_t Timeout); |
NYX | 0:85b3fd62ea1a | 458 | HAL_StatusTypeDef HAL_SPDIFRX_ReceiveControlFlow(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size, uint32_t Timeout); |
NYX | 0:85b3fd62ea1a | 459 | |
NYX | 0:85b3fd62ea1a | 460 | /* Non-Blocking mode: Interrupt */ |
NYX | 0:85b3fd62ea1a | 461 | HAL_StatusTypeDef HAL_SPDIFRX_ReceiveControlFlow_IT(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size); |
NYX | 0:85b3fd62ea1a | 462 | HAL_StatusTypeDef HAL_SPDIFRX_ReceiveDataFlow_IT(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size); |
NYX | 0:85b3fd62ea1a | 463 | void HAL_SPDIFRX_IRQHandler(SPDIFRX_HandleTypeDef *hspdif); |
NYX | 0:85b3fd62ea1a | 464 | |
NYX | 0:85b3fd62ea1a | 465 | /* Non-Blocking mode: DMA */ |
NYX | 0:85b3fd62ea1a | 466 | HAL_StatusTypeDef HAL_SPDIFRX_ReceiveControlFlow_DMA(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size); |
NYX | 0:85b3fd62ea1a | 467 | HAL_StatusTypeDef HAL_SPDIFRX_ReceiveDataFlow_DMA(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size); |
NYX | 0:85b3fd62ea1a | 468 | |
NYX | 0:85b3fd62ea1a | 469 | HAL_StatusTypeDef HAL_SPDIFRX_DMAStop(SPDIFRX_HandleTypeDef *hspdif); |
NYX | 0:85b3fd62ea1a | 470 | |
NYX | 0:85b3fd62ea1a | 471 | /* Callbacks used in non blocking modes (Interrupt and DMA) *******************/ |
NYX | 0:85b3fd62ea1a | 472 | void HAL_SPDIFRX_RxHalfCpltCallback(SPDIFRX_HandleTypeDef *hspdif); |
NYX | 0:85b3fd62ea1a | 473 | void HAL_SPDIFRX_RxCpltCallback(SPDIFRX_HandleTypeDef *hspdif); |
NYX | 0:85b3fd62ea1a | 474 | void HAL_SPDIFRX_ErrorCallback(SPDIFRX_HandleTypeDef *hspdif); |
NYX | 0:85b3fd62ea1a | 475 | void HAL_SPDIFRX_CxHalfCpltCallback(SPDIFRX_HandleTypeDef *hspdif); |
NYX | 0:85b3fd62ea1a | 476 | void HAL_SPDIFRX_CxCpltCallback(SPDIFRX_HandleTypeDef *hspdif); |
NYX | 0:85b3fd62ea1a | 477 | /** |
NYX | 0:85b3fd62ea1a | 478 | * @} |
NYX | 0:85b3fd62ea1a | 479 | */ |
NYX | 0:85b3fd62ea1a | 480 | |
NYX | 0:85b3fd62ea1a | 481 | /** @addtogroup SPDIFRX_Exported_Functions_Group3 |
NYX | 0:85b3fd62ea1a | 482 | * @{ |
NYX | 0:85b3fd62ea1a | 483 | */ |
NYX | 0:85b3fd62ea1a | 484 | /* Peripheral Control and State functions ************************************/ |
NYX | 0:85b3fd62ea1a | 485 | HAL_SPDIFRX_StateTypeDef HAL_SPDIFRX_GetState(SPDIFRX_HandleTypeDef *hspdif); |
NYX | 0:85b3fd62ea1a | 486 | uint32_t HAL_SPDIFRX_GetError(SPDIFRX_HandleTypeDef *hspdif); |
NYX | 0:85b3fd62ea1a | 487 | /** |
NYX | 0:85b3fd62ea1a | 488 | * @} |
NYX | 0:85b3fd62ea1a | 489 | */ |
NYX | 0:85b3fd62ea1a | 490 | |
NYX | 0:85b3fd62ea1a | 491 | /** |
NYX | 0:85b3fd62ea1a | 492 | * @} |
NYX | 0:85b3fd62ea1a | 493 | */ |
NYX | 0:85b3fd62ea1a | 494 | /* Private types -------------------------------------------------------------*/ |
NYX | 0:85b3fd62ea1a | 495 | /* Private variables ---------------------------------------------------------*/ |
NYX | 0:85b3fd62ea1a | 496 | /* Private constants ---------------------------------------------------------*/ |
NYX | 0:85b3fd62ea1a | 497 | /* Private macros ------------------------------------------------------------*/ |
NYX | 0:85b3fd62ea1a | 498 | /** @defgroup SPDIFRX_Private_Macros SPDIFRX Private Macros |
NYX | 0:85b3fd62ea1a | 499 | * @{ |
NYX | 0:85b3fd62ea1a | 500 | */ |
NYX | 0:85b3fd62ea1a | 501 | #define IS_SPDIFRX_INPUT_SELECT(INPUT) (((INPUT) == SPDIFRX_INPUT_IN1) || \ |
NYX | 0:85b3fd62ea1a | 502 | ((INPUT) == SPDIFRX_INPUT_IN2) || \ |
NYX | 0:85b3fd62ea1a | 503 | ((INPUT) == SPDIFRX_INPUT_IN3) || \ |
NYX | 0:85b3fd62ea1a | 504 | ((INPUT) == SPDIFRX_INPUT_IN0)) |
NYX | 0:85b3fd62ea1a | 505 | #define IS_SPDIFRX_MAX_RETRIES(RET) (((RET) == SPDIFRX_MAXRETRIES_NONE) || \ |
NYX | 0:85b3fd62ea1a | 506 | ((RET) == SPDIFRX_MAXRETRIES_3) || \ |
NYX | 0:85b3fd62ea1a | 507 | ((RET) == SPDIFRX_MAXRETRIES_15) || \ |
NYX | 0:85b3fd62ea1a | 508 | ((RET) == SPDIFRX_MAXRETRIES_63)) |
NYX | 0:85b3fd62ea1a | 509 | #define IS_SPDIFRX_WAIT_FOR_ACTIVITY(VAL) (((VAL) == SPDIFRX_WAITFORACTIVITY_ON) || \ |
NYX | 0:85b3fd62ea1a | 510 | ((VAL) == SPDIFRX_WAITFORACTIVITY_OFF)) |
NYX | 0:85b3fd62ea1a | 511 | #define IS_PREAMBLE_TYPE_MASK(VAL) (((VAL) == SPDIFRX_PREAMBLETYPEMASK_ON) || \ |
NYX | 0:85b3fd62ea1a | 512 | ((VAL) == SPDIFRX_PREAMBLETYPEMASK_OFF)) |
NYX | 0:85b3fd62ea1a | 513 | #define IS_VALIDITY_MASK(VAL) (((VAL) == SPDIFRX_VALIDITYMASK_OFF) || \ |
NYX | 0:85b3fd62ea1a | 514 | ((VAL) == SPDIFRX_VALIDITYMASK_ON)) |
NYX | 0:85b3fd62ea1a | 515 | #define IS_PARITY_ERROR_MASK(VAL) (((VAL) == SPDIFRX_PARITYERRORMASK_OFF) || \ |
NYX | 0:85b3fd62ea1a | 516 | ((VAL) == SPDIFRX_PARITYERRORMASK_ON)) |
NYX | 0:85b3fd62ea1a | 517 | #define IS_SPDIFRX_CHANNEL(CHANNEL) (((CHANNEL) == SPDIFRX_CHANNEL_A) || \ |
NYX | 0:85b3fd62ea1a | 518 | ((CHANNEL) == SPDIFRX_CHANNEL_B)) |
NYX | 0:85b3fd62ea1a | 519 | #define IS_SPDIFRX_DATA_FORMAT(FORMAT) (((FORMAT) == SPDIFRX_DATAFORMAT_LSB) || \ |
NYX | 0:85b3fd62ea1a | 520 | ((FORMAT) == SPDIFRX_DATAFORMAT_MSB) || \ |
NYX | 0:85b3fd62ea1a | 521 | ((FORMAT) == SPDIFRX_DATAFORMAT_32BITS)) |
NYX | 0:85b3fd62ea1a | 522 | #define IS_STEREO_MODE(MODE) (((MODE) == SPDIFRX_STEREOMODE_DISABLE) || \ |
NYX | 0:85b3fd62ea1a | 523 | ((MODE) == SPDIFRX_STEREOMODE_ENABLE)) |
NYX | 0:85b3fd62ea1a | 524 | |
NYX | 0:85b3fd62ea1a | 525 | #define IS_CHANNEL_STATUS_MASK(VAL) (((VAL) == SPDIFRX_CHANNELSTATUS_ON) || \ |
NYX | 0:85b3fd62ea1a | 526 | ((VAL) == SPDIFRX_CHANNELSTATUS_OFF)) |
NYX | 0:85b3fd62ea1a | 527 | /** |
NYX | 0:85b3fd62ea1a | 528 | * @} |
NYX | 0:85b3fd62ea1a | 529 | */ |
NYX | 0:85b3fd62ea1a | 530 | |
NYX | 0:85b3fd62ea1a | 531 | /* Private functions ---------------------------------------------------------*/ |
NYX | 0:85b3fd62ea1a | 532 | /** @defgroup SPDIFRX_Private_Functions SPDIFRX Private Functions |
NYX | 0:85b3fd62ea1a | 533 | * @{ |
NYX | 0:85b3fd62ea1a | 534 | */ |
NYX | 0:85b3fd62ea1a | 535 | /** |
NYX | 0:85b3fd62ea1a | 536 | * @} |
NYX | 0:85b3fd62ea1a | 537 | */ |
NYX | 0:85b3fd62ea1a | 538 | |
NYX | 0:85b3fd62ea1a | 539 | /** |
NYX | 0:85b3fd62ea1a | 540 | * @} |
NYX | 0:85b3fd62ea1a | 541 | */ |
NYX | 0:85b3fd62ea1a | 542 | |
NYX | 0:85b3fd62ea1a | 543 | /** |
NYX | 0:85b3fd62ea1a | 544 | * @} |
NYX | 0:85b3fd62ea1a | 545 | */ |
NYX | 0:85b3fd62ea1a | 546 | #endif /* STM32F446xx */ |
NYX | 0:85b3fd62ea1a | 547 | |
NYX | 0:85b3fd62ea1a | 548 | #ifdef __cplusplus |
NYX | 0:85b3fd62ea1a | 549 | } |
NYX | 0:85b3fd62ea1a | 550 | #endif |
NYX | 0:85b3fd62ea1a | 551 | |
NYX | 0:85b3fd62ea1a | 552 | |
NYX | 0:85b3fd62ea1a | 553 | #endif /* __STM32F4xx_HAL_SPDIFRX_H */ |
NYX | 0:85b3fd62ea1a | 554 | |
NYX | 0:85b3fd62ea1a | 555 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |