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