RTEMS 6.1-rc1
fsl_sai_sdma.h
1/*
2 * Copyright 2017 - 2021 NXP
3 * All rights reserved.
4 *
5 *
6 * SPDX-License-Identifier: BSD-3-Clause
7 */
8#ifndef _FSL_SAI_SDMA_H_
9#define _FSL_SAI_SDMA_H_
10
11#include "fsl_sai.h"
12#include "fsl_sdma.h"
13
20/*******************************************************************************
21 * Definitions
22 ******************************************************************************/
23
26#define FSL_SAI_SDMA_DRIVER_VERSION (MAKE_VERSION(2, 5, 3))
28
30
32typedef void (*sai_sdma_callback_t)(I2S_Type *base, sai_sdma_handle_t *handle, status_t status, void *userData);
33
36{
37 sdma_handle_t *dmaHandle;
38 uint8_t bytesPerFrame;
39 uint8_t channel;
40 uint8_t channelNums;
41 uint8_t channelMask;
42 uint8_t fifoOffset;
43 uint32_t count;
44 uint32_t state;
45 uint32_t eventSource;
47 void *userData;
48 sdma_buffer_descriptor_t bdPool[SAI_XFER_QUEUE_SIZE];
51 volatile uint8_t queueUser;
52 volatile uint8_t queueDriver;
53};
54
55/*******************************************************************************
56 * APIs
57 ******************************************************************************/
58#if defined(__cplusplus)
59extern "C" {
60#endif
81 sai_sdma_handle_t *handle,
82 sai_sdma_callback_t callback,
83 void *userData,
84 sdma_handle_t *dmaHandle,
85 uint32_t eventSource);
86
102 sai_sdma_handle_t *handle,
103 sai_sdma_callback_t callback,
104 void *userData,
105 sdma_handle_t *dmaHandle,
106 uint32_t eventSource);
107
124 sai_sdma_handle_t *handle,
126 uint32_t mclkSourceClockHz,
127 uint32_t bclkSourceClockHz);
128
145 sai_sdma_handle_t *handle,
147 uint32_t mclkSourceClockHz,
148 uint32_t bclkSourceClockHz);
149
164
179
187
195
203
211
220
231#if defined(__cplusplus)
232}
233#endif
234
238#endif
int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:225
#define SAI_XFER_QUEUE_SIZE
SAI transfer queue size, user can refine it according to use case.
Definition: fsl_sai.h:204
void SAI_TransferTerminateReceiveSDMA(I2S_Type *base, sai_sdma_handle_t *handle)
Terminate all the SAI sdma receive transfer.
void SAI_TransferRxSetFormatSDMA(I2S_Type *base, sai_sdma_handle_t *handle, sai_transfer_format_t *format, uint32_t mclkSourceClockHz, uint32_t bclkSourceClockHz)
Configures the SAI Rx audio format.
status_t SAI_TransferSendSDMA(I2S_Type *base, sai_sdma_handle_t *handle, sai_transfer_t *xfer)
Performs a non-blocking SAI transfer using DMA.
void SAI_TransferTxSetFormatSDMA(I2S_Type *base, sai_sdma_handle_t *handle, sai_transfer_format_t *format, uint32_t mclkSourceClockHz, uint32_t bclkSourceClockHz)
Configures the SAI Tx audio format.
status_t SAI_TransferReceiveSDMA(I2S_Type *base, sai_sdma_handle_t *handle, sai_transfer_t *xfer)
Performs a non-blocking SAI receive using SDMA.
void SAI_TransferAbortReceiveSDMA(I2S_Type *base, sai_sdma_handle_t *handle)
Aborts a SAI receive using SDMA.
void SAI_TransferAbortSendSDMA(I2S_Type *base, sai_sdma_handle_t *handle)
Aborts a SAI transfer using SDMA.
void SAI_TransferTxSetConfigSDMA(I2S_Type *base, sai_sdma_handle_t *handle, sai_transceiver_t *saiConfig)
void SAI_TransferTerminateSendSDMA(I2S_Type *base, sai_sdma_handle_t *handle)
Terminate all the SAI sdma send transfer.
void SAI_TransferRxSetConfigSDMA(I2S_Type *base, sai_sdma_handle_t *handle, sai_transceiver_t *saiConfig)
void(* sai_sdma_callback_t)(I2S_Type *base, sai_sdma_handle_t *handle, status_t status, void *userData)
SAI SDMA transfer callback function for finish and error.
Definition: fsl_sai_sdma.h:32
void SAI_TransferRxCreateHandleSDMA(I2S_Type *base, sai_sdma_handle_t *handle, sai_sdma_callback_t callback, void *userData, sdma_handle_t *dmaHandle, uint32_t eventSource)
Initializes the SAI Rx SDMA handle.
void SAI_TransferTxCreateHandleSDMA(I2S_Type *base, sai_sdma_handle_t *handle, sai_sdma_callback_t callback, void *userData, sdma_handle_t *dmaHandle, uint32_t eventSource)
Initializes the SAI SDMA handle.
Definition: MIMXRT1052.h:23296
SAI DMA transfer handle, users should not touch the content of the handle.
Definition: fsl_sai_sdma.h:36
uint32_t count
Definition: fsl_sai_sdma.h:43
sai_sdma_callback_t callback
Definition: fsl_sai_sdma.h:46
size_t transferSize[SAI_XFER_QUEUE_SIZE]
Definition: fsl_sai_sdma.h:50
volatile uint8_t queueDriver
Definition: fsl_sai_sdma.h:52
void * userData
Definition: fsl_sai_sdma.h:47
uint8_t channelNums
Definition: fsl_sai_sdma.h:40
sdma_handle_t * dmaHandle
Definition: fsl_sai_sdma.h:37
uint8_t channel
Definition: fsl_sai_sdma.h:39
volatile uint8_t queueUser
Definition: fsl_sai_sdma.h:51
sdma_buffer_descriptor_t bdPool[SAI_XFER_QUEUE_SIZE]
Definition: fsl_sai_sdma.h:48
uint8_t channelMask
Definition: fsl_sai_sdma.h:41
sai_transfer_t saiQueue[SAI_XFER_QUEUE_SIZE]
Definition: fsl_sai_sdma.h:49
uint32_t state
Definition: fsl_sai_sdma.h:44
uint32_t eventSource
Definition: fsl_sai_sdma.h:45
uint8_t fifoOffset
Definition: fsl_sai_sdma.h:42
uint8_t bytesPerFrame
Definition: fsl_sai_sdma.h:38
sai transceiver configurations
Definition: fsl_sai.h:395
sai transfer format
Definition: fsl_sai.h:271
SAI transfer structure.
Definition: fsl_sai.h:415
Definition: mknod-pack_dev.c:254