Kinetis SDK v.1.3 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
fsl_sai_driver.h File Reference
#include "fsl_sai_hal.h"
#include "fsl_os_abstraction.h"
#include "fsl_dma_driver.h"

Data Structures

struct  sai_data_format_t
 Defines the PCM data format. More...
 
struct  sai_state_t
 SAI internal state Users should allocate and transfer memory to the PD during the initialization function. More...
 
struct  sai_user_config_t
 The description structure for the SAI transmit/receive module. More...
 

Typedefs

typedef void(* sai_callback_t )(void *parameter)
 SAI callback function.
 

Enumerations

enum  sai_status_t {
  kStatus_SAI_Success = 0U,
  kStatus_SAI_Fail = 1U,
  kStatus_SAI_DeviceBusy = 2U
}
 Status structure for SAI.
 

Functions

sai_status_t SAI_DRV_TxInit (uint32_t instance, sai_user_config_t *config, sai_state_t *state)
 Initializes the SAI module. More...
 
sai_status_t SAI_DRV_RxInit (uint32_t instance, sai_user_config_t *config, sai_state_t *state)
 Initializes the SAI receive module. More...
 
void SAI_DRV_TxGetDefaultSetting (sai_user_config_t *config)
 Gets the default setting of the user configuration. More...
 
void SAI_DRV_RxGetDefaultSetting (sai_user_config_t *config)
 Gets the default settings of the user configuration. More...
 
sai_status_t SAI_DRV_TxDeinit (uint32_t instance)
 De-initializes the SAI transmit module. More...
 
sai_status_t SAI_DRV_RxDeinit (uint32_t instance)
 Deinitializes the SAI receive module. More...
 
sai_status_t SAI_DRV_TxConfigDataFormat (uint32_t instance, sai_data_format_t *format)
 Configures the audio data format of the transmit. More...
 
sai_status_t SAI_DRV_RxConfigDataFormat (uint32_t instance, sai_data_format_t *format)
 Configures the audio data format of the receive. More...
 
void SAI_DRV_TxStartModule (uint32_t instance)
 Starts the transmit transfer. More...
 
void SAI_DRV_RxStartModule (uint32_t instance)
 Starts the receive process. More...
 
void SAI_DRV_TxStopModule (uint32_t instance)
 Stops writing data to FIFO to disable the DMA or the interrupt request bit. More...
 
void SAI_DRV_RxStopModule (uint32_t instance)
 Stops receiving data from FIFO to disable the DMA or the interrupt request bit. More...
 
void SAI_DRV_TxSetIntCmd (uint32_t instance, bool enable)
 Enables or disables the transmit interrupt source. More...
 
void SAI_DRV_RxSetIntCmd (uint32_t instance, bool enable)
 Enables or disables the receive interrupt source. More...
 
void SAI_DRV_TxSetDmaCmd (uint32_t instance, bool enable)
 Enables or disables the transmit DMA source. More...
 
void SAI_DRV_RxSetDmaCmd (uint32_t instance, bool enable)
 Enables or disables the receive interrupt source. More...
 
static uint32_t SAI_DRV_TxGetFifoAddr (uint32_t instance, uint32_t fifo_channel)
 Gets the transmit FIFO address of the data channel. More...
 
static uint32_t SAI_DRV_RxGetFifoAddr (uint32_t instance, uint32_t fifo_channel)
 Gets the receive FIFO address of the data channel. More...
 
uint32_t SAI_DRV_SendDataInt (uint32_t instance, uint8_t *addr, uint32_t len)
 Sends data using interrupts. More...
 
uint32_t SAI_DRV_ReceiveDataInt (uint32_t instance, uint8_t *addr, uint32_t len)
 Receives data a certain length using interrupt way. More...
 
uint32_t SAI_DRV_SendDataDma (uint32_t instance, uint8_t *addr, uint32_t len)
 Sends data of a certain length using the DMA method. More...
 
uint32_t SAI_DRV_ReceiveDataDma (uint32_t instance, uint8_t *addr, uint32_t len)
 Receives data using the DMA. More...
 
void SAI_DRV_TxRegisterCallback (uint32_t instance, sai_callback_t callback, void *callback_param)
 Registers the callback function after completing a send. More...
 
void SAI_DRV_RxRegisterCallback (uint32_t instance, sai_callback_t callback, void *callback_param)
 Registers the callback function after completing a receive. More...
 
void SAI_DRV_TxIRQHandler (uint32_t instance)
 Default SAI transmit interrupt handler. More...
 
void SAI_DRV_RxIRQHandler (uint32_t instance)
 Default SAI receive interrupt handler. More...
 

Variables

I2S_Type *const g_saiBase [I2S_INSTANCE_COUNT]
 
const IRQn_Type g_saiTxIrqId [I2S_INSTANCE_COUNT]
 
const IRQn_Type g_saiRxIrqId [I2S_INSTANCE_COUNT]