fsl_sai_edma.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, Freescale Semiconductor, Inc.
3  * Copyright 2016-2017 NXP
4  * All rights reserved.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  */
8 #ifndef _FSL_SAI_EDMA_H_
9 #define _FSL_SAI_EDMA_H_
10 
11 #include "fsl_edma.h"
12 #include "fsl_sai.h"
13 
19 /*******************************************************************************
20  * Definitions
21  ******************************************************************************/
22 
25 #define FSL_SAI_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 3, 1))
27 
29 
31 typedef void (*sai_edma_callback_t)(I2S_Type *base, sai_edma_handle_t *handle, status_t status, void *userData);
32 
35 {
37  uint8_t nbytes;
38  uint8_t bytesPerFrame;
39  uint8_t channel;
40  uint8_t count;
41  uint32_t state;
43  void *userData;
44  uint8_t tcd[(SAI_XFER_QUEUE_SIZE + 1U) * sizeof(edma_tcd_t)];
47  volatile uint8_t queueUser;
48  volatile uint8_t queueDriver;
49 };
50 
51 /*******************************************************************************
52  * APIs
53  ******************************************************************************/
54 #if defined(__cplusplus)
55 extern "C" {
56 #endif
57 
77  sai_edma_handle_t *handle,
78  sai_edma_callback_t callback,
79  void *userData,
80  edma_handle_t *txDmaHandle);
81 
96  sai_edma_handle_t *handle,
97  sai_edma_callback_t callback,
98  void *userData,
99  edma_handle_t *rxDmaHandle);
100 
117  sai_edma_handle_t *handle,
118  sai_transfer_format_t *format,
119  uint32_t mclkSourceClockHz,
120  uint32_t bclkSourceClockHz);
121 
138  sai_edma_handle_t *handle,
139  sai_transfer_format_t *format,
140  uint32_t mclkSourceClockHz,
141  uint32_t bclkSourceClockHz);
142 
152 
162 
177 
192 
203 
214 
225 
236 
247 
258 
261 #if defined(__cplusplus)
262 }
263 #endif
264 
268 #endif
_edma_handle
eDMA transfer handle structure
Definition: fsl_edma.h:243
sai_edma_handle::userData
void * userData
Definition: fsl_sai_edma.h:43
I2S_Type
Definition: MIMXRT1052.h:19867
sai_edma_handle::nbytes
uint8_t nbytes
Definition: fsl_sai_edma.h:37
SAI_TransferRxSetConfigEDMA
void SAI_TransferRxSetConfigEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_transceiver_t *saiConfig)
Configures the SAI Rx.
Definition: fsl_sai_edma.c:358
sai_edma_handle
SAI DMA transfer handle, users should not touch the content of the handle.
Definition: fsl_sai_edma.h:34
sai_edma_handle::saiQueue
sai_transfer_t saiQueue[SAI_XFER_QUEUE_SIZE]
Definition: fsl_sai_edma.h:45
sai_edma_handle::channel
uint8_t channel
Definition: fsl_sai_edma.h:39
SAI_TransferRxSetFormatEDMA
void SAI_TransferRxSetFormatEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_transfer_format_t *format, uint32_t mclkSourceClockHz, uint32_t bclkSourceClockHz)
Configures the SAI Rx audio format.
Definition: fsl_sai_edma.c:317
SAI_TransferTerminateReceiveEDMA
void SAI_TransferTerminateReceiveEDMA(I2S_Type *base, sai_edma_handle_t *handle)
Terminate all SAI receive.
Definition: fsl_sai_edma.c:635
SAI_TransferSendEDMA
status_t SAI_TransferSendEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_transfer_t *xfer)
Performs a non-blocking SAI transfer using DMA.
Definition: fsl_sai_edma.c:400
SAI_XFER_QUEUE_SIZE
#define SAI_XFER_QUEUE_SIZE
SAI transfer queue size, user can refine it according to use case.
Definition: fsl_sai.h:204
SAI_TransferRxCreateHandleEDMA
void SAI_TransferRxCreateHandleEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_edma_callback_t callback, void *userData, edma_handle_t *rxDmaHandle)
Initializes the SAI Rx eDMA handle.
Definition: fsl_sai_edma.c:190
sai_edma_handle::callback
sai_edma_callback_t callback
Definition: fsl_sai_edma.h:42
SAI_TransferGetSendCountEDMA
status_t SAI_TransferGetSendCountEDMA(I2S_Type *base, sai_edma_handle_t *handle, size_t *count)
Gets byte count sent by SAI.
Definition: fsl_sai_edma.c:660
SAI_TransferTxSetFormatEDMA
void SAI_TransferTxSetFormatEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_transfer_format_t *format, uint32_t mclkSourceClockHz, uint32_t bclkSourceClockHz)
Configures the SAI Tx audio format.
Definition: fsl_sai_edma.c:233
fsl_sai.h
count
size_t count
Definition: porcupine/demo/c/dr_libs/tests/external/miniaudio/tests/test_common/ma_test_common.c:31
_sai_transceiver
sai transceiver configurations
Definition: fsl_sai.h:394
sai_edma_handle::transferSize
size_t transferSize[SAI_XFER_QUEUE_SIZE]
Definition: fsl_sai_edma.h:46
SAI_TransferGetReceiveCountEDMA
status_t SAI_TransferGetReceiveCountEDMA(I2S_Type *base, sai_edma_handle_t *handle, size_t *count)
Gets byte count received by SAI.
Definition: fsl_sai_edma.c:689
sai_edma_handle::queueDriver
volatile uint8_t queueDriver
Definition: fsl_sai_edma.h:48
sai_edma_handle::state
uint32_t state
Definition: fsl_sai_edma.h:41
SAI_TransferAbortReceiveEDMA
void SAI_TransferAbortReceiveEDMA(I2S_Type *base, sai_edma_handle_t *handle)
Aborts a SAI receive using eDMA.
Definition: fsl_sai_edma.c:570
sai_edma_handle::bytesPerFrame
uint8_t bytesPerFrame
Definition: fsl_sai_edma.h:38
fsl_edma.h
_sai_transfer_format
sai transfer format
Definition: fsl_sai.h:270
sai_edma_handle::count
uint8_t count
Definition: fsl_sai_edma.h:40
sai_edma_handle::queueUser
volatile uint8_t queueUser
Definition: fsl_sai_edma.h:47
sai_edma_callback_t
void(* sai_edma_callback_t)(I2S_Type *base, sai_edma_handle_t *handle, status_t status, void *userData)
SAI eDMA transfer callback function for finish and error.
Definition: fsl_sai_edma.h:31
_sai_transfer
SAI transfer structure.
Definition: fsl_sai.h:414
SAI_TransferTxSetConfigEDMA
void SAI_TransferTxSetConfigEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_transceiver_t *saiConfig)
Configures the SAI Tx.
Definition: fsl_sai_edma.c:274
SAI_TransferTxCreateHandleEDMA
void SAI_TransferTxCreateHandleEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_edma_callback_t callback, void *userData, edma_handle_t *txDmaHandle)
Initializes the SAI eDMA handle.
Definition: fsl_sai_edma.c:149
_edma_tcd
eDMA TCD.
Definition: fsl_edma.h:204
SAI_TransferReceiveEDMA
status_t SAI_TransferReceiveEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_transfer_t *xfer)
Performs a non-blocking SAI receive using eDMA.
Definition: fsl_sai_edma.c:467
status_t
int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:189
sai_edma_handle::tcd
uint8_t tcd[(SAI_XFER_QUEUE_SIZE+1U) *sizeof(edma_tcd_t)]
Definition: fsl_sai_edma.h:44
sai_edma_handle::dmaHandle
edma_handle_t * dmaHandle
Definition: fsl_sai_edma.h:36
SAI_TransferAbortSendEDMA
void SAI_TransferAbortSendEDMA(I2S_Type *base, sai_edma_handle_t *handle)
Aborts a SAI transfer using eDMA.
Definition: fsl_sai_edma.c:530
SAI_TransferTerminateSendEDMA
void SAI_TransferTerminateSendEDMA(I2S_Type *base, sai_edma_handle_t *handle)
Terminate all SAI send.
Definition: fsl_sai_edma.c:610


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:13:56