rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
fsl_lpspi.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_LPSPI_H_
9#define _FSL_LPSPI_H_
10
11#include "fsl_common.h"
12
13/*!
14 * @addtogroup lpspi_driver
15 * @{
16 */
17
18/**********************************************************************************************************************
19 * Definitions
20 *********************************************************************************************************************/
21
22/*! @name Driver version */
23/*@{*/
24/*! @brief LPSPI driver version 2.0.3. */
25#define FSL_LPSPI_DRIVER_VERSION (MAKE_VERSION(2, 0, 3))
26/*@}*/
27
28#ifndef LPSPI_DUMMY_DATA
29/*! @brief LPSPI dummy data if no Tx data.*/
30#define LPSPI_DUMMY_DATA (0x00U) /*!< Dummy data used for tx if there is not txData. */
31#endif
32
33/*! @brief Global variable for dummy data value setting. */
34extern volatile uint8_t g_lpspiDummyData[];
35
36/*! @brief Status for the LPSPI driver.*/
38{
39 kStatus_LPSPI_Busy = MAKE_STATUS(kStatusGroup_LPSPI, 0), /*!< LPSPI transfer is busy.*/
40 kStatus_LPSPI_Error = MAKE_STATUS(kStatusGroup_LPSPI, 1), /*!< LPSPI driver error. */
41 kStatus_LPSPI_Idle = MAKE_STATUS(kStatusGroup_LPSPI, 2), /*!< LPSPI is idle.*/
42 kStatus_LPSPI_OutOfRange = MAKE_STATUS(kStatusGroup_LPSPI, 3) /*!< LPSPI transfer out Of range. */
43};
44
45/*! @brief LPSPI status flags in SPIx_SR register.*/
47{
48 kLPSPI_TxDataRequestFlag = LPSPI_SR_TDF_MASK, /*!< Transmit data flag */
49 kLPSPI_RxDataReadyFlag = LPSPI_SR_RDF_MASK, /*!< Receive data flag */
50 kLPSPI_WordCompleteFlag = LPSPI_SR_WCF_MASK, /*!< Word Complete flag */
51 kLPSPI_FrameCompleteFlag = LPSPI_SR_FCF_MASK, /*!< Frame Complete flag */
52 kLPSPI_TransferCompleteFlag = LPSPI_SR_TCF_MASK, /*!< Transfer Complete flag */
53 kLPSPI_TransmitErrorFlag = LPSPI_SR_TEF_MASK, /*!< Transmit Error flag (FIFO underrun) */
54 kLPSPI_ReceiveErrorFlag = LPSPI_SR_REF_MASK, /*!< Receive Error flag (FIFO overrun) */
55 kLPSPI_DataMatchFlag = LPSPI_SR_DMF_MASK, /*!< Data Match flag */
56 kLPSPI_ModuleBusyFlag = LPSPI_SR_MBF_MASK, /*!< Module Busy flag */
57 kLPSPI_AllStatusFlag = (LPSPI_SR_TDF_MASK | LPSPI_SR_RDF_MASK | LPSPI_SR_WCF_MASK | LPSPI_SR_FCF_MASK |
58 LPSPI_SR_TCF_MASK | LPSPI_SR_TEF_MASK | LPSPI_SR_REF_MASK | LPSPI_SR_DMF_MASK |
59 LPSPI_SR_MBF_MASK) /*!< Used for clearing all w1c status flags */
60};
61
62/*! @brief LPSPI interrupt source.*/
64{
65 kLPSPI_TxInterruptEnable = LPSPI_IER_TDIE_MASK, /*!< Transmit data interrupt enable */
66 kLPSPI_RxInterruptEnable = LPSPI_IER_RDIE_MASK, /*!< Receive data interrupt enable */
67 kLPSPI_WordCompleteInterruptEnable = LPSPI_IER_WCIE_MASK, /*!< Word complete interrupt enable */
68 kLPSPI_FrameCompleteInterruptEnable = LPSPI_IER_FCIE_MASK, /*!< Frame complete interrupt enable */
69 kLPSPI_TransferCompleteInterruptEnable = LPSPI_IER_TCIE_MASK, /*!< Transfer complete interrupt enable */
70 kLPSPI_TransmitErrorInterruptEnable = LPSPI_IER_TEIE_MASK, /*!< Transmit error interrupt enable(FIFO underrun)*/
71 kLPSPI_ReceiveErrorInterruptEnable = LPSPI_IER_REIE_MASK, /*!< Receive Error interrupt enable (FIFO overrun) */
72 kLPSPI_DataMatchInterruptEnable = LPSPI_IER_DMIE_MASK, /*!< Data Match interrupt enable */
74 (LPSPI_IER_TDIE_MASK | LPSPI_IER_RDIE_MASK | LPSPI_IER_WCIE_MASK | LPSPI_IER_FCIE_MASK | LPSPI_IER_TCIE_MASK |
75 LPSPI_IER_TEIE_MASK | LPSPI_IER_REIE_MASK | LPSPI_IER_DMIE_MASK) /*!< All above interrupts enable.*/
76};
77
78/*! @brief LPSPI DMA source.*/
80{
81 kLPSPI_TxDmaEnable = LPSPI_DER_TDDE_MASK, /*!< Transmit data DMA enable */
82 kLPSPI_RxDmaEnable = LPSPI_DER_RDDE_MASK /*!< Receive data DMA enable */
83};
84
85/*! @brief LPSPI master or slave mode configuration.*/
87{
88 kLPSPI_Master = 1U, /*!< LPSPI peripheral operates in master mode.*/
89 kLPSPI_Slave = 0U /*!< LPSPI peripheral operates in slave mode.*/
91
92/*! @brief LPSPI Peripheral Chip Select (PCS) configuration (which PCS to configure).*/
94{
95 kLPSPI_Pcs0 = 0U, /*!< PCS[0] */
96 kLPSPI_Pcs1 = 1U, /*!< PCS[1] */
97 kLPSPI_Pcs2 = 2U, /*!< PCS[2] */
98 kLPSPI_Pcs3 = 3U /*!< PCS[3] */
100
101/*! @brief LPSPI Peripheral Chip Select (PCS) Polarity configuration.*/
103{
104 kLPSPI_PcsActiveHigh = 1U, /*!< PCS Active High (idles low) */
105 kLPSPI_PcsActiveLow = 0U /*!< PCS Active Low (idles high) */
107
108/*! @brief LPSPI Peripheral Chip Select (PCS) Polarity.*/
110{
111 kLPSPI_Pcs0ActiveLow = 1U << 0, /*!< Pcs0 Active Low (idles high). */
112 kLPSPI_Pcs1ActiveLow = 1U << 1, /*!< Pcs1 Active Low (idles high). */
113 kLPSPI_Pcs2ActiveLow = 1U << 2, /*!< Pcs2 Active Low (idles high). */
114 kLPSPI_Pcs3ActiveLow = 1U << 3, /*!< Pcs3 Active Low (idles high). */
115 kLPSPI_PcsAllActiveLow = 0xFU /*!< Pcs0 to Pcs5 Active Low (idles high). */
117
118/*! @brief LPSPI clock polarity configuration.*/
120{
121 kLPSPI_ClockPolarityActiveHigh = 0U, /*!< CPOL=0. Active-high LPSPI clock (idles low)*/
122 kLPSPI_ClockPolarityActiveLow = 1U /*!< CPOL=1. Active-low LPSPI clock (idles high)*/
124
125/*! @brief LPSPI clock phase configuration.*/
127{
128 kLPSPI_ClockPhaseFirstEdge = 0U, /*!< CPHA=0. Data is captured on the leading edge of the SCK and changed on the
129 following edge.*/
130 kLPSPI_ClockPhaseSecondEdge = 1U /*!< CPHA=1. Data is changed on the leading edge of the SCK and captured on the
131 following edge.*/
133
134/*! @brief LPSPI data shifter direction options.*/
136{
137 kLPSPI_MsbFirst = 0U, /*!< Data transfers start with most significant bit.*/
138 kLPSPI_LsbFirst = 1U /*!< Data transfers start with least significant bit.*/
140
141/*! @brief LPSPI Host Request select configuration. */
143{
144 kLPSPI_HostReqExtPin = 0U, /*!< Host Request is an ext pin. */
145 kLPSPI_HostReqInternalTrigger = 1U /*!< Host Request is an internal trigger. */
147
148/*! @brief LPSPI Match configuration options. */
150{
151 kLPSI_MatchDisabled = 0x0U, /*!< LPSPI Match Disabled. */
152 kLPSI_1stWordEqualsM0orM1 = 0x2U, /*!< LPSPI Match Enabled. */
153 kLPSI_AnyWordEqualsM0orM1 = 0x3U, /*!< LPSPI Match Enabled. */
154 kLPSI_1stWordEqualsM0and2ndWordEqualsM1 = 0x4U, /*!< LPSPI Match Enabled. */
155 kLPSI_AnyWordEqualsM0andNxtWordEqualsM1 = 0x5U, /*!< LPSPI Match Enabled. */
156 kLPSI_1stWordAndM1EqualsM0andM1 = 0x6U, /*!< LPSPI Match Enabled. */
157 kLPSI_AnyWordAndM1EqualsM0andM1 = 0x7U, /*!< LPSPI Match Enabled. */
159
160/*! @brief LPSPI pin (SDO and SDI) configuration. */
162{
163 kLPSPI_SdiInSdoOut = 0U, /*!< LPSPI SDI input, SDO output. */
164 kLPSPI_SdiInSdiOut = 1U, /*!< LPSPI SDI input, SDI output. */
165 kLPSPI_SdoInSdoOut = 2U, /*!< LPSPI SDO input, SDO output. */
166 kLPSPI_SdoInSdiOut = 3U /*!< LPSPI SDO input, SDI output. */
168
169/*! @brief LPSPI data output configuration. */
171{
172 kLpspiDataOutRetained = 0U, /*!< Data out retains last value when chip select is de-asserted */
173 kLpspiDataOutTristate = 1U /*!< Data out is tristated when chip select is de-asserted */
175
176/*! @brief LPSPI transfer width configuration. */
178{
179 kLPSPI_SingleBitXfer = 0U, /*!< 1-bit shift at a time, data out on SDO, in on SDI (normal mode) */
180 kLPSPI_TwoBitXfer = 1U, /*!< 2-bits shift out on SDO/SDI and in on SDO/SDI */
181 kLPSPI_FourBitXfer = 2U /*!< 4-bits shift out on SDO/SDI/PCS[3:2] and in on SDO/SDI/PCS[3:2] */
183
184/*! @brief LPSPI delay type selection.*/
186{
187 kLPSPI_PcsToSck = 1U, /*!< PCS-to-SCK delay. */
188 kLPSPI_LastSckToPcs, /*!< Last SCK edge to PCS delay. */
189 kLPSPI_BetweenTransfer /*!< Delay between transfers. */
191
192#define LPSPI_MASTER_PCS_SHIFT (4U) /*!< LPSPI master PCS shift macro , internal used. */
193#define LPSPI_MASTER_PCS_MASK (0xF0U) /*!< LPSPI master PCS shift macro , internal used. */
194
195/*! @brief Use this enumeration for LPSPI master transfer configFlags. */
197{
198 kLPSPI_MasterPcs0 = 0U << LPSPI_MASTER_PCS_SHIFT, /*!< LPSPI master transfer use PCS0 signal */
199 kLPSPI_MasterPcs1 = 1U << LPSPI_MASTER_PCS_SHIFT, /*!< LPSPI master transfer use PCS1 signal */
200 kLPSPI_MasterPcs2 = 2U << LPSPI_MASTER_PCS_SHIFT, /*!< LPSPI master transfer use PCS2 signal */
201 kLPSPI_MasterPcs3 = 3U << LPSPI_MASTER_PCS_SHIFT, /*!< LPSPI master transfer use PCS3 signal */
202
203 kLPSPI_MasterPcsContinuous = 1U << 20, /*!< Is PCS signal continuous */
204
206 1U << 22 /*!< Is master swap the byte.
207 * For example, when want to send data 1 2 3 4 5 6 7 8 (suppose you set
208 * lpspi_shift_direction_t to MSB).
209 * 1. If you set bitPerFrame = 8 , no matter the kLPSPI_MasterByteSwapyou flag is used
210 * or not, the waveform is 1 2 3 4 5 6 7 8.
211 * 2. If you set bitPerFrame = 16 :
212 * (1) the waveform is 2 1 4 3 6 5 8 7 if you do not use the kLPSPI_MasterByteSwap flag.
213 * (2) the waveform is 1 2 3 4 5 6 7 8 if you use the kLPSPI_MasterByteSwap flag.
214 * 3. If you set bitPerFrame = 32 :
215 * (1) the waveform is 4 3 2 1 8 7 6 5 if you do not use the kLPSPI_MasterByteSwap flag.
216 * (2) the waveform is 1 2 3 4 5 6 7 8 if you use the kLPSPI_MasterByteSwap flag.
217 */
219
220#define LPSPI_SLAVE_PCS_SHIFT (4U) /*!< LPSPI slave PCS shift macro , internal used. */
221#define LPSPI_SLAVE_PCS_MASK (0xF0U) /*!< LPSPI slave PCS shift macro , internal used. */
222
223/*! @brief Use this enumeration for LPSPI slave transfer configFlags. */
225{
226 kLPSPI_SlavePcs0 = 0U << LPSPI_SLAVE_PCS_SHIFT, /*!< LPSPI slave transfer use PCS0 signal */
227 kLPSPI_SlavePcs1 = 1U << LPSPI_SLAVE_PCS_SHIFT, /*!< LPSPI slave transfer use PCS1 signal */
228 kLPSPI_SlavePcs2 = 2U << LPSPI_SLAVE_PCS_SHIFT, /*!< LPSPI slave transfer use PCS2 signal */
229 kLPSPI_SlavePcs3 = 3U << LPSPI_SLAVE_PCS_SHIFT, /*!< LPSPI slave transfer use PCS3 signal */
230
232 1U << 22 /*!< Is slave swap the byte.
233 * For example, when want to send data 1 2 3 4 5 6 7 8 (suppose you set
234 * lpspi_shift_direction_t to MSB).
235 * 1. If you set bitPerFrame = 8 , no matter the kLPSPI_SlaveByteSwap flag is used
236 * or not, the waveform is 1 2 3 4 5 6 7 8.
237 * 2. If you set bitPerFrame = 16 :
238 * (1) the waveform is 2 1 4 3 6 5 8 7 if you do not use the kLPSPI_SlaveByteSwap flag.
239 * (2) the waveform is 1 2 3 4 5 6 7 8 if you use the kLPSPI_SlaveByteSwap flag.
240 * 3. If you set bitPerFrame = 32 :
241 * (1) the waveform is 4 3 2 1 8 7 6 5 if you do not use the kLPSPI_SlaveByteSwap flag.
242 * (2) the waveform is 1 2 3 4 5 6 7 8 if you use the kLPSPI_SlaveByteSwap flag.
243 */
245
246/*! @brief LPSPI transfer state, which is used for LPSPI transactional API state machine. */
248{
249 kLPSPI_Idle = 0x0U, /*!< Nothing in the transmitter/receiver. */
250 kLPSPI_Busy, /*!< Transfer queue is not finished. */
251 kLPSPI_Error /*!< Transfer error. */
253
254/*! @brief LPSPI master configuration structure.*/
256{
257 uint32_t baudRate; /*!< Baud Rate for LPSPI. */
258 uint32_t bitsPerFrame; /*!< Bits per frame, minimum 8, maximum 4096.*/
259 lpspi_clock_polarity_t cpol; /*!< Clock polarity. */
260 lpspi_clock_phase_t cpha; /*!< Clock phase. */
261 lpspi_shift_direction_t direction; /*!< MSB or LSB data shift direction. */
262
263 uint32_t pcsToSckDelayInNanoSec; /*!< PCS to SCK delay time in nanoseconds, setting to 0 sets the minimum delay.
264 It sets the boundary value if out of range.*/
265 uint32_t lastSckToPcsDelayInNanoSec; /*!< Last SCK to PCS delay time in nanoseconds, setting to 0 sets the minimum
266 delay. It sets the boundary value if out of range.*/
267 uint32_t
268 betweenTransferDelayInNanoSec; /*!< After the SCK delay time with nanoseconds, setting to 0 sets the minimum
269 delay. It sets the boundary value if out of range.*/
270
271 lpspi_which_pcs_t whichPcs; /*!< Desired Peripheral Chip Select (PCS). */
272 lpspi_pcs_polarity_config_t pcsActiveHighOrLow; /*!< Desired PCS active high or low */
273
274 lpspi_pin_config_t pinCfg; /*!< Configures which pins are used for input and output data
275 *during single bit transfers.*/
276
277 lpspi_data_out_config_t dataOutConfig; /*!< Configures if the output data is tristated
278 * between accesses (LPSPI_PCS is negated). */
280
281/*! @brief LPSPI slave configuration structure.*/
283{
284 uint32_t bitsPerFrame; /*!< Bits per frame, minimum 8, maximum 4096.*/
285 lpspi_clock_polarity_t cpol; /*!< Clock polarity. */
286 lpspi_clock_phase_t cpha; /*!< Clock phase. */
287 lpspi_shift_direction_t direction; /*!< MSB or LSB data shift direction. */
288
289 lpspi_which_pcs_t whichPcs; /*!< Desired Peripheral Chip Select (pcs) */
290 lpspi_pcs_polarity_config_t pcsActiveHighOrLow; /*!< Desired PCS active high or low */
291
292 lpspi_pin_config_t pinCfg; /*!< Configures which pins are used for input and output data
293 *during single bit transfers.*/
294
295 lpspi_data_out_config_t dataOutConfig; /*!< Configures if the output data is tristated
296 * between accesses (LPSPI_PCS is negated). */
298
299/*!
300* @brief Forward declaration of the _lpspi_master_handle typedefs.
301*/
303
304/*!
305* @brief Forward declaration of the _lpspi_slave_handle typedefs.
306*/
308
309/*!
310 * @brief Master completion callback function pointer type.
311 *
312 * @param base LPSPI peripheral address.
313 * @param handle Pointer to the handle for the LPSPI master.
314 * @param status Success or error code describing whether the transfer is completed.
315 * @param userData Arbitrary pointer-dataSized value passed from the application.
316 */
317typedef void (*lpspi_master_transfer_callback_t)(LPSPI_Type *base,
318 lpspi_master_handle_t *handle,
319 status_t status,
320 void *userData);
321
322/*!
323 * @brief Slave completion callback function pointer type.
324 *
325 * @param base LPSPI peripheral address.
326 * @param handle Pointer to the handle for the LPSPI slave.
327 * @param status Success or error code describing whether the transfer is completed.
328 * @param userData Arbitrary pointer-dataSized value passed from the application.
329 */
330typedef void (*lpspi_slave_transfer_callback_t)(LPSPI_Type *base,
331 lpspi_slave_handle_t *handle,
332 status_t status,
333 void *userData);
334
335/*! @brief LPSPI master/slave transfer structure.*/
336typedef struct _lpspi_transfer
337{
338 uint8_t *txData; /*!< Send buffer. */
339 uint8_t *rxData; /*!< Receive buffer. */
340 volatile size_t dataSize; /*!< Transfer bytes. */
341
342 uint32_t
343 configFlags; /*!< Transfer transfer configuration flags. Set from _lpspi_transfer_config_flag_for_master if the
344 transfer is used for master or _lpspi_transfer_config_flag_for_slave enumeration if the transfer
345 is used for slave.*/
347
348/*! @brief LPSPI master transfer handle structure used for transactional API. */
350{
351 volatile bool isPcsContinuous; /*!< Is PCS continuous in transfer. */
352 volatile bool writeTcrInIsr; /*!< A flag that whether should write TCR in ISR. */
353
354 volatile bool isByteSwap; /*!< A flag that whether should byte swap. */
355
356 volatile uint8_t fifoSize; /*!< FIFO dataSize. */
357
358 volatile uint8_t rxWatermark; /*!< Rx watermark. */
359
360 volatile uint8_t bytesEachWrite; /*!< Bytes for each write TDR. */
361 volatile uint8_t bytesEachRead; /*!< Bytes for each read RDR. */
362
363 uint8_t *volatile txData; /*!< Send buffer. */
364 uint8_t *volatile rxData; /*!< Receive buffer. */
365 volatile size_t txRemainingByteCount; /*!< Number of bytes remaining to send.*/
366 volatile size_t rxRemainingByteCount; /*!< Number of bytes remaining to receive.*/
367
368 volatile uint32_t writeRegRemainingTimes; /*!< Write TDR register remaining times. */
369 volatile uint32_t readRegRemainingTimes; /*!< Read RDR register remaining times. */
370
371 uint32_t totalByteCount; /*!< Number of transfer bytes*/
372
373 uint32_t txBuffIfNull; /*!< Used if the txData is NULL. */
374
375 volatile uint8_t state; /*!< LPSPI transfer state , _lpspi_transfer_state.*/
376
377 lpspi_master_transfer_callback_t callback; /*!< Completion callback. */
378 void *userData; /*!< Callback user data. */
379};
380
381/*! @brief LPSPI slave transfer handle structure used for transactional API. */
383{
384 volatile bool isByteSwap; /*!< A flag that whether should byte swap. */
385
386 volatile uint8_t fifoSize; /*!< FIFO dataSize. */
387
388 volatile uint8_t rxWatermark; /*!< Rx watermark. */
389
390 volatile uint8_t bytesEachWrite; /*!< Bytes for each write TDR. */
391 volatile uint8_t bytesEachRead; /*!< Bytes for each read RDR. */
392
393 uint8_t *volatile txData; /*!< Send buffer. */
394 uint8_t *volatile rxData; /*!< Receive buffer. */
395
396 volatile size_t txRemainingByteCount; /*!< Number of bytes remaining to send.*/
397 volatile size_t rxRemainingByteCount; /*!< Number of bytes remaining to receive.*/
398
399 volatile uint32_t writeRegRemainingTimes; /*!< Write TDR register remaining times. */
400 volatile uint32_t readRegRemainingTimes; /*!< Read RDR register remaining times. */
401
402 uint32_t totalByteCount; /*!< Number of transfer bytes*/
403
404 volatile uint8_t state; /*!< LPSPI transfer state , _lpspi_transfer_state.*/
405
406 volatile uint32_t errorCount; /*!< Error count for slave transfer.*/
407
408 lpspi_slave_transfer_callback_t callback; /*!< Completion callback. */
409 void *userData; /*!< Callback user data. */
410};
411
412/**********************************************************************************************************************
413 * API
414 *********************************************************************************************************************/
415#if defined(__cplusplus)
416extern "C" {
417#endif /*_cplusplus*/
418
419/*!
420 * @name Initialization and deinitialization
421 * @{
422 */
423
424/*!
425 * @brief Initializes the LPSPI master.
426 *
427 * @param base LPSPI peripheral address.
428 * @param masterConfig Pointer to structure lpspi_master_config_t.
429 * @param srcClock_Hz Module source input clock in Hertz
430 */
431void LPSPI_MasterInit(LPSPI_Type *base, const lpspi_master_config_t *masterConfig, uint32_t srcClock_Hz);
432
433/*!
434 * @brief Sets the lpspi_master_config_t structure to default values.
435 *
436 * This API initializes the configuration structure for LPSPI_MasterInit().
437 * The initialized structure can remain unchanged in LPSPI_MasterInit(), or can be modified
438 * before calling the LPSPI_MasterInit().
439 * Example:
440 * @code
441 * lpspi_master_config_t masterConfig;
442 * LPSPI_MasterGetDefaultConfig(&masterConfig);
443 * @endcode
444 * @param masterConfig pointer to lpspi_master_config_t structure
445 */
447
448/*!
449 * @brief LPSPI slave configuration.
450 *
451 * @param base LPSPI peripheral address.
452 * @param slaveConfig Pointer to a structure lpspi_slave_config_t.
453 */
454void LPSPI_SlaveInit(LPSPI_Type *base, const lpspi_slave_config_t *slaveConfig);
455
456/*!
457 * @brief Sets the lpspi_slave_config_t structure to default values.
458 *
459 * This API initializes the configuration structure for LPSPI_SlaveInit().
460 * The initialized structure can remain unchanged in LPSPI_SlaveInit() or can be modified
461 * before calling the LPSPI_SlaveInit().
462 * Example:
463 * @code
464 * lpspi_slave_config_t slaveConfig;
465 * LPSPI_SlaveGetDefaultConfig(&slaveConfig);
466 * @endcode
467 * @param slaveConfig pointer to lpspi_slave_config_t structure.
468 */
470
471/*!
472 * @brief De-initializes the LPSPI peripheral. Call this API to disable the LPSPI clock.
473 * @param base LPSPI peripheral address.
474 */
475void LPSPI_Deinit(LPSPI_Type *base);
476
477/*!
478 * @brief Restores the LPSPI peripheral to reset state. Note that this function
479 * sets all registers to reset state. As a result, the LPSPI module can't work after calling
480 * this API.
481 * @param base LPSPI peripheral address.
482*/
483void LPSPI_Reset(LPSPI_Type *base);
484
485/*!
486 * @brief Enables the LPSPI peripheral and sets the MCR MDIS to 0.
487 *
488 * @param base LPSPI peripheral address.
489 * @param enable Pass true to enable module, false to disable module.
490 */
491static inline void LPSPI_Enable(LPSPI_Type *base, bool enable)
492{
493 if (enable)
494 {
495 base->CR |= LPSPI_CR_MEN_MASK;
496 }
497 else
498 {
499 base->CR &= ~LPSPI_CR_MEN_MASK;
500 }
501}
502
503/*!
504 *@}
505*/
506
507/*!
508 * @name Status
509 * @{
510 */
511
512/*!
513 * @brief Gets the LPSPI status flag state.
514 * @param base LPSPI peripheral address.
515 * @return The LPSPI status(in SR register).
516 */
517static inline uint32_t LPSPI_GetStatusFlags(LPSPI_Type *base)
518{
519 return (base->SR);
520}
521
522/*!
523 * @brief Gets the LPSPI Tx FIFO size.
524 * @param base LPSPI peripheral address.
525 * @return The LPSPI Tx FIFO size.
526 */
527static inline uint32_t LPSPI_GetTxFifoSize(LPSPI_Type *base)
528{
529 return (1U << ((base->PARAM & LPSPI_PARAM_TXFIFO_MASK) >> LPSPI_PARAM_TXFIFO_SHIFT));
530}
531
532/*!
533 * @brief Gets the LPSPI Rx FIFO size.
534 * @param base LPSPI peripheral address.
535 * @return The LPSPI Rx FIFO size.
536 */
537static inline uint32_t LPSPI_GetRxFifoSize(LPSPI_Type *base)
538{
539 return (1U << ((base->PARAM & LPSPI_PARAM_RXFIFO_MASK) >> LPSPI_PARAM_RXFIFO_SHIFT));
540}
541
542/*!
543 * @brief Gets the LPSPI Tx FIFO count.
544 * @param base LPSPI peripheral address.
545 * @return The number of words in the transmit FIFO.
546 */
547static inline uint32_t LPSPI_GetTxFifoCount(LPSPI_Type *base)
548{
549 return ((base->FSR & LPSPI_FSR_TXCOUNT_MASK) >> LPSPI_FSR_TXCOUNT_SHIFT);
550}
551
552/*!
553 * @brief Gets the LPSPI Rx FIFO count.
554 * @param base LPSPI peripheral address.
555 * @return The number of words in the receive FIFO.
556 */
557static inline uint32_t LPSPI_GetRxFifoCount(LPSPI_Type *base)
558{
559 return ((base->FSR & LPSPI_FSR_RXCOUNT_MASK) >> LPSPI_FSR_RXCOUNT_SHIFT);
560}
561
562/*!
563 * @brief Clears the LPSPI status flag.
564 *
565 * This function clears the desired status bit by using a write-1-to-clear. The user passes in the base and the
566 * desired status flag bit to clear. The list of status flags is defined in the _lpspi_flags.
567 * Example usage:
568 * @code
569 * LPSPI_ClearStatusFlags(base, kLPSPI_TxDataRequestFlag|kLPSPI_RxDataReadyFlag);
570 * @endcode
571 *
572 * @param base LPSPI peripheral address.
573 * @param statusFlags The status flag used from type _lpspi_flags.
574 */
575static inline void LPSPI_ClearStatusFlags(LPSPI_Type *base, uint32_t statusFlags)
576{
577 base->SR = statusFlags; /*!< The status flags are cleared by writing 1 (w1c).*/
578}
579
580/*!
581 *@}
582*/
583
584/*!
585 * @name Interrupts
586 * @{
587 */
588
589/*!
590 * @brief Enables the LPSPI interrupts.
591 *
592 * This function configures the various interrupt masks of the LPSPI. The parameters are base and an interrupt mask.
593 * Note that, for Tx fill and Rx FIFO drain requests, enabling the interrupt request disables the DMA request.
594 *
595 * @code
596 * LPSPI_EnableInterrupts(base, kLPSPI_TxInterruptEnable | kLPSPI_RxInterruptEnable );
597 * @endcode
598 *
599 * @param base LPSPI peripheral address.
600 * @param mask The interrupt mask; Use the enum _lpspi_interrupt_enable.
601 */
602static inline void LPSPI_EnableInterrupts(LPSPI_Type *base, uint32_t mask)
603{
604 base->IER |= mask;
605}
606
607/*!
608 * @brief Disables the LPSPI interrupts.
609 *
610 * @code
611 * LPSPI_DisableInterrupts(base, kLPSPI_TxInterruptEnable | kLPSPI_RxInterruptEnable );
612 * @endcode
613 *
614 * @param base LPSPI peripheral address.
615 * @param mask The interrupt mask; Use the enum _lpspi_interrupt_enable.
616 */
617static inline void LPSPI_DisableInterrupts(LPSPI_Type *base, uint32_t mask)
618{
619 base->IER &= ~mask;
620}
621
622/*!
623 *@}
624*/
625
626/*!
627 * @name DMA Control
628 * @{
629 */
630
631/*!
632 * @brief Enables the LPSPI DMA request.
633 *
634 * This function configures the Rx and Tx DMA mask of the LPSPI. The parameters are base and a DMA mask.
635 * @code
636 * LPSPI_EnableDMA(base, kLPSPI_TxDmaEnable | kLPSPI_RxDmaEnable);
637 * @endcode
638 *
639 * @param base LPSPI peripheral address.
640 * @param mask The interrupt mask; Use the enum _lpspi_dma_enable.
641 */
642static inline void LPSPI_EnableDMA(LPSPI_Type *base, uint32_t mask)
643{
644 base->DER |= mask;
645}
646
647/*!
648 * @brief Disables the LPSPI DMA request.
649 *
650 * This function configures the Rx and Tx DMA mask of the LPSPI. The parameters are base and a DMA mask.
651 * @code
652 * SPI_DisableDMA(base, kLPSPI_TxDmaEnable | kLPSPI_RxDmaEnable);
653 * @endcode
654 *
655 * @param base LPSPI peripheral address.
656 * @param mask The interrupt mask; Use the enum _lpspi_dma_enable.
657 */
658static inline void LPSPI_DisableDMA(LPSPI_Type *base, uint32_t mask)
659{
660 base->DER &= ~mask;
661}
662
663/*!
664 * @brief Gets the LPSPI Transmit Data Register address for a DMA operation.
665 *
666 * This function gets the LPSPI Transmit Data Register address because this value is needed
667 * for the DMA operation.
668 * This function can be used for either master or slave mode.
669 *
670 * @param base LPSPI peripheral address.
671 * @return The LPSPI Transmit Data Register address.
672 */
673static inline uint32_t LPSPI_GetTxRegisterAddress(LPSPI_Type *base)
674{
675 return (uint32_t) & (base->TDR);
676}
677
678/*!
679 * @brief Gets the LPSPI Receive Data Register address for a DMA operation.
680 *
681 * This function gets the LPSPI Receive Data Register address because this value is needed
682 * for the DMA operation.
683 * This function can be used for either master or slave mode.
684 *
685 * @param base LPSPI peripheral address.
686 * @return The LPSPI Receive Data Register address.
687 */
688static inline uint32_t LPSPI_GetRxRegisterAddress(LPSPI_Type *base)
689{
690 return (uint32_t) & (base->RDR);
691}
692
693/*!
694 *@}
695*/
696
697/*!
698 * @name Bus Operations
699 * @{
700 */
701
702/*!
703* @brief Check the argument for transfer .
704*
705* @param transfer the transfer struct to be used.
706* @param bitPerFrame The bit size of one frame.
707* @param bytePerFrame The byte size of one frame.
708* @return Return true for right and false for wrong.
709*/
710bool LPSPI_CheckTransferArgument(lpspi_transfer_t *transfer, uint32_t bitsPerFrame, uint32_t bytesPerFrame);
711
712/*!
713 * @brief Configures the LPSPI for either master or slave.
714 *
715 * Note that the CFGR1 should only be written when the LPSPI is disabled (LPSPIx_CR_MEN = 0).
716 *
717 * @param base LPSPI peripheral address.
718 * @param mode Mode setting (master or slave) of type lpspi_master_slave_mode_t.
719 */
720static inline void LPSPI_SetMasterSlaveMode(LPSPI_Type *base, lpspi_master_slave_mode_t mode)
721{
722 base->CFGR1 = (base->CFGR1 & (~LPSPI_CFGR1_MASTER_MASK)) | LPSPI_CFGR1_MASTER(mode);
723}
724
725/*!
726 * @brief Returns whether the LPSPI module is in master mode.
727 *
728 * @param base LPSPI peripheral address.
729 * @return Returns true if the module is in master mode or false if the module is in slave mode.
730 */
731static inline bool LPSPI_IsMaster(LPSPI_Type *base)
732{
733 return (bool)((base->CFGR1) & LPSPI_CFGR1_MASTER_MASK);
734}
735
736/*!
737 * @brief Flushes the LPSPI FIFOs.
738 *
739 * @param base LPSPI peripheral address.
740 * @param flushTxFifo Flushes (true) the Tx FIFO, else do not flush (false) the Tx FIFO.
741 * @param flushRxFifo Flushes (true) the Rx FIFO, else do not flush (false) the Rx FIFO.
742 */
743static inline void LPSPI_FlushFifo(LPSPI_Type *base, bool flushTxFifo, bool flushRxFifo)
744{
745 base->CR |= ((uint32_t)flushTxFifo << LPSPI_CR_RTF_SHIFT) | ((uint32_t)flushRxFifo << LPSPI_CR_RRF_SHIFT);
746}
747
748/*!
749 * @brief Sets the transmit and receive FIFO watermark values.
750 *
751 * This function allows the user to set the receive and transmit FIFO watermarks. The function
752 * does not compare the watermark settings to the FIFO size. The FIFO watermark should not be
753 * equal to or greater than the FIFO size. It is up to the higher level driver to make this check.
754 *
755 * @param base LPSPI peripheral address.
756 * @param txWater The TX FIFO watermark value. Writing a value equal or greater than the FIFO size is truncated.
757 * @param rxWater The RX FIFO watermark value. Writing a value equal or greater than the FIFO size is truncated.
758 */
759static inline void LPSPI_SetFifoWatermarks(LPSPI_Type *base, uint32_t txWater, uint32_t rxWater)
760{
761 base->FCR = LPSPI_FCR_TXWATER(txWater) | LPSPI_FCR_RXWATER(rxWater);
762}
763
764/*!
765 * @brief Configures all LPSPI peripheral chip select polarities simultaneously.
766 *
767 * Note that the CFGR1 should only be written when the LPSPI is disabled (LPSPIx_CR_MEN = 0).
768 *
769 * This is an example: PCS0 and PCS1 set to active low and other PCSs set to active high. Note that the number of
770 * PCS is device-specific.
771 * @code
772 * LPSPI_SetAllPcsPolarity(base, kLPSPI_Pcs0ActiveLow | kLPSPI_Pcs1ActiveLow);
773 * @endcode
774 *
775 * @param base LPSPI peripheral address.
776 * @param mask The PCS polarity mask; Use the enum _lpspi_pcs_polarity.
777 */
778static inline void LPSPI_SetAllPcsPolarity(LPSPI_Type *base, uint32_t mask)
779{
780 base->CFGR1 = (base->CFGR1 & ~LPSPI_CFGR1_PCSPOL_MASK) | LPSPI_CFGR1_PCSPOL(~mask);
781}
782
783/*!
784 * @brief Configures the frame size.
785 *
786 * The minimum frame size is 8-bits and the maximum frame size is 4096-bits. If the frame size is less than or equal
787 * to 32-bits, the word size and frame size are identical. If the frame size is greater than 32-bits, the word
788 * size is 32-bits for each word except the last (the last word contains the remainder bits if the frame size is not
789 * divisible by 32). The minimum word size is 2-bits. A frame size of 33-bits (or similar) is not supported.
790 *
791 * Note 1: The transmit command register should be initialized before enabling the LPSPI in slave mode, although
792 * the command register does not update until after the LPSPI is enabled. After it is enabled, the transmit command
793 * register
794 * should only be changed if the LPSPI is idle.
795 *
796 * Note 2: The transmit and command FIFO is a combined FIFO that includes both transmit data and command words. That
797 * means the TCR register should be written to when the Tx FIFO is not full.
798 *
799 * @param base LPSPI peripheral address.
800 * @param frameSize The frame size in number of bits.
801 */
802static inline void LPSPI_SetFrameSize(LPSPI_Type *base, uint32_t frameSize)
803{
804 base->TCR = (base->TCR & ~LPSPI_TCR_FRAMESZ_MASK) | LPSPI_TCR_FRAMESZ(frameSize - 1);
805}
806
807/*!
808 * @brief Sets the LPSPI baud rate in bits per second.
809 *
810 * This function takes in the desired bitsPerSec (baud rate) and calculates the nearest
811 * possible baud rate without exceeding the desired baud rate and returns the
812 * calculated baud rate in bits-per-second. It requires the caller to provide
813 * the frequency of the module source clock (in Hertz). Note that the baud rate
814 * does not go into effect until the Transmit Control Register (TCR) is programmed
815 * with the prescale value. Hence, this function returns the prescale tcrPrescaleValue
816 * parameter for later programming in the TCR. The higher level
817 * peripheral driver should alert the user of an out of range baud rate input.
818 *
819 * Note that the LPSPI module must first be disabled before configuring this.
820 * Note that the LPSPI module must be configured for master mode before configuring this.
821 *
822 * @param base LPSPI peripheral address.
823 * @param baudRate_Bps The desired baud rate in bits per second.
824 * @param srcClock_Hz Module source input clock in Hertz.
825 * @param tcrPrescaleValue The TCR prescale value needed to program the TCR.
826 * @return The actual calculated baud rate. This function may also return a "0" if the
827 * LPSPI is not configured for master mode or if the LPSPI module is not disabled.
828 */
829
830uint32_t LPSPI_MasterSetBaudRate(LPSPI_Type *base,
831 uint32_t baudRate_Bps,
832 uint32_t srcClock_Hz,
833 uint32_t *tcrPrescaleValue);
834
835/*!
836 * @brief Manually configures a specific LPSPI delay parameter (module must be disabled to
837 * change the delay values).
838 *
839 * This function configures the following:
840 * SCK to PCS delay, or
841 * PCS to SCK delay, or
842 * The configurations must occur between the transfer delay.
843 *
844 * The delay names are available in type lpspi_delay_type_t.
845 *
846 * The user passes the desired delay along with the delay value.
847 * This allows the user to directly set the delay values if they have
848 * pre-calculated them or if they simply wish to manually increment the value.
849 *
850 * Note that the LPSPI module must first be disabled before configuring this.
851 * Note that the LPSPI module must be configured for master mode before configuring this.
852 *
853 * @param base LPSPI peripheral address.
854 * @param scaler The 8-bit delay value 0x00 to 0xFF (255).
855 * @param whichDelay The desired delay to configure, must be of type lpspi_delay_type_t.
856 */
857void LPSPI_MasterSetDelayScaler(LPSPI_Type *base, uint32_t scaler, lpspi_delay_type_t whichDelay);
858
859/*!
860 * @brief Calculates the delay based on the desired delay input in nanoseconds (module must be
861 * disabled to change the delay values).
862 *
863 * This function calculates the values for the following:
864 * SCK to PCS delay, or
865 * PCS to SCK delay, or
866 * The configurations must occur between the transfer delay.
867 *
868 * The delay names are available in type lpspi_delay_type_t.
869 *
870 * The user passes the desired delay and the desired delay value in
871 * nano-seconds. The function calculates the value needed for the desired delay parameter
872 * and returns the actual calculated delay because an exact delay match may not be possible. In this
873 * case, the closest match is calculated without going below the desired delay value input.
874 * It is possible to input a very large delay value that exceeds the capability of the part, in
875 * which case the maximum supported delay is returned. It is up to the higher level
876 * peripheral driver to alert the user of an out of range delay input.
877 *
878 * Note that the LPSPI module must be configured for master mode before configuring this. And note that
879 * the delayTime = LPSPI_clockSource / (PRESCALE * Delay_scaler).
880 *
881 * @param base LPSPI peripheral address.
882 * @param delayTimeInNanoSec The desired delay value in nano-seconds.
883 * @param whichDelay The desired delay to configuration, which must be of type lpspi_delay_type_t.
884 * @param srcClock_Hz Module source input clock in Hertz.
885 * @return actual Calculated delay value in nano-seconds.
886 */
887uint32_t LPSPI_MasterSetDelayTimes(LPSPI_Type *base,
888 uint32_t delayTimeInNanoSec,
889 lpspi_delay_type_t whichDelay,
890 uint32_t srcClock_Hz);
891
892/*!
893 * @brief Writes data into the transmit data buffer.
894 *
895 * This function writes data passed in by the user to the Transmit Data Register (TDR).
896 * The user can pass up to 32-bits of data to load into the TDR. If the frame size exceeds 32-bits,
897 * the user has to manage sending the data one 32-bit word at a time.
898 * Any writes to the TDR result in an immediate push to the transmit FIFO.
899 * This function can be used for either master or slave modes.
900 *
901 * @param base LPSPI peripheral address.
902 * @param data The data word to be sent.
903 */
904static inline void LPSPI_WriteData(LPSPI_Type *base, uint32_t data)
905{
906 base->TDR = data;
907}
908
909/*!
910 * @brief Reads data from the data buffer.
911 *
912 * This function reads the data from the Receive Data Register (RDR).
913 * This function can be used for either master or slave mode.
914 *
915 * @param base LPSPI peripheral address.
916 * @return The data read from the data buffer.
917 */
918static inline uint32_t LPSPI_ReadData(LPSPI_Type *base)
919{
920 return (base->RDR);
921}
922
923/*!
924 * @brief Set up the dummy data.
925 *
926 * @param base LPSPI peripheral address.
927 * @param dummyData Data to be transferred when tx buffer is NULL.
928 * Note:
929 * This API has no effect when LPSPI in slave interrupt mode, because driver
930 * will set the TXMSK bit to 1 if txData is NULL, no data is loaded from transmit
931 * FIFO and output pin is tristated.
932 */
933void LPSPI_SetDummyData(LPSPI_Type *base, uint8_t dummyData);
934
935/*!
936 *@}
937*/
938
939/*!
940 * @name Transactional
941 * @{
942 */
943/*Transactional APIs*/
944
945/*!
946 * @brief Initializes the LPSPI master handle.
947 *
948 * This function initializes the LPSPI handle, which can be used for other LPSPI transactional APIs. Usually, for a
949 * specified LPSPI instance, call this API once to get the initialized handle.
950
951 * @param base LPSPI peripheral address.
952 * @param handle LPSPI handle pointer to lpspi_master_handle_t.
953 * @param callback DSPI callback.
954 * @param userData callback function parameter.
955 */
956void LPSPI_MasterTransferCreateHandle(LPSPI_Type *base,
957 lpspi_master_handle_t *handle,
959 void *userData);
960
961/*!
962 * @brief LPSPI master transfer data using a polling method.
963 *
964 * This function transfers data using a polling method. This is a blocking function, which does not return until all
965 * transfers have been
966 * completed.
967 *
968 * Note:
969 * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4.
970 * For bytesPerFrame greater than 4:
971 * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not integer multiples of 4.
972 * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame.
973 *
974 * @param base LPSPI peripheral address.
975 * @param transfer pointer to lpspi_transfer_t structure.
976 * @return status of status_t.
977 */
978status_t LPSPI_MasterTransferBlocking(LPSPI_Type *base, lpspi_transfer_t *transfer);
979
980/*!
981 * @brief LPSPI master transfer data using an interrupt method.
982 *
983 * This function transfers data using an interrupt method. This is a non-blocking function, which returns right away.
984 * When all data
985 * is transferred, the callback function is called.
986 *
987 * Note:
988 * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4.
989 * For bytesPerFrame greater than 4:
990 * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not integer multiples of 4.
991 * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame.
992 *
993 * @param base LPSPI peripheral address.
994 * @param handle pointer to lpspi_master_handle_t structure which stores the transfer state.
995 * @param transfer pointer to lpspi_transfer_t structure.
996 * @return status of status_t.
997 */
999
1000/*!
1001 * @brief Gets the master transfer remaining bytes.
1002 *
1003 * This function gets the master transfer remaining bytes.
1004 *
1005 * @param base LPSPI peripheral address.
1006 * @param handle pointer to lpspi_master_handle_t structure which stores the transfer state.
1007 * @param count Number of bytes transferred so far by the non-blocking transaction.
1008 * @return status of status_t.
1009 */
1010status_t LPSPI_MasterTransferGetCount(LPSPI_Type *base, lpspi_master_handle_t *handle, size_t *count);
1011
1012/*!
1013 * @brief LPSPI master abort transfer which uses an interrupt method.
1014 *
1015 * This function aborts a transfer which uses an interrupt method.
1016 *
1017 * @param base LPSPI peripheral address.
1018 * @param handle pointer to lpspi_master_handle_t structure which stores the transfer state.
1019 */
1020void LPSPI_MasterTransferAbort(LPSPI_Type *base, lpspi_master_handle_t *handle);
1021
1022/*!
1023 * @brief LPSPI Master IRQ handler function.
1024 *
1025 * This function processes the LPSPI transmit and receive IRQ.
1026 *
1027 * @param base LPSPI peripheral address.
1028 * @param handle pointer to lpspi_master_handle_t structure which stores the transfer state.
1029 */
1030void LPSPI_MasterTransferHandleIRQ(LPSPI_Type *base, lpspi_master_handle_t *handle);
1031
1032/*!
1033 * @brief Initializes the LPSPI slave handle.
1034 *
1035 * This function initializes the LPSPI handle, which can be used for other LPSPI transactional APIs. Usually, for a
1036 * specified LPSPI instance, call this API once to get the initialized handle.
1037 *
1038 * @param base LPSPI peripheral address.
1039 * @param handle LPSPI handle pointer to lpspi_slave_handle_t.
1040 * @param callback DSPI callback.
1041 * @param userData callback function parameter.
1042 */
1043void LPSPI_SlaveTransferCreateHandle(LPSPI_Type *base,
1044 lpspi_slave_handle_t *handle,
1046 void *userData);
1047
1048/*!
1049 * @brief LPSPI slave transfer data using an interrupt method.
1050 *
1051 * This function transfer data using an interrupt method. This is a non-blocking function, which returns right away.
1052 * When all data
1053 * is transferred, the callback function is called.
1054 *
1055 * Note:
1056 * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4.
1057 * For bytesPerFrame greater than 4:
1058 * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not an integer multiple of 4.
1059 * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame.
1060 *
1061 * @param base LPSPI peripheral address.
1062 * @param handle pointer to lpspi_slave_handle_t structure which stores the transfer state.
1063 * @param transfer pointer to lpspi_transfer_t structure.
1064 * @return status of status_t.
1065 */
1067
1068/*!
1069 * @brief Gets the slave transfer remaining bytes.
1070 *
1071 * This function gets the slave transfer remaining bytes.
1072 *
1073 * @param base LPSPI peripheral address.
1074 * @param handle pointer to lpspi_slave_handle_t structure which stores the transfer state.
1075 * @param count Number of bytes transferred so far by the non-blocking transaction.
1076 * @return status of status_t.
1077 */
1078status_t LPSPI_SlaveTransferGetCount(LPSPI_Type *base, lpspi_slave_handle_t *handle, size_t *count);
1079
1080/*!
1081 * @brief LPSPI slave aborts a transfer which uses an interrupt method.
1082 *
1083 * This function aborts a transfer which uses an interrupt method.
1084 *
1085 * @param base LPSPI peripheral address.
1086 * @param handle pointer to lpspi_slave_handle_t structure which stores the transfer state.
1087 */
1088void LPSPI_SlaveTransferAbort(LPSPI_Type *base, lpspi_slave_handle_t *handle);
1089
1090/*!
1091 * @brief LPSPI Slave IRQ handler function.
1092 *
1093 * This function processes the LPSPI transmit and receives an IRQ.
1094 *
1095 * @param base LPSPI peripheral address.
1096 * @param handle pointer to lpspi_slave_handle_t structure which stores the transfer state.
1097 */
1098void LPSPI_SlaveTransferHandleIRQ(LPSPI_Type *base, lpspi_slave_handle_t *handle);
1099
1100/*!
1101 *@}
1102*/
1103
1104#if defined(__cplusplus)
1105}
1106#endif /*_cplusplus*/
1107 /*!
1108 *@}
1109 */
1110
1111#endif /*_FSL_LPSPI_H_*/
int32_t status_t
Type used for all status and error return values.
Definition fsl_common.h:169
@ kStatusGroup_LPSPI
Definition fsl_common.h:64
struct _lpspi_slave_config lpspi_slave_config_t
LPSPI slave configuration structure.
static uint32_t LPSPI_GetRxFifoSize(LPSPI_Type *base)
Gets the LPSPI Rx FIFO size.
Definition fsl_lpspi.h:537
enum _lpspi_host_request_select lpspi_host_request_select_t
LPSPI Host Request select configuration.
static void LPSPI_FlushFifo(LPSPI_Type *base, bool flushTxFifo, bool flushRxFifo)
Flushes the LPSPI FIFOs.
Definition fsl_lpspi.h:743
status_t LPSPI_SlaveTransferGetCount(LPSPI_Type *base, lpspi_slave_handle_t *handle, size_t *count)
Gets the slave transfer remaining bytes.
Definition fsl_lpspi.c:1629
static void LPSPI_SetFrameSize(LPSPI_Type *base, uint32_t frameSize)
Configures the frame size.
Definition fsl_lpspi.h:802
void LPSPI_MasterInit(LPSPI_Type *base, const lpspi_master_config_t *masterConfig, uint32_t srcClock_Hz)
Initializes the LPSPI master.
Definition fsl_lpspi.c:187
_lpspi_transfer_width
LPSPI transfer width configuration.
Definition fsl_lpspi.h:178
void LPSPI_SlaveInit(LPSPI_Type *base, const lpspi_slave_config_t *slaveConfig)
LPSPI slave configuration.
Definition fsl_lpspi.c:279
void LPSPI_SetDummyData(LPSPI_Type *base, uint8_t dummyData)
Set up the dummy data.
Definition fsl_lpspi.c:174
static void LPSPI_SetMasterSlaveMode(LPSPI_Type *base, lpspi_master_slave_mode_t mode)
Configures the LPSPI for either master or slave.
Definition fsl_lpspi.h:720
uint32_t LPSPI_MasterSetDelayTimes(LPSPI_Type *base, uint32_t delayTimeInNanoSec, lpspi_delay_type_t whichDelay, uint32_t srcClock_Hz)
Calculates the delay based on the desired delay input in nanoseconds (module must be disabled to chan...
Definition fsl_lpspi.c:567
enum _lpspi_clock_phase lpspi_clock_phase_t
LPSPI clock phase configuration.
static void LPSPI_DisableInterrupts(LPSPI_Type *base, uint32_t mask)
Disables the LPSPI interrupts.
Definition fsl_lpspi.h:617
status_t LPSPI_SlaveTransferNonBlocking(LPSPI_Type *base, lpspi_slave_handle_t *handle, lpspi_transfer_t *transfer)
LPSPI slave transfer data using an interrupt method.
Definition fsl_lpspi.c:1403
enum _lpspi_pcs_polarity_config lpspi_pcs_polarity_config_t
LPSPI Peripheral Chip Select (PCS) Polarity configuration.
static uint32_t LPSPI_GetRxRegisterAddress(LPSPI_Type *base)
Gets the LPSPI Receive Data Register address for a DMA operation.
Definition fsl_lpspi.h:688
static void LPSPI_ClearStatusFlags(LPSPI_Type *base, uint32_t statusFlags)
Clears the LPSPI status flag.
Definition fsl_lpspi.h:575
static void LPSPI_EnableInterrupts(LPSPI_Type *base, uint32_t mask)
Enables the LPSPI interrupts.
Definition fsl_lpspi.h:602
_lpspi_match_config
LPSPI Match configuration options.
Definition fsl_lpspi.h:150
enum _lpspi_which_pcs_config lpspi_which_pcs_t
LPSPI Peripheral Chip Select (PCS) configuration (which PCS to configure).
void LPSPI_SlaveGetDefaultConfig(lpspi_slave_config_t *slaveConfig)
Sets the lpspi_slave_config_t structure to default values.
Definition fsl_lpspi.c:326
void(* lpspi_slave_transfer_callback_t)(LPSPI_Type *base, lpspi_slave_handle_t *handle, status_t status, void *userData)
Slave completion callback function pointer type.
Definition fsl_lpspi.h:330
enum _lpspi_master_slave_mode lpspi_master_slave_mode_t
LPSPI master or slave mode configuration.
_lpspi_master_slave_mode
LPSPI master or slave mode configuration.
Definition fsl_lpspi.h:87
void(* lpspi_master_transfer_callback_t)(LPSPI_Type *base, lpspi_master_handle_t *handle, status_t status, void *userData)
Master completion callback function pointer type.
Definition fsl_lpspi.h:317
void LPSPI_Reset(LPSPI_Type *base)
Restores the LPSPI peripheral to reset state. Note that this function sets all registers to reset sta...
Definition fsl_lpspi.c:351
static uint32_t LPSPI_GetStatusFlags(LPSPI_Type *base)
Gets the LPSPI status flag state.
Definition fsl_lpspi.h:517
_lpspi_pcs_polarity
LPSPI Peripheral Chip Select (PCS) Polarity.
Definition fsl_lpspi.h:110
uint32_t LPSPI_MasterSetBaudRate(LPSPI_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz, uint32_t *tcrPrescaleValue)
Sets the LPSPI baud rate in bits per second.
Definition fsl_lpspi.c:420
status_t LPSPI_MasterTransferBlocking(LPSPI_Type *base, lpspi_transfer_t *transfer)
LPSPI master transfer data using a polling method.
Definition fsl_lpspi.c:779
static void LPSPI_Enable(LPSPI_Type *base, bool enable)
Enables the LPSPI peripheral and sets the MCR MDIS to 0.
Definition fsl_lpspi.h:491
_lpspi_transfer_state
LPSPI transfer state, which is used for LPSPI transactional API state machine.
Definition fsl_lpspi.h:248
void LPSPI_SlaveTransferCreateHandle(LPSPI_Type *base, lpspi_slave_handle_t *handle, lpspi_slave_transfer_callback_t callback, void *userData)
Initializes the LPSPI slave handle.
Definition fsl_lpspi.c:1366
_lpspi_pin_config
LPSPI pin (SDO and SDI) configuration.
Definition fsl_lpspi.h:162
_lpspi_transfer_config_flag_for_master
Use this enumeration for LPSPI master transfer configFlags.
Definition fsl_lpspi.h:197
_lpspi_status
Status for the LPSPI driver.
Definition fsl_lpspi.h:38
static void LPSPI_SetFifoWatermarks(LPSPI_Type *base, uint32_t txWater, uint32_t rxWater)
Sets the transmit and receive FIFO watermark values.
Definition fsl_lpspi.h:759
enum _lpspi_data_out_config lpspi_data_out_config_t
LPSPI data output configuration.
volatile uint8_t g_lpspiDummyData[]
Global variable for dummy data value setting.
Definition fsl_lpspi.c:142
static void LPSPI_EnableDMA(LPSPI_Type *base, uint32_t mask)
Enables the LPSPI DMA request.
Definition fsl_lpspi.h:642
status_t LPSPI_MasterTransferNonBlocking(LPSPI_Type *base, lpspi_master_handle_t *handle, lpspi_transfer_t *transfer)
LPSPI master transfer data using an interrupt method.
Definition fsl_lpspi.c:961
enum _lpspi_pin_config lpspi_pin_config_t
LPSPI pin (SDO and SDI) configuration.
void LPSPI_MasterSetDelayScaler(LPSPI_Type *base, uint32_t scaler, lpspi_delay_type_t whichDelay)
Manually configures a specific LPSPI delay parameter (module must be disabled to change the delay val...
Definition fsl_lpspi.c:516
_lpspi_pcs_polarity_config
LPSPI Peripheral Chip Select (PCS) Polarity configuration.
Definition fsl_lpspi.h:103
_lpspi_host_request_select
LPSPI Host Request select configuration.
Definition fsl_lpspi.h:143
static uint32_t LPSPI_ReadData(LPSPI_Type *base)
Reads data from the data buffer.
Definition fsl_lpspi.h:918
struct _lpspi_master_config lpspi_master_config_t
LPSPI master configuration structure.
static uint32_t LPSPI_GetTxFifoSize(LPSPI_Type *base)
Gets the LPSPI Tx FIFO size.
Definition fsl_lpspi.h:527
enum _lpspi_transfer_width lpspi_transfer_width_t
LPSPI transfer width configuration.
static uint32_t LPSPI_GetTxFifoCount(LPSPI_Type *base)
Gets the LPSPI Tx FIFO count.
Definition fsl_lpspi.h:547
bool LPSPI_CheckTransferArgument(lpspi_transfer_t *transfer, uint32_t bitsPerFrame, uint32_t bytesPerFrame)
Check the argument for transfer .
Definition fsl_lpspi.c:713
void LPSPI_SlaveTransferHandleIRQ(LPSPI_Type *base, lpspi_slave_handle_t *handle)
LPSPI Slave IRQ handler function.
Definition fsl_lpspi.c:1691
void LPSPI_MasterTransferHandleIRQ(LPSPI_Type *base, lpspi_master_handle_t *handle)
LPSPI Master IRQ handler function.
Definition fsl_lpspi.c:1257
enum _lpspi_match_config lpspi_match_config_t
LPSPI Match configuration options.
_lpspi_interrupt_enable
LPSPI interrupt source.
Definition fsl_lpspi.h:64
_lpspi_shift_direction
LPSPI data shifter direction options.
Definition fsl_lpspi.h:136
_lpspi_data_out_config
LPSPI data output configuration.
Definition fsl_lpspi.h:171
static void LPSPI_WriteData(LPSPI_Type *base, uint32_t data)
Writes data into the transmit data buffer.
Definition fsl_lpspi.h:904
_lpspi_which_pcs_config
LPSPI Peripheral Chip Select (PCS) configuration (which PCS to configure).
Definition fsl_lpspi.h:94
static void LPSPI_SetAllPcsPolarity(LPSPI_Type *base, uint32_t mask)
Configures all LPSPI peripheral chip select polarities simultaneously.
Definition fsl_lpspi.h:778
enum _lpspi_delay_type lpspi_delay_type_t
LPSPI delay type selection.
static uint32_t LPSPI_GetRxFifoCount(LPSPI_Type *base)
Gets the LPSPI Rx FIFO count.
Definition fsl_lpspi.h:557
_lpspi_delay_type
LPSPI delay type selection.
Definition fsl_lpspi.h:186
static uint32_t LPSPI_GetTxRegisterAddress(LPSPI_Type *base)
Gets the LPSPI Transmit Data Register address for a DMA operation.
Definition fsl_lpspi.h:673
enum _lpspi_clock_polarity lpspi_clock_polarity_t
LPSPI clock polarity configuration.
void LPSPI_SlaveTransferAbort(LPSPI_Type *base, lpspi_slave_handle_t *handle)
LPSPI slave aborts a transfer which uses an interrupt method.
Definition fsl_lpspi.c:1669
_lpspi_flags
LPSPI status flags in SPIx_SR register.
Definition fsl_lpspi.h:47
_lpspi_clock_polarity
LPSPI clock polarity configuration.
Definition fsl_lpspi.h:120
static void LPSPI_DisableDMA(LPSPI_Type *base, uint32_t mask)
Disables the LPSPI DMA request.
Definition fsl_lpspi.h:658
void LPSPI_MasterTransferCreateHandle(LPSPI_Type *base, lpspi_master_handle_t *handle, lpspi_master_transfer_callback_t callback, void *userData)
Initializes the LPSPI master handle.
Definition fsl_lpspi.c:686
_lpspi_clock_phase
LPSPI clock phase configuration.
Definition fsl_lpspi.h:127
void LPSPI_Deinit(LPSPI_Type *base)
De-initializes the LPSPI peripheral. Call this API to disable the LPSPI clock.
Definition fsl_lpspi.c:367
enum _lpspi_shift_direction lpspi_shift_direction_t
LPSPI data shifter direction options.
static bool LPSPI_IsMaster(LPSPI_Type *base)
Returns whether the LPSPI module is in master mode.
Definition fsl_lpspi.h:731
_lpspi_transfer_config_flag_for_slave
Use this enumeration for LPSPI slave transfer configFlags.
Definition fsl_lpspi.h:225
void LPSPI_MasterTransferAbort(LPSPI_Type *base, lpspi_master_handle_t *handle)
LPSPI master abort transfer which uses an interrupt method.
Definition fsl_lpspi.c:1235
void LPSPI_MasterGetDefaultConfig(lpspi_master_config_t *masterConfig)
Sets the lpspi_master_config_t structure to default values.
Definition fsl_lpspi.c:249
_lpspi_dma_enable
LPSPI DMA source.
Definition fsl_lpspi.h:80
struct _lpspi_transfer lpspi_transfer_t
LPSPI master/slave transfer structure.
status_t LPSPI_MasterTransferGetCount(LPSPI_Type *base, lpspi_master_handle_t *handle, size_t *count)
Gets the master transfer remaining bytes.
Definition fsl_lpspi.c:1195
@ kLPSPI_SingleBitXfer
Definition fsl_lpspi.h:179
@ kLPSPI_FourBitXfer
Definition fsl_lpspi.h:181
@ kLPSPI_TwoBitXfer
Definition fsl_lpspi.h:180
@ kLPSI_AnyWordAndM1EqualsM0andM1
Definition fsl_lpspi.h:157
@ kLPSI_MatchDisabled
Definition fsl_lpspi.h:151
@ kLPSI_1stWordEqualsM0and2ndWordEqualsM1
Definition fsl_lpspi.h:154
@ kLPSI_1stWordEqualsM0orM1
Definition fsl_lpspi.h:152
@ kLPSI_1stWordAndM1EqualsM0andM1
Definition fsl_lpspi.h:156
@ kLPSI_AnyWordEqualsM0andNxtWordEqualsM1
Definition fsl_lpspi.h:155
@ kLPSI_AnyWordEqualsM0orM1
Definition fsl_lpspi.h:153
@ kLPSPI_Master
Definition fsl_lpspi.h:88
@ kLPSPI_Slave
Definition fsl_lpspi.h:89
@ kLPSPI_Pcs0ActiveLow
Definition fsl_lpspi.h:111
@ kLPSPI_Pcs2ActiveLow
Definition fsl_lpspi.h:113
@ kLPSPI_PcsAllActiveLow
Definition fsl_lpspi.h:115
@ kLPSPI_Pcs3ActiveLow
Definition fsl_lpspi.h:114
@ kLPSPI_Pcs1ActiveLow
Definition fsl_lpspi.h:112
@ kLPSPI_Busy
Definition fsl_lpspi.h:250
@ kLPSPI_Error
Definition fsl_lpspi.h:251
@ kLPSPI_Idle
Definition fsl_lpspi.h:249
@ kLPSPI_SdiInSdiOut
Definition fsl_lpspi.h:164
@ kLPSPI_SdiInSdoOut
Definition fsl_lpspi.h:163
@ kLPSPI_SdoInSdoOut
Definition fsl_lpspi.h:165
@ kLPSPI_SdoInSdiOut
Definition fsl_lpspi.h:166
@ kLPSPI_MasterPcs1
Definition fsl_lpspi.h:199
@ kLPSPI_MasterPcs3
Definition fsl_lpspi.h:201
@ kLPSPI_MasterPcsContinuous
Definition fsl_lpspi.h:203
@ kLPSPI_MasterByteSwap
Definition fsl_lpspi.h:205
@ kLPSPI_MasterPcs2
Definition fsl_lpspi.h:200
@ kLPSPI_MasterPcs0
Definition fsl_lpspi.h:198
@ kStatus_LPSPI_OutOfRange
Definition fsl_lpspi.h:42
@ kStatus_LPSPI_Error
Definition fsl_lpspi.h:40
@ kStatus_LPSPI_Idle
Definition fsl_lpspi.h:41
@ kStatus_LPSPI_Busy
Definition fsl_lpspi.h:39
@ kLPSPI_PcsActiveLow
Definition fsl_lpspi.h:105
@ kLPSPI_PcsActiveHigh
Definition fsl_lpspi.h:104
@ kLPSPI_HostReqExtPin
Definition fsl_lpspi.h:144
@ kLPSPI_HostReqInternalTrigger
Definition fsl_lpspi.h:145
@ kLPSPI_ReceiveErrorInterruptEnable
Definition fsl_lpspi.h:71
@ kLPSPI_FrameCompleteInterruptEnable
Definition fsl_lpspi.h:68
@ kLPSPI_TransmitErrorInterruptEnable
Definition fsl_lpspi.h:70
@ kLPSPI_AllInterruptEnable
Definition fsl_lpspi.h:73
@ kLPSPI_RxInterruptEnable
Definition fsl_lpspi.h:66
@ kLPSPI_TxInterruptEnable
Definition fsl_lpspi.h:65
@ kLPSPI_DataMatchInterruptEnable
Definition fsl_lpspi.h:72
@ kLPSPI_WordCompleteInterruptEnable
Definition fsl_lpspi.h:67
@ kLPSPI_TransferCompleteInterruptEnable
Definition fsl_lpspi.h:69
@ kLPSPI_MsbFirst
Definition fsl_lpspi.h:137
@ kLPSPI_LsbFirst
Definition fsl_lpspi.h:138
@ kLpspiDataOutRetained
Definition fsl_lpspi.h:172
@ kLpspiDataOutTristate
Definition fsl_lpspi.h:173
@ kLPSPI_Pcs1
Definition fsl_lpspi.h:96
@ kLPSPI_Pcs2
Definition fsl_lpspi.h:97
@ kLPSPI_Pcs3
Definition fsl_lpspi.h:98
@ kLPSPI_Pcs0
Definition fsl_lpspi.h:95
@ kLPSPI_PcsToSck
Definition fsl_lpspi.h:187
@ kLPSPI_LastSckToPcs
Definition fsl_lpspi.h:188
@ kLPSPI_BetweenTransfer
Definition fsl_lpspi.h:189
@ kLPSPI_TransmitErrorFlag
Definition fsl_lpspi.h:53
@ kLPSPI_TxDataRequestFlag
Definition fsl_lpspi.h:48
@ kLPSPI_TransferCompleteFlag
Definition fsl_lpspi.h:52
@ kLPSPI_DataMatchFlag
Definition fsl_lpspi.h:55
@ kLPSPI_RxDataReadyFlag
Definition fsl_lpspi.h:49
@ kLPSPI_ModuleBusyFlag
Definition fsl_lpspi.h:56
@ kLPSPI_ReceiveErrorFlag
Definition fsl_lpspi.h:54
@ kLPSPI_FrameCompleteFlag
Definition fsl_lpspi.h:51
@ kLPSPI_WordCompleteFlag
Definition fsl_lpspi.h:50
@ kLPSPI_AllStatusFlag
Definition fsl_lpspi.h:57
@ kLPSPI_ClockPolarityActiveHigh
Definition fsl_lpspi.h:121
@ kLPSPI_ClockPolarityActiveLow
Definition fsl_lpspi.h:122
@ kLPSPI_ClockPhaseFirstEdge
Definition fsl_lpspi.h:128
@ kLPSPI_ClockPhaseSecondEdge
Definition fsl_lpspi.h:130
@ kLPSPI_SlavePcs1
Definition fsl_lpspi.h:227
@ kLPSPI_SlaveByteSwap
Definition fsl_lpspi.h:231
@ kLPSPI_SlavePcs3
Definition fsl_lpspi.h:229
@ kLPSPI_SlavePcs0
Definition fsl_lpspi.h:226
@ kLPSPI_SlavePcs2
Definition fsl_lpspi.h:228
@ kLPSPI_TxDmaEnable
Definition fsl_lpspi.h:81
@ kLPSPI_RxDmaEnable
Definition fsl_lpspi.h:82
static void enable(const char *param)
Definition settings.cpp:441
LPSPI master configuration structure.
Definition fsl_lpspi.h:256
lpspi_pcs_polarity_config_t pcsActiveHighOrLow
Definition fsl_lpspi.h:272
lpspi_shift_direction_t direction
Definition fsl_lpspi.h:261
lpspi_data_out_config_t dataOutConfig
Definition fsl_lpspi.h:277
lpspi_clock_phase_t cpha
Definition fsl_lpspi.h:260
uint32_t betweenTransferDelayInNanoSec
Definition fsl_lpspi.h:268
uint32_t lastSckToPcsDelayInNanoSec
Definition fsl_lpspi.h:265
lpspi_which_pcs_t whichPcs
Definition fsl_lpspi.h:271
uint32_t pcsToSckDelayInNanoSec
Definition fsl_lpspi.h:263
lpspi_clock_polarity_t cpol
Definition fsl_lpspi.h:259
lpspi_pin_config_t pinCfg
Definition fsl_lpspi.h:274
LPSPI master transfer handle structure used for transactional API.
Definition fsl_lpspi.h:350
uint8_t *volatile txData
Definition fsl_lpspi.h:363
volatile uint8_t fifoSize
Definition fsl_lpspi.h:356
uint8_t *volatile rxData
Definition fsl_lpspi.h:364
volatile uint8_t state
Definition fsl_lpspi.h:375
volatile uint32_t writeRegRemainingTimes
Definition fsl_lpspi.h:368
volatile uint8_t bytesEachRead
Definition fsl_lpspi.h:361
volatile uint8_t rxWatermark
Definition fsl_lpspi.h:358
lpspi_master_transfer_callback_t callback
Definition fsl_lpspi.h:377
volatile uint32_t readRegRemainingTimes
Definition fsl_lpspi.h:369
volatile size_t txRemainingByteCount
Definition fsl_lpspi.h:365
volatile bool writeTcrInIsr
Definition fsl_lpspi.h:352
volatile uint8_t bytesEachWrite
Definition fsl_lpspi.h:360
volatile bool isByteSwap
Definition fsl_lpspi.h:354
uint32_t totalByteCount
Definition fsl_lpspi.h:371
volatile size_t rxRemainingByteCount
Definition fsl_lpspi.h:366
volatile bool isPcsContinuous
Definition fsl_lpspi.h:351
LPSPI slave configuration structure.
Definition fsl_lpspi.h:283
lpspi_clock_phase_t cpha
Definition fsl_lpspi.h:286
lpspi_shift_direction_t direction
Definition fsl_lpspi.h:287
lpspi_pcs_polarity_config_t pcsActiveHighOrLow
Definition fsl_lpspi.h:290
lpspi_data_out_config_t dataOutConfig
Definition fsl_lpspi.h:295
uint32_t bitsPerFrame
Definition fsl_lpspi.h:284
lpspi_clock_polarity_t cpol
Definition fsl_lpspi.h:285
lpspi_which_pcs_t whichPcs
Definition fsl_lpspi.h:289
lpspi_pin_config_t pinCfg
Definition fsl_lpspi.h:292
LPSPI slave transfer handle structure used for transactional API.
Definition fsl_lpspi.h:383
volatile uint8_t state
Definition fsl_lpspi.h:404
volatile size_t txRemainingByteCount
Definition fsl_lpspi.h:396
volatile uint8_t rxWatermark
Definition fsl_lpspi.h:388
uint8_t *volatile rxData
Definition fsl_lpspi.h:394
volatile size_t rxRemainingByteCount
Definition fsl_lpspi.h:397
volatile uint8_t fifoSize
Definition fsl_lpspi.h:386
volatile uint8_t bytesEachRead
Definition fsl_lpspi.h:391
volatile uint32_t errorCount
Definition fsl_lpspi.h:406
volatile uint32_t readRegRemainingTimes
Definition fsl_lpspi.h:400
volatile uint8_t bytesEachWrite
Definition fsl_lpspi.h:390
uint8_t *volatile txData
Definition fsl_lpspi.h:393
uint32_t totalByteCount
Definition fsl_lpspi.h:402
volatile bool isByteSwap
Definition fsl_lpspi.h:384
volatile uint32_t writeRegRemainingTimes
Definition fsl_lpspi.h:399
lpspi_slave_transfer_callback_t callback
Definition fsl_lpspi.h:408
LPSPI master/slave transfer structure.
Definition fsl_lpspi.h:337
uint8_t * rxData
Definition fsl_lpspi.h:339
uint32_t configFlags
Definition fsl_lpspi.h:343
volatile size_t dataSize
Definition fsl_lpspi.h:340
uint8_t * txData
Definition fsl_lpspi.h:338
uint16_t count
Definition tunerstudio.h:1