STM32F439xx HAL User Manual
|
SAI HAL module driver. This file provides firmware functions to manage the following functionalities of the Serial Audio Interface (SAI) peripheral: + Initialization/de-initialization functions + I/O operation functions + Peripheral Control functions + Peripheral State functions. More...
#include "stm32f4xx_hal.h"
Go to the source code of this file.
Defines | |
#define | SAI_FIFO_SIZE 8U |
#define | SAI_DEFAULT_TIMEOUT 4U /* 4ms */ |
Enumerations | |
enum | SAI_ModeTypedef { SAI_MODE_DMA, SAI_MODE_IT } |
Functions | |
static void | SAI_FillFifo (SAI_HandleTypeDef *hsai) |
Fill the fifo. | |
static uint32_t | SAI_InterruptFlag (SAI_HandleTypeDef *hsai, uint32_t mode) |
Return the interrupt flag to set according the SAI setup. | |
static HAL_StatusTypeDef | SAI_InitI2S (SAI_HandleTypeDef *hsai, uint32_t protocol, uint32_t datasize, uint32_t nbslot) |
Initialize the SAI I2S protocol according to the specified parameters in the SAI_InitTypeDef and create the associated handle. | |
static HAL_StatusTypeDef | SAI_InitPCM (SAI_HandleTypeDef *hsai, uint32_t protocol, uint32_t datasize, uint32_t nbslot) |
Initialize the SAI PCM protocol according to the specified parameters in the SAI_InitTypeDef and create the associated handle. | |
static HAL_StatusTypeDef | SAI_Disable (SAI_HandleTypeDef *hsai) |
Disable the SAI and wait for the disabling. | |
static void | SAI_Transmit_IT8Bit (SAI_HandleTypeDef *hsai) |
Tx Handler for Transmit in Interrupt mode 8-Bit transfer. | |
static void | SAI_Transmit_IT16Bit (SAI_HandleTypeDef *hsai) |
Tx Handler for Transmit in Interrupt mode for 16-Bit transfer. | |
static void | SAI_Transmit_IT32Bit (SAI_HandleTypeDef *hsai) |
Tx Handler for Transmit in Interrupt mode for 32-Bit transfer. | |
static void | SAI_Receive_IT8Bit (SAI_HandleTypeDef *hsai) |
Rx Handler for Receive in Interrupt mode 8-Bit transfer. | |
static void | SAI_Receive_IT16Bit (SAI_HandleTypeDef *hsai) |
Rx Handler for Receive in Interrupt mode for 16-Bit transfer. | |
static void | SAI_Receive_IT32Bit (SAI_HandleTypeDef *hsai) |
Rx Handler for Receive in Interrupt mode for 32-Bit transfer. | |
static void | SAI_DMATxCplt (DMA_HandleTypeDef *hdma) |
DMA SAI transmit process complete callback. | |
static void | SAI_DMATxHalfCplt (DMA_HandleTypeDef *hdma) |
DMA SAI transmit process half complete callback. | |
static void | SAI_DMARxCplt (DMA_HandleTypeDef *hdma) |
DMA SAI receive process complete callback. | |
static void | SAI_DMARxHalfCplt (DMA_HandleTypeDef *hdma) |
DMA SAI receive process half complete callback. | |
static void | SAI_DMAError (DMA_HandleTypeDef *hdma) |
DMA SAI communication error callback. | |
static void | SAI_DMAAbort (DMA_HandleTypeDef *hdma) |
DMA SAI Abort callback. | |
HAL_StatusTypeDef | HAL_SAI_InitProtocol (SAI_HandleTypeDef *hsai, uint32_t protocol, uint32_t datasize, uint32_t nbslot) |
Initialize the structure FrameInit, SlotInit and the low part of Init according to the specified parameters and call the function HAL_SAI_Init to initialize the SAI block. | |
HAL_StatusTypeDef | HAL_SAI_Init (SAI_HandleTypeDef *hsai) |
Initialize the SAI according to the specified parameters. | |
HAL_StatusTypeDef | HAL_SAI_DeInit (SAI_HandleTypeDef *hsai) |
DeInitialize the SAI peripheral. | |
__weak void | HAL_SAI_MspInit (SAI_HandleTypeDef *hsai) |
Initialize the SAI MSP. | |
__weak void | HAL_SAI_MspDeInit (SAI_HandleTypeDef *hsai) |
DeInitialize the SAI MSP. | |
HAL_StatusTypeDef | HAL_SAI_Transmit (SAI_HandleTypeDef *hsai, uint8_t *pData, uint16_t Size, uint32_t Timeout) |
Transmit an amount of data in blocking mode. | |
HAL_StatusTypeDef | HAL_SAI_Receive (SAI_HandleTypeDef *hsai, uint8_t *pData, uint16_t Size, uint32_t Timeout) |
Receive an amount of data in blocking mode. | |
HAL_StatusTypeDef | HAL_SAI_Transmit_IT (SAI_HandleTypeDef *hsai, uint8_t *pData, uint16_t Size) |
Transmit an amount of data in non-blocking mode with Interrupt. | |
HAL_StatusTypeDef | HAL_SAI_Receive_IT (SAI_HandleTypeDef *hsai, uint8_t *pData, uint16_t Size) |
Receive an amount of data in non-blocking mode with Interrupt. | |
HAL_StatusTypeDef | HAL_SAI_DMAPause (SAI_HandleTypeDef *hsai) |
Pause the audio stream playing from the Media. | |
HAL_StatusTypeDef | HAL_SAI_DMAResume (SAI_HandleTypeDef *hsai) |
Resume the audio stream playing from the Media. | |
HAL_StatusTypeDef | HAL_SAI_DMAStop (SAI_HandleTypeDef *hsai) |
Stop the audio stream playing from the Media. | |
HAL_StatusTypeDef | HAL_SAI_Abort (SAI_HandleTypeDef *hsai) |
Abort the current transfer and disable the SAI. | |
HAL_StatusTypeDef | HAL_SAI_Transmit_DMA (SAI_HandleTypeDef *hsai, uint8_t *pData, uint16_t Size) |
Transmit an amount of data in non-blocking mode with DMA. | |
HAL_StatusTypeDef | HAL_SAI_Receive_DMA (SAI_HandleTypeDef *hsai, uint8_t *pData, uint16_t Size) |
Receive an amount of data in non-blocking mode with DMA. | |
HAL_StatusTypeDef | HAL_SAI_EnableTxMuteMode (SAI_HandleTypeDef *hsai, uint16_t val) |
Enable the Tx mute mode. | |
HAL_StatusTypeDef | HAL_SAI_DisableTxMuteMode (SAI_HandleTypeDef *hsai) |
Disable the Tx mute mode. | |
HAL_StatusTypeDef | HAL_SAI_EnableRxMuteMode (SAI_HandleTypeDef *hsai, SAIcallback callback, uint16_t counter) |
Enable the Rx mute detection. | |
HAL_StatusTypeDef | HAL_SAI_DisableRxMuteMode (SAI_HandleTypeDef *hsai) |
Disable the Rx mute detection. | |
void | HAL_SAI_IRQHandler (SAI_HandleTypeDef *hsai) |
Handle SAI interrupt request. | |
__weak void | HAL_SAI_TxCpltCallback (SAI_HandleTypeDef *hsai) |
Tx Transfer completed callback. | |
__weak void | HAL_SAI_TxHalfCpltCallback (SAI_HandleTypeDef *hsai) |
Tx Transfer Half completed callback. | |
__weak void | HAL_SAI_RxCpltCallback (SAI_HandleTypeDef *hsai) |
Rx Transfer completed callback. | |
__weak void | HAL_SAI_RxHalfCpltCallback (SAI_HandleTypeDef *hsai) |
Rx Transfer half completed callback. | |
__weak void | HAL_SAI_ErrorCallback (SAI_HandleTypeDef *hsai) |
SAI error callback. | |
HAL_SAI_StateTypeDef | HAL_SAI_GetState (SAI_HandleTypeDef *hsai) |
Return the SAI handle state. | |
uint32_t | HAL_SAI_GetError (SAI_HandleTypeDef *hsai) |
Return the SAI error code. |
SAI HAL module driver. This file provides firmware functions to manage the following functionalities of the Serial Audio Interface (SAI) peripheral: + Initialization/de-initialization functions + I/O operation functions + Peripheral Control functions + Peripheral State functions.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file stm32f4xx_hal_sai.c.