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