RTEMS 6.1-rc2
Loading...
Searching...
No Matches
fsl_spdif_edma.h
1/*
2 * Copyright (c) 2016, Freescale Semiconductor, Inc.
3 * Copyright 2017-2020 NXP
4 * All rights reserved.
5 *
6 *
7 * SPDX-License-Identifier: BSD-3-Clause
8 */
9#ifndef _FSL_SPDIF_EDMA_H_
10#define _FSL_SPDIF_EDMA_H_
11
12#include "fsl_spdif.h"
13#include "fsl_edma.h"
14
20/*******************************************************************************
21 * Definitions
22 ******************************************************************************/
23
26#define FSL_SPDIF_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 0, 5))
28
30
32typedef void (*spdif_edma_callback_t)(SPDIF_Type *base, spdif_edma_handle_t *handle, status_t status, void *userData);
33
36{
37 uint8_t *leftData;
38 uint8_t *rightData;
39 size_t dataSize;
41
44{
47 uint8_t nbytes;
48 uint8_t count;
49 uint32_t state;
51 void *userData;
57 volatile uint8_t queueUser;
58 volatile uint8_t queueDriver;
59};
60
61/*******************************************************************************
62 * APIs
63 ******************************************************************************/
64#if defined(__cplusplus)
65extern "C" {
66#endif
67
88 spdif_edma_handle_t *handle,
89 spdif_edma_callback_t callback,
90 void *userData,
91 edma_handle_t *dmaLeftHandle,
92 edma_handle_t *dmaRightHandle);
93
109 spdif_edma_handle_t *handle,
110 spdif_edma_callback_t callback,
111 void *userData,
112 edma_handle_t *dmaLeftHandle,
113 edma_handle_t *dmaRightHandle);
114
129
144
152
160
171
182
185#if defined(__cplusplus)
186}
187#endif
188
192#endif
int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:225
status_t SPDIF_TransferGetReceiveCountEDMA(SPDIF_Type *base, spdif_edma_handle_t *handle, size_t *count)
Gets byte count received by SPDIF.
Definition: fsl_spdif_edma.c:580
void SPDIF_TransferAbortReceiveEDMA(SPDIF_Type *base, spdif_edma_handle_t *handle)
Aborts a SPDIF receive using eDMA.
Definition: fsl_spdif_edma.c:521
void SPDIF_TransferAbortSendEDMA(SPDIF_Type *base, spdif_edma_handle_t *handle)
Aborts a SPDIF transfer using eDMA.
Definition: fsl_spdif_edma.c:494
status_t SPDIF_TransferReceiveEDMA(SPDIF_Type *base, spdif_edma_handle_t *handle, spdif_edma_transfer_t *xfer)
Performs a non-blocking SPDIF receive using eDMA.
Definition: fsl_spdif_edma.c:429
void(* spdif_edma_callback_t)(SPDIF_Type *base, spdif_edma_handle_t *handle, status_t status, void *userData)
SPDIF eDMA transfer callback function for finish and error.
Definition: fsl_spdif_edma.h:32
status_t SPDIF_TransferSendEDMA(SPDIF_Type *base, spdif_edma_handle_t *handle, spdif_edma_transfer_t *xfer)
Performs a non-blocking SPDIF transfer using DMA.
Definition: fsl_spdif_edma.c:358
void SPDIF_TransferRxCreateHandleEDMA(SPDIF_Type *base, spdif_edma_handle_t *handle, spdif_edma_callback_t callback, void *userData, edma_handle_t *dmaLeftHandle, edma_handle_t *dmaRightHandle)
Initializes the SPDIF Rx eDMA handle.
Definition: fsl_spdif_edma.c:308
void SPDIF_TransferTxCreateHandleEDMA(SPDIF_Type *base, spdif_edma_handle_t *handle, spdif_edma_callback_t callback, void *userData, edma_handle_t *dmaLeftHandle, edma_handle_t *dmaRightHandle)
Initializes the SPDIF eDMA handle.
Definition: fsl_spdif_edma.c:256
status_t SPDIF_TransferGetSendCountEDMA(SPDIF_Type *base, spdif_edma_handle_t *handle, size_t *count)
Gets byte count sent by SPDIF.
Definition: fsl_spdif_edma.c:551
struct _spdif_edma_transfer spdif_edma_transfer_t
SPDIF transfer structure.
#define SPDIF_XFER_QUEUE_SIZE
SPDIF transfer queue size, user can refine it according to use case.
Definition: fsl_spdif.h:156
Definition: MIMXRT1052.h:42276
eDMA transfer handle structure
Definition: fsl_edma.h:244
eDMA TCD.
Definition: fsl_edma.h:205
SPDIF DMA transfer handle, users should not touch the content of the handle.
Definition: fsl_spdif_edma.h:44
volatile uint8_t queueUser
Definition: fsl_spdif_edma.h:57
edma_handle_t * dmaRightHandle
Definition: fsl_spdif_edma.h:46
uint32_t state
Definition: fsl_spdif_edma.h:49
void * userData
Definition: fsl_spdif_edma.h:51
spdif_edma_callback_t callback
Definition: fsl_spdif_edma.h:50
size_t transferSize[SPDIF_XFER_QUEUE_SIZE]
Definition: fsl_spdif_edma.h:55
edma_tcd_t rightTcd[SPDIF_XFER_QUEUE_SIZE+1U]
Definition: fsl_spdif_edma.h:53
edma_tcd_t leftTcd[SPDIF_XFER_QUEUE_SIZE+1U]
Definition: fsl_spdif_edma.h:52
uint8_t nbytes
Definition: fsl_spdif_edma.h:47
spdif_edma_transfer_t spdifQueue[SPDIF_XFER_QUEUE_SIZE]
Definition: fsl_spdif_edma.h:54
uint8_t count
Definition: fsl_spdif_edma.h:48
edma_handle_t * dmaLeftHandle
Definition: fsl_spdif_edma.h:45
volatile uint8_t queueDriver
Definition: fsl_spdif_edma.h:58
SPDIF transfer structure.
Definition: fsl_spdif_edma.h:36
size_t dataSize
Definition: fsl_spdif_edma.h:39
uint8_t * rightData
Definition: fsl_spdif_edma.h:38
uint8_t * leftData
Definition: fsl_spdif_edma.h:37