RTEMS 6.1-rc5
Loading...
Searching...
No Matches
fsl_lpspi_edma.h
1/*
2 * Copyright (c) 2015, Freescale Semiconductor, Inc.
3 * Copyright 2016-2022 NXP
4 * All rights reserved.
5 *
6 * SPDX-License-Identifier: BSD-3-Clause
7 */
8#ifndef _FSL_LPSPI_EDMA_H_
9#define _FSL_LPSPI_EDMA_H_
10
11#include "fsl_lpspi.h"
12#include "fsl_edma.h"
13
19/***********************************************************************************************************************
20 * Definitions
21 **********************************************************************************************************************/
25#define FSL_LPSPI_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 3, 1))
32
37
48 status_t status,
49 void *userData);
60 status_t status,
61 void *userData);
62
65{
66 volatile bool isPcsContinuous;
68 volatile bool isByteSwap;
70 volatile uint8_t fifoSize;
72 volatile uint8_t rxWatermark;
74 volatile uint8_t bytesEachWrite;
75 volatile uint8_t bytesEachRead;
77 volatile uint8_t bytesLastRead;
78 volatile bool isThereExtraRxBytes;
80 uint8_t *volatile txData;
81 uint8_t *volatile rxData;
82 volatile size_t txRemainingByteCount;
83 volatile size_t rxRemainingByteCount;
85 volatile uint32_t writeRegRemainingTimes;
86 volatile uint32_t readRegRemainingTimes;
88 uint32_t totalByteCount;
90 uint32_t txBuffIfNull;
91 uint32_t rxBuffIfNull;
93 uint32_t transmitCommand;
95 volatile uint8_t state;
97 uint8_t nbytes;
100 void *userData;
106};
107
110{
111 volatile bool isByteSwap;
113 volatile uint8_t fifoSize;
115 volatile uint8_t rxWatermark;
117 volatile uint8_t bytesEachWrite;
118 volatile uint8_t bytesEachRead;
120 volatile uint8_t bytesLastRead;
121 volatile bool isThereExtraRxBytes;
123 uint8_t nbytes;
125 uint8_t *volatile txData;
126 uint8_t *volatile rxData;
127 volatile size_t txRemainingByteCount;
128 volatile size_t rxRemainingByteCount;
130 volatile uint32_t writeRegRemainingTimes;
131 volatile uint32_t readRegRemainingTimes;
133 uint32_t totalByteCount;
135 uint32_t txBuffIfNull;
136 uint32_t rxBuffIfNull;
138 volatile uint8_t state;
140 uint32_t errorCount;
143 void *userData;
149};
150
151/***********************************************************************************************************************
152 * API
153 **********************************************************************************************************************/
154#if defined(__cplusplus)
155extern "C" {
156#endif /*_cplusplus*/
157
158/*Transactional APIs*/
159
182 void *userData,
183 edma_handle_t *edmaRxRegToRxDataHandle,
184 edma_handle_t *edmaTxDataToTxRegHandle);
185
204
214
226
250 void *userData,
251 edma_handle_t *edmaRxRegToRxDataHandle,
252 edma_handle_t *edmaTxDataToTxRegHandle);
253
272
282
294
295#if defined(__cplusplus)
296}
297#endif
298
301#endif /*_FSL_LPSPI_EDMA_H_*/
int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:225
status_t LPSPI_MasterTransferGetCountEDMA(LPSPI_Type *base, lpspi_master_edma_handle_t *handle, size_t *count)
Gets the master eDMA transfer remaining bytes.
Definition: fsl_lpspi_edma.c:594
volatile bool isByteSwap
Definition: fsl_lpspi_edma.h:111
edma_handle_t * edmaTxDataToTxRegHandle
Definition: fsl_lpspi_edma.h:146
edma_tcd_t lpspiSoftwareTCD[3]
Definition: fsl_lpspi_edma.h:105
uint8_t nbytes
Definition: fsl_lpspi_edma.h:123
lpspi_master_edma_transfer_callback_t callback
Definition: fsl_lpspi_edma.h:99
void LPSPI_MasterTransferCreateHandleEDMA(LPSPI_Type *base, lpspi_master_edma_handle_t *handle, lpspi_master_edma_transfer_callback_t callback, void *userData, edma_handle_t *edmaRxRegToRxDataHandle, edma_handle_t *edmaTxDataToTxRegHandle)
Initializes the LPSPI master eDMA handle.
Definition: fsl_lpspi_edma.c:149
volatile uint8_t fifoSize
Definition: fsl_lpspi_edma.h:70
uint32_t txBuffIfNull
Definition: fsl_lpspi_edma.h:135
volatile uint8_t state
Definition: fsl_lpspi_edma.h:95
uint32_t txBuffIfNull
Definition: fsl_lpspi_edma.h:90
volatile uint8_t bytesEachWrite
Definition: fsl_lpspi_edma.h:74
volatile uint8_t bytesEachRead
Definition: fsl_lpspi_edma.h:118
volatile bool isByteSwap
Definition: fsl_lpspi_edma.h:68
edma_tcd_t lpspiSoftwareTCD[2]
Definition: fsl_lpspi_edma.h:148
edma_handle_t * edmaRxRegToRxDataHandle
Definition: fsl_lpspi_edma.h:145
volatile uint32_t readRegRemainingTimes
Definition: fsl_lpspi_edma.h:86
void(* lpspi_master_edma_transfer_callback_t)(LPSPI_Type *base, lpspi_master_edma_handle_t *handle, status_t status, void *userData)
Completion callback function pointer type.
Definition: fsl_lpspi_edma.h:46
volatile uint32_t writeRegRemainingTimes
Definition: fsl_lpspi_edma.h:85
uint8_t *volatile txData
Definition: fsl_lpspi_edma.h:80
uint32_t rxBuffIfNull
Definition: fsl_lpspi_edma.h:136
uint8_t *volatile rxData
Definition: fsl_lpspi_edma.h:126
uint32_t transmitCommand
Definition: fsl_lpspi_edma.h:93
void * userData
Definition: fsl_lpspi_edma.h:143
void LPSPI_SlaveTransferAbortEDMA(LPSPI_Type *base, lpspi_slave_edma_handle_t *handle)
LPSPI slave aborts a transfer which is using eDMA.
Definition: fsl_lpspi_edma.c:1005
volatile uint8_t bytesLastRead
Definition: fsl_lpspi_edma.h:77
volatile uint8_t state
Definition: fsl_lpspi_edma.h:138
volatile uint8_t rxWatermark
Definition: fsl_lpspi_edma.h:115
uint8_t *volatile txData
Definition: fsl_lpspi_edma.h:125
volatile uint8_t bytesEachWrite
Definition: fsl_lpspi_edma.h:117
volatile size_t rxRemainingByteCount
Definition: fsl_lpspi_edma.h:83
volatile uint8_t rxWatermark
Definition: fsl_lpspi_edma.h:72
lpspi_slave_edma_transfer_callback_t callback
Definition: fsl_lpspi_edma.h:142
uint32_t errorCount
Definition: fsl_lpspi_edma.h:140
volatile uint8_t fifoSize
Definition: fsl_lpspi_edma.h:113
volatile uint8_t bytesEachRead
Definition: fsl_lpspi_edma.h:75
volatile uint32_t writeRegRemainingTimes
Definition: fsl_lpspi_edma.h:130
volatile bool isThereExtraRxBytes
Definition: fsl_lpspi_edma.h:78
uint8_t *volatile rxData
Definition: fsl_lpspi_edma.h:81
edma_handle_t * edmaTxDataToTxRegHandle
Definition: fsl_lpspi_edma.h:103
volatile bool isPcsContinuous
Definition: fsl_lpspi_edma.h:66
uint32_t rxBuffIfNull
Definition: fsl_lpspi_edma.h:91
status_t LPSPI_MasterTransferEDMA(LPSPI_Type *base, lpspi_master_edma_handle_t *handle, lpspi_transfer_t *transfer)
LPSPI master transfer data using eDMA.
Definition: fsl_lpspi_edma.c:201
void LPSPI_MasterTransferAbortEDMA(LPSPI_Type *base, lpspi_master_edma_handle_t *handle)
LPSPI master aborts a transfer which is using eDMA.
Definition: fsl_lpspi_edma.c:572
volatile size_t rxRemainingByteCount
Definition: fsl_lpspi_edma.h:128
void LPSPI_SlaveTransferCreateHandleEDMA(LPSPI_Type *base, lpspi_slave_edma_handle_t *handle, lpspi_slave_edma_transfer_callback_t callback, void *userData, edma_handle_t *edmaRxRegToRxDataHandle, edma_handle_t *edmaTxDataToTxRegHandle)
Initializes the LPSPI slave eDMA handle.
Definition: fsl_lpspi_edma.c:641
status_t LPSPI_SlaveTransferEDMA(LPSPI_Type *base, lpspi_slave_edma_handle_t *handle, lpspi_transfer_t *transfer)
LPSPI slave transfers data using eDMA.
Definition: fsl_lpspi_edma.c:684
edma_handle_t * edmaRxRegToRxDataHandle
Definition: fsl_lpspi_edma.h:102
uint8_t nbytes
Definition: fsl_lpspi_edma.h:97
volatile size_t txRemainingByteCount
Definition: fsl_lpspi_edma.h:82
volatile uint32_t readRegRemainingTimes
Definition: fsl_lpspi_edma.h:131
void * userData
Definition: fsl_lpspi_edma.h:100
status_t LPSPI_SlaveTransferGetCountEDMA(LPSPI_Type *base, lpspi_slave_edma_handle_t *handle, size_t *count)
Gets the slave eDMA transfer remaining bytes.
Definition: fsl_lpspi_edma.c:1027
volatile size_t txRemainingByteCount
Definition: fsl_lpspi_edma.h:127
volatile bool isThereExtraRxBytes
Definition: fsl_lpspi_edma.h:121
uint32_t totalByteCount
Definition: fsl_lpspi_edma.h:88
uint32_t totalByteCount
Definition: fsl_lpspi_edma.h:133
volatile uint8_t bytesLastRead
Definition: fsl_lpspi_edma.h:120
void(* lpspi_slave_edma_transfer_callback_t)(LPSPI_Type *base, lpspi_slave_edma_handle_t *handle, status_t status, void *userData)
Completion callback function pointer type.
Definition: fsl_lpspi_edma.h:58
Definition: MIMXRT1052.h:30457
eDMA transfer handle structure
Definition: fsl_edma.h:244
eDMA TCD.
Definition: fsl_edma.h:205
LPSPI master eDMA transfer handle structure used for transactional API.
Definition: fsl_lpspi_edma.h:65
LPSPI slave eDMA transfer handle structure used for transactional API.
Definition: fsl_lpspi_edma.h:110
LPSPI master/slave transfer structure.
Definition: fsl_lpspi.h:344