RTEMS 6.1-rc4
Loading...
Searching...
No Matches
fsl_lpspi.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_H_
9#define _FSL_LPSPI_H_
10
11#include "fsl_common.h"
12
18/**********************************************************************************************************************
19 * Definitions
20 *********************************************************************************************************************/
21
25#define FSL_LPSPI_DRIVER_VERSION (MAKE_VERSION(2, 4, 0))
28#ifndef LPSPI_DUMMY_DATA
30#define LPSPI_DUMMY_DATA (0x00U)
31#endif
32
34#ifndef SPI_RETRY_TIMES
35#define SPI_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */
36#endif
37
39extern volatile uint8_t g_lpspiDummyData[];
40
42enum
43{
49};
50
53{
54 kLPSPI_TxDataRequestFlag = LPSPI_SR_TDF_MASK,
55 kLPSPI_RxDataReadyFlag = LPSPI_SR_RDF_MASK,
56 kLPSPI_WordCompleteFlag = LPSPI_SR_WCF_MASK,
57 kLPSPI_FrameCompleteFlag = LPSPI_SR_FCF_MASK,
58 kLPSPI_TransferCompleteFlag = LPSPI_SR_TCF_MASK,
59 kLPSPI_TransmitErrorFlag = LPSPI_SR_TEF_MASK,
60 kLPSPI_ReceiveErrorFlag = LPSPI_SR_REF_MASK,
61 kLPSPI_DataMatchFlag = LPSPI_SR_DMF_MASK,
62 kLPSPI_ModuleBusyFlag = LPSPI_SR_MBF_MASK,
63 kLPSPI_AllStatusFlag = (LPSPI_SR_TDF_MASK | LPSPI_SR_RDF_MASK | LPSPI_SR_WCF_MASK | LPSPI_SR_FCF_MASK |
64 LPSPI_SR_TCF_MASK | LPSPI_SR_TEF_MASK | LPSPI_SR_REF_MASK | LPSPI_SR_DMF_MASK |
65 LPSPI_SR_MBF_MASK)
66};
67
70{
71 kLPSPI_TxInterruptEnable = LPSPI_IER_TDIE_MASK,
72 kLPSPI_RxInterruptEnable = LPSPI_IER_RDIE_MASK,
73 kLPSPI_WordCompleteInterruptEnable = LPSPI_IER_WCIE_MASK,
77 kLPSPI_ReceiveErrorInterruptEnable = LPSPI_IER_REIE_MASK,
78 kLPSPI_DataMatchInterruptEnable = LPSPI_IER_DMIE_MASK,
80 (LPSPI_IER_TDIE_MASK | LPSPI_IER_RDIE_MASK | LPSPI_IER_WCIE_MASK | LPSPI_IER_FCIE_MASK | LPSPI_IER_TCIE_MASK |
81 LPSPI_IER_TEIE_MASK | LPSPI_IER_REIE_MASK | LPSPI_IER_DMIE_MASK)
82};
83
86{
87 kLPSPI_TxDmaEnable = LPSPI_DER_TDDE_MASK,
88 kLPSPI_RxDmaEnable = LPSPI_DER_RDDE_MASK
89};
90
93{
95 kLPSPI_Slave = 0U
97
100{
104 kLPSPI_Pcs3 = 3U
106
109{
113
116{
123
126{
130
133{
139
142{
144 kLPSPI_LsbFirst = 1U
146
149{
153
156{
165
168{
174
177{
181
184{
189
192{
197
198#define LPSPI_MASTER_PCS_SHIFT (4U)
199#define LPSPI_MASTER_PCS_MASK (0xF0U)
203{
212 1U << 22
225
226#define LPSPI_SLAVE_PCS_SHIFT (4U)
227#define LPSPI_SLAVE_PCS_MASK (0xF0U)
231{
238 1U << 22
251
254{
255 kLPSPI_Idle = 0x0U,
259
262{
263 uint32_t baudRate;
264 uint32_t bitsPerFrame;
287
290{
291 uint32_t bitsPerFrame;
305
310
315
325 lpspi_master_handle_t *handle,
326 status_t status,
327 void *userData);
328
338 lpspi_slave_handle_t *handle,
339 status_t status,
340 void *userData);
341
343typedef struct _lpspi_transfer
344{
345 uint8_t *txData;
346 uint8_t *rxData;
347 volatile size_t dataSize;
349 uint32_t configFlags;
353
356{
357 volatile bool isPcsContinuous;
358 volatile bool writeTcrInIsr;
360 volatile bool isByteSwap;
361 volatile bool isTxMask;
362 volatile uint16_t bytesPerFrame;
364 volatile uint8_t fifoSize;
366 volatile uint8_t rxWatermark;
368 volatile uint8_t bytesEachWrite;
369 volatile uint8_t bytesEachRead;
371 uint8_t *volatile txData;
372 uint8_t *volatile rxData;
373 volatile size_t txRemainingByteCount;
374 volatile size_t rxRemainingByteCount;
376 volatile uint32_t writeRegRemainingTimes;
377 volatile uint32_t readRegRemainingTimes;
379 uint32_t totalByteCount;
381 uint32_t txBuffIfNull;
383 volatile uint8_t state;
386 void *userData;
387};
388
391{
392 volatile bool isByteSwap;
394 volatile uint8_t fifoSize;
396 volatile uint8_t rxWatermark;
398 volatile uint8_t bytesEachWrite;
399 volatile uint8_t bytesEachRead;
401 uint8_t *volatile txData;
402 uint8_t *volatile rxData;
404 volatile size_t txRemainingByteCount;
405 volatile size_t rxRemainingByteCount;
407 volatile uint32_t writeRegRemainingTimes;
408 volatile uint32_t readRegRemainingTimes;
410 uint32_t totalByteCount;
412 volatile uint8_t state;
414 volatile uint32_t errorCount;
417 void *userData;
418};
419
420/**********************************************************************************************************************
421 * API
422 *********************************************************************************************************************/
423#if defined(__cplusplus)
424extern "C" {
425#endif /*_cplusplus*/
426
439void LPSPI_MasterInit(LPSPI_Type *base, const lpspi_master_config_t *masterConfig, uint32_t srcClock_Hz);
440
455
462void LPSPI_SlaveInit(LPSPI_Type *base, const lpspi_slave_config_t *slaveConfig);
463
478
483void LPSPI_Deinit(LPSPI_Type *base);
484
491void LPSPI_Reset(LPSPI_Type *base);
492
499uint32_t LPSPI_GetInstance(LPSPI_Type *base);
500
507static inline void LPSPI_Enable(LPSPI_Type *base, bool enable)
508{
509 if (enable)
510 {
511 base->CR |= LPSPI_CR_MEN_MASK;
512 }
513 else
514 {
515 base->CR &= ~LPSPI_CR_MEN_MASK;
516 }
517}
518
533static inline uint32_t LPSPI_GetStatusFlags(LPSPI_Type *base)
534{
535 return (base->SR);
536}
537
543static inline uint8_t LPSPI_GetTxFifoSize(LPSPI_Type *base)
544{
545 return (1U << ((base->PARAM & LPSPI_PARAM_TXFIFO_MASK) >> LPSPI_PARAM_TXFIFO_SHIFT));
546}
547
553static inline uint8_t LPSPI_GetRxFifoSize(LPSPI_Type *base)
554{
555 return (1U << ((base->PARAM & LPSPI_PARAM_RXFIFO_MASK) >> LPSPI_PARAM_RXFIFO_SHIFT));
556}
557
563static inline uint32_t LPSPI_GetTxFifoCount(LPSPI_Type *base)
564{
565 return ((base->FSR & LPSPI_FSR_TXCOUNT_MASK) >> LPSPI_FSR_TXCOUNT_SHIFT);
566}
567
573static inline uint32_t LPSPI_GetRxFifoCount(LPSPI_Type *base)
574{
575 return ((base->FSR & LPSPI_FSR_RXCOUNT_MASK) >> LPSPI_FSR_RXCOUNT_SHIFT);
576}
577
591static inline void LPSPI_ClearStatusFlags(LPSPI_Type *base, uint32_t statusFlags)
592{
593 base->SR = statusFlags;
594}
595
618static inline void LPSPI_EnableInterrupts(LPSPI_Type *base, uint32_t mask)
619{
620 base->IER |= mask;
621}
622
633static inline void LPSPI_DisableInterrupts(LPSPI_Type *base, uint32_t mask)
634{
635 base->IER &= ~mask;
636}
637
658static inline void LPSPI_EnableDMA(LPSPI_Type *base, uint32_t mask)
659{
660 base->DER |= mask;
661}
662
674static inline void LPSPI_DisableDMA(LPSPI_Type *base, uint32_t mask)
675{
676 base->DER &= ~mask;
677}
678
689static inline uint32_t LPSPI_GetTxRegisterAddress(LPSPI_Type *base)
690{
691 return (uint32_t) & (base->TDR);
692}
693
704static inline uint32_t LPSPI_GetRxRegisterAddress(LPSPI_Type *base)
705{
706 return (uint32_t) & (base->RDR);
707}
708
726bool LPSPI_CheckTransferArgument(LPSPI_Type *base, lpspi_transfer_t *transfer, bool isEdma);
727
736static inline void LPSPI_SetMasterSlaveMode(LPSPI_Type *base, lpspi_master_slave_mode_t mode)
737{
738 base->CFGR1 = (base->CFGR1 & (~LPSPI_CFGR1_MASTER_MASK)) | LPSPI_CFGR1_MASTER(mode);
739}
740
747static inline void LPSPI_SelectTransferPCS(LPSPI_Type *base, lpspi_which_pcs_t select)
748{
749 base->TCR = (base->TCR & (~LPSPI_TCR_PCS_MASK)) | LPSPI_TCR_PCS((uint8_t)select);
750}
751
763static inline void LPSPI_SetPCSContinous(LPSPI_Type *base, bool IsContinous)
764{
765 if (IsContinous)
766 {
767 base->TCR |= LPSPI_TCR_CONT_MASK;
768 }
769 else
770 {
771 base->TCR &= ~LPSPI_TCR_CONT_MASK;
772 }
773}
774
781static inline bool LPSPI_IsMaster(LPSPI_Type *base)
782{
783 return (bool)((base->CFGR1) & LPSPI_CFGR1_MASTER_MASK);
784}
785
793static inline void LPSPI_FlushFifo(LPSPI_Type *base, bool flushTxFifo, bool flushRxFifo)
794{
795 base->CR |= ((uint32_t)flushTxFifo << LPSPI_CR_RTF_SHIFT) | ((uint32_t)flushRxFifo << LPSPI_CR_RRF_SHIFT);
796}
797
809static inline void LPSPI_SetFifoWatermarks(LPSPI_Type *base, uint32_t txWater, uint32_t rxWater)
810{
811 base->FCR = LPSPI_FCR_TXWATER(txWater) | LPSPI_FCR_RXWATER(rxWater);
812}
813
828static inline void LPSPI_SetAllPcsPolarity(LPSPI_Type *base, uint32_t mask)
829{
830 base->CFGR1 = (base->CFGR1 & ~LPSPI_CFGR1_PCSPOL_MASK) | LPSPI_CFGR1_PCSPOL(~mask);
831}
832
852static inline void LPSPI_SetFrameSize(LPSPI_Type *base, uint32_t frameSize)
853{
854 base->TCR = (base->TCR & ~LPSPI_TCR_FRAMESZ_MASK) | LPSPI_TCR_FRAMESZ(frameSize - 1U);
855}
856
881 uint32_t baudRate_Bps,
882 uint32_t srcClock_Hz,
883 uint32_t *tcrPrescaleValue);
884
907void LPSPI_MasterSetDelayScaler(LPSPI_Type *base, uint32_t scaler, lpspi_delay_type_t whichDelay);
908
938 uint32_t delayTimeInNanoSec,
939 lpspi_delay_type_t whichDelay,
940 uint32_t srcClock_Hz);
941
954static inline void LPSPI_WriteData(LPSPI_Type *base, uint32_t data)
955{
956 base->TDR = data;
957}
958
968static inline uint32_t LPSPI_ReadData(LPSPI_Type *base)
969{
970 return (base->RDR);
971}
972
983void LPSPI_SetDummyData(LPSPI_Type *base, uint8_t dummyData);
984
993/*Transactional APIs*/
994
1007 lpspi_master_handle_t *handle,
1009 void *userData);
1010
1029
1048
1060
1070
1080
1093 lpspi_slave_handle_t *handle,
1095 void *userData);
1096
1115
1127
1137
1147
1152#if defined(__cplusplus)
1153}
1154#endif
1155
1158#endif /*_FSL_LPSPI_H_*/
#define LPSPI_TCR_FRAMESZ(x)
Definition: MIMXRT1052.h:30961
#define LPSPI_FCR_TXWATER(x)
Definition: MIMXRT1052.h:30929
#define LPSPI_TCR_PCS(x)
Definition: MIMXRT1052.h:31029
#define LPSPI_CFGR1_PCSPOL(x)
Definition: MIMXRT1052.h:30829
#define LPSPI_CFGR1_MASTER(x)
Definition: MIMXRT1052.h:30799
#define LPSPI_FCR_RXWATER(x)
Definition: MIMXRT1052.h:30935
int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:225
#define MAKE_STATUS(group, code)
Construct a status code value from a group and code number.
Definition: fsl_common.h:47
@ kStatusGroup_LPSPI
Definition: fsl_common.h:87
struct _lpspi_slave_config lpspi_slave_config_t
LPSPI slave configuration structure.
enum _lpspi_host_request_select lpspi_host_request_select_t
LPSPI Host Request select configuration.
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:1929
void LPSPI_MasterInit(LPSPI_Type *base, const lpspi_master_config_t *masterConfig, uint32_t srcClock_Hz)
Initializes the LPSPI master.
Definition: fsl_lpspi.c:259
_lpspi_transfer_width
LPSPI transfer width configuration.
Definition: fsl_lpspi.h:184
void LPSPI_SlaveInit(LPSPI_Type *base, const lpspi_slave_config_t *slaveConfig)
LPSPI slave configuration.
Definition: fsl_lpspi.c:355
void LPSPI_SetDummyData(LPSPI_Type *base, uint8_t dummyData)
Set up the dummy data.
Definition: fsl_lpspi.c:246
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:681
enum _lpspi_clock_phase lpspi_clock_phase_t
LPSPI clock phase configuration.
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:1726
enum _lpspi_pcs_polarity_config lpspi_pcs_polarity_config_t
LPSPI Peripheral Chip Select (PCS) Polarity configuration.
_lpspi_match_config
LPSPI Match configuration options.
Definition: fsl_lpspi.h:156
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:402
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:337
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:93
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:324
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:427
_lpspi_pcs_polarity
LPSPI Peripheral Chip Select (PCS) Polarity.
Definition: fsl_lpspi.h:116
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:496
status_t LPSPI_MasterTransferBlocking(LPSPI_Type *base, lpspi_transfer_t *transfer)
LPSPI master transfer data using a polling method.
Definition: fsl_lpspi.c:1098
_lpspi_transfer_state
LPSPI transfer state, which is used for LPSPI transactional API state machine.
Definition: fsl_lpspi.h:254
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:1690
_lpspi_pin_config
LPSPI pin (SDO and SDI) configuration.
Definition: fsl_lpspi.h:168
_lpspi_transfer_config_flag_for_master
Use this enumeration for LPSPI master transfer configFlags.
Definition: fsl_lpspi.h:203
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:206
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:1226
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:608
_lpspi_pcs_polarity_config
LPSPI Peripheral Chip Select (PCS) Polarity configuration.
Definition: fsl_lpspi.h:109
_lpspi_host_request_select
LPSPI Host Request select configuration.
Definition: fsl_lpspi.h:149
#define LPSPI_MASTER_PCS_SHIFT
Definition: fsl_lpspi.h:198
struct _lpspi_master_config lpspi_master_config_t
LPSPI master configuration structure.
enum _lpspi_transfer_width lpspi_transfer_width_t
LPSPI transfer width configuration.
void LPSPI_SlaveTransferHandleIRQ(LPSPI_Type *base, lpspi_slave_handle_t *handle)
LPSPI Slave IRQ handler function.
Definition: fsl_lpspi.c:1991
void LPSPI_MasterTransferHandleIRQ(LPSPI_Type *base, lpspi_master_handle_t *handle)
LPSPI Master IRQ handler function.
Definition: fsl_lpspi.c:1558
#define LPSPI_SLAVE_PCS_SHIFT
Definition: fsl_lpspi.h:226
enum _lpspi_match_config lpspi_match_config_t
LPSPI Match configuration options.
uint32_t LPSPI_GetInstance(LPSPI_Type *base)
Get the LPSPI instance from peripheral base address.
Definition: fsl_lpspi.c:218
_lpspi_interrupt_enable
LPSPI interrupt source.
Definition: fsl_lpspi.h:70
_lpspi_shift_direction
LPSPI data shifter direction options.
Definition: fsl_lpspi.h:142
_lpspi_data_out_config
LPSPI data output configuration.
Definition: fsl_lpspi.h:177
_lpspi_which_pcs_config
LPSPI Peripheral Chip Select (PCS) configuration (which PCS to configure).
Definition: fsl_lpspi.h:100
enum _lpspi_delay_type lpspi_delay_type_t
LPSPI delay type selection.
_lpspi_delay_type
LPSPI delay type selection.
Definition: fsl_lpspi.h:192
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:1969
_lpspi_flags
LPSPI status flags in SPIx_SR register.
Definition: fsl_lpspi.h:53
_lpspi_clock_polarity
LPSPI clock polarity configuration.
Definition: fsl_lpspi.h:126
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:804
_lpspi_clock_phase
LPSPI clock phase configuration.
Definition: fsl_lpspi.h:133
void LPSPI_Deinit(LPSPI_Type *base)
De-initializes the LPSPI peripheral. Call this API to disable the LPSPI clock.
Definition: fsl_lpspi.c:443
enum _lpspi_shift_direction lpspi_shift_direction_t
LPSPI data shifter direction options.
bool LPSPI_CheckTransferArgument(LPSPI_Type *base, lpspi_transfer_t *transfer, bool isEdma)
Check the argument for transfer .
Definition: fsl_lpspi.c:831
_lpspi_transfer_config_flag_for_slave
Use this enumeration for LPSPI slave transfer configFlags.
Definition: fsl_lpspi.h:231
void LPSPI_MasterTransferAbort(LPSPI_Type *base, lpspi_master_handle_t *handle)
LPSPI master abort transfer which uses an interrupt method.
Definition: fsl_lpspi.c:1536
void LPSPI_MasterGetDefaultConfig(lpspi_master_config_t *masterConfig)
Sets the lpspi_master_config_t structure to default values.
Definition: fsl_lpspi.c:323
_lpspi_dma_enable
LPSPI DMA source.
Definition: fsl_lpspi.h:86
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:1496
@ kLPSPI_SingleBitXfer
Definition: fsl_lpspi.h:185
@ kLPSPI_FourBitXfer
Definition: fsl_lpspi.h:187
@ kLPSPI_TwoBitXfer
Definition: fsl_lpspi.h:186
@ kLPSI_AnyWordAndM1EqualsM0andM1
Definition: fsl_lpspi.h:163
@ kLPSI_MatchDisabled
Definition: fsl_lpspi.h:157
@ kLPSI_1stWordEqualsM0and2ndWordEqualsM1
Definition: fsl_lpspi.h:160
@ kLPSI_1stWordEqualsM0orM1
Definition: fsl_lpspi.h:158
@ kLPSI_1stWordAndM1EqualsM0andM1
Definition: fsl_lpspi.h:162
@ kLPSI_AnyWordEqualsM0andNxtWordEqualsM1
Definition: fsl_lpspi.h:161
@ kLPSI_AnyWordEqualsM0orM1
Definition: fsl_lpspi.h:159
@ kLPSPI_Master
Definition: fsl_lpspi.h:94
@ kLPSPI_Slave
Definition: fsl_lpspi.h:95
@ kLPSPI_Pcs0ActiveLow
Definition: fsl_lpspi.h:117
@ kLPSPI_Pcs2ActiveLow
Definition: fsl_lpspi.h:119
@ kLPSPI_PcsAllActiveLow
Definition: fsl_lpspi.h:121
@ kLPSPI_Pcs3ActiveLow
Definition: fsl_lpspi.h:120
@ kLPSPI_Pcs1ActiveLow
Definition: fsl_lpspi.h:118
@ kLPSPI_Busy
Definition: fsl_lpspi.h:256
@ kLPSPI_Error
Definition: fsl_lpspi.h:257
@ kLPSPI_Idle
Definition: fsl_lpspi.h:255
@ kLPSPI_SdiInSdiOut
Definition: fsl_lpspi.h:170
@ kLPSPI_SdiInSdoOut
Definition: fsl_lpspi.h:169
@ kLPSPI_SdoInSdoOut
Definition: fsl_lpspi.h:171
@ kLPSPI_SdoInSdiOut
Definition: fsl_lpspi.h:172
@ kLPSPI_MasterPcs1
Definition: fsl_lpspi.h:205
@ kLPSPI_MasterPcs3
Definition: fsl_lpspi.h:207
@ kLPSPI_MasterPcsContinuous
Definition: fsl_lpspi.h:209
@ kLPSPI_MasterByteSwap
Definition: fsl_lpspi.h:211
@ kLPSPI_MasterPcs2
Definition: fsl_lpspi.h:206
@ kLPSPI_MasterPcs0
Definition: fsl_lpspi.h:204
@ kLPSPI_PcsActiveLow
Definition: fsl_lpspi.h:111
@ kLPSPI_PcsActiveHigh
Definition: fsl_lpspi.h:110
@ kLPSPI_HostReqExtPin
Definition: fsl_lpspi.h:150
@ kLPSPI_HostReqInternalTrigger
Definition: fsl_lpspi.h:151
@ kLPSPI_ReceiveErrorInterruptEnable
Definition: fsl_lpspi.h:77
@ kLPSPI_FrameCompleteInterruptEnable
Definition: fsl_lpspi.h:74
@ kLPSPI_TransmitErrorInterruptEnable
Definition: fsl_lpspi.h:76
@ kLPSPI_AllInterruptEnable
Definition: fsl_lpspi.h:79
@ kLPSPI_RxInterruptEnable
Definition: fsl_lpspi.h:72
@ kLPSPI_TxInterruptEnable
Definition: fsl_lpspi.h:71
@ kLPSPI_DataMatchInterruptEnable
Definition: fsl_lpspi.h:78
@ kLPSPI_WordCompleteInterruptEnable
Definition: fsl_lpspi.h:73
@ kLPSPI_TransferCompleteInterruptEnable
Definition: fsl_lpspi.h:75
@ kLPSPI_MsbFirst
Definition: fsl_lpspi.h:143
@ kLPSPI_LsbFirst
Definition: fsl_lpspi.h:144
@ kLpspiDataOutRetained
Definition: fsl_lpspi.h:178
@ kLpspiDataOutTristate
Definition: fsl_lpspi.h:179
@ kLPSPI_Pcs1
Definition: fsl_lpspi.h:102
@ kLPSPI_Pcs2
Definition: fsl_lpspi.h:103
@ kLPSPI_Pcs3
Definition: fsl_lpspi.h:104
@ kLPSPI_Pcs0
Definition: fsl_lpspi.h:101
@ kLPSPI_PcsToSck
Definition: fsl_lpspi.h:193
@ kLPSPI_LastSckToPcs
Definition: fsl_lpspi.h:194
@ kLPSPI_BetweenTransfer
Definition: fsl_lpspi.h:195
@ kStatus_LPSPI_Timeout
Definition: fsl_lpspi.h:48
@ kStatus_LPSPI_OutOfRange
Definition: fsl_lpspi.h:47
@ kStatus_LPSPI_Error
Definition: fsl_lpspi.h:45
@ kStatus_LPSPI_Idle
Definition: fsl_lpspi.h:46
@ kStatus_LPSPI_Busy
Definition: fsl_lpspi.h:44
@ kLPSPI_TransmitErrorFlag
Definition: fsl_lpspi.h:59
@ kLPSPI_TxDataRequestFlag
Definition: fsl_lpspi.h:54
@ kLPSPI_TransferCompleteFlag
Definition: fsl_lpspi.h:58
@ kLPSPI_DataMatchFlag
Definition: fsl_lpspi.h:61
@ kLPSPI_RxDataReadyFlag
Definition: fsl_lpspi.h:55
@ kLPSPI_ModuleBusyFlag
Definition: fsl_lpspi.h:62
@ kLPSPI_ReceiveErrorFlag
Definition: fsl_lpspi.h:60
@ kLPSPI_FrameCompleteFlag
Definition: fsl_lpspi.h:57
@ kLPSPI_WordCompleteFlag
Definition: fsl_lpspi.h:56
@ kLPSPI_AllStatusFlag
Definition: fsl_lpspi.h:63
@ kLPSPI_ClockPolarityActiveHigh
Definition: fsl_lpspi.h:127
@ kLPSPI_ClockPolarityActiveLow
Definition: fsl_lpspi.h:128
@ kLPSPI_ClockPhaseFirstEdge
Definition: fsl_lpspi.h:134
@ kLPSPI_ClockPhaseSecondEdge
Definition: fsl_lpspi.h:136
@ kLPSPI_SlavePcs1
Definition: fsl_lpspi.h:233
@ kLPSPI_SlaveByteSwap
Definition: fsl_lpspi.h:237
@ kLPSPI_SlavePcs3
Definition: fsl_lpspi.h:235
@ kLPSPI_SlavePcs0
Definition: fsl_lpspi.h:232
@ kLPSPI_SlavePcs2
Definition: fsl_lpspi.h:234
@ kLPSPI_TxDmaEnable
Definition: fsl_lpspi.h:87
@ kLPSPI_RxDmaEnable
Definition: fsl_lpspi.h:88
Definition: MIMXRT1052.h:30457
LPSPI master configuration structure.
Definition: fsl_lpspi.h:262
lpspi_pcs_polarity_config_t pcsActiveHighOrLow
Definition: fsl_lpspi.h:277
lpspi_shift_direction_t direction
Definition: fsl_lpspi.h:267
lpspi_data_out_config_t dataOutConfig
Definition: fsl_lpspi.h:282
bool enableInputDelay
Definition: fsl_lpspi.h:284
uint32_t baudRate
Definition: fsl_lpspi.h:263
lpspi_clock_phase_t cpha
Definition: fsl_lpspi.h:266
uint32_t betweenTransferDelayInNanoSec
Definition: fsl_lpspi.h:273
uint32_t bitsPerFrame
Definition: fsl_lpspi.h:264
uint32_t lastSckToPcsDelayInNanoSec
Definition: fsl_lpspi.h:271
lpspi_which_pcs_t whichPcs
Definition: fsl_lpspi.h:276
uint32_t pcsToSckDelayInNanoSec
Definition: fsl_lpspi.h:269
lpspi_clock_polarity_t cpol
Definition: fsl_lpspi.h:265
lpspi_pin_config_t pinCfg
Definition: fsl_lpspi.h:279
LPSPI master transfer handle structure used for transactional API.
Definition: fsl_lpspi.h:356
uint8_t *volatile txData
Definition: fsl_lpspi.h:371
volatile uint8_t fifoSize
Definition: fsl_lpspi.h:364
uint8_t *volatile rxData
Definition: fsl_lpspi.h:372
volatile uint8_t state
Definition: fsl_lpspi.h:383
volatile uint32_t writeRegRemainingTimes
Definition: fsl_lpspi.h:376
volatile uint8_t bytesEachRead
Definition: fsl_lpspi.h:369
volatile uint8_t rxWatermark
Definition: fsl_lpspi.h:366
lpspi_master_transfer_callback_t callback
Definition: fsl_lpspi.h:385
volatile uint32_t readRegRemainingTimes
Definition: fsl_lpspi.h:377
volatile size_t txRemainingByteCount
Definition: fsl_lpspi.h:373
volatile bool isTxMask
Definition: fsl_lpspi.h:361
volatile uint16_t bytesPerFrame
Definition: fsl_lpspi.h:362
void * userData
Definition: fsl_lpspi.h:386
uint32_t txBuffIfNull
Definition: fsl_lpspi.h:381
volatile bool writeTcrInIsr
Definition: fsl_lpspi.h:358
volatile uint8_t bytesEachWrite
Definition: fsl_lpspi.h:368
volatile bool isByteSwap
Definition: fsl_lpspi.h:360
uint32_t totalByteCount
Definition: fsl_lpspi.h:379
volatile size_t rxRemainingByteCount
Definition: fsl_lpspi.h:374
volatile bool isPcsContinuous
Definition: fsl_lpspi.h:357
LPSPI slave configuration structure.
Definition: fsl_lpspi.h:290
lpspi_clock_phase_t cpha
Definition: fsl_lpspi.h:293
lpspi_shift_direction_t direction
Definition: fsl_lpspi.h:294
lpspi_pcs_polarity_config_t pcsActiveHighOrLow
Definition: fsl_lpspi.h:297
lpspi_data_out_config_t dataOutConfig
Definition: fsl_lpspi.h:302
uint32_t bitsPerFrame
Definition: fsl_lpspi.h:291
lpspi_clock_polarity_t cpol
Definition: fsl_lpspi.h:292
lpspi_which_pcs_t whichPcs
Definition: fsl_lpspi.h:296
lpspi_pin_config_t pinCfg
Definition: fsl_lpspi.h:299
LPSPI slave transfer handle structure used for transactional API.
Definition: fsl_lpspi.h:391
volatile uint8_t state
Definition: fsl_lpspi.h:412
volatile size_t txRemainingByteCount
Definition: fsl_lpspi.h:404
volatile uint8_t rxWatermark
Definition: fsl_lpspi.h:396
uint8_t *volatile rxData
Definition: fsl_lpspi.h:402
void * userData
Definition: fsl_lpspi.h:417
volatile size_t rxRemainingByteCount
Definition: fsl_lpspi.h:405
volatile uint8_t fifoSize
Definition: fsl_lpspi.h:394
volatile uint8_t bytesEachRead
Definition: fsl_lpspi.h:399
volatile uint32_t errorCount
Definition: fsl_lpspi.h:414
volatile uint32_t readRegRemainingTimes
Definition: fsl_lpspi.h:408
volatile uint8_t bytesEachWrite
Definition: fsl_lpspi.h:398
uint8_t *volatile txData
Definition: fsl_lpspi.h:401
uint32_t totalByteCount
Definition: fsl_lpspi.h:410
volatile bool isByteSwap
Definition: fsl_lpspi.h:392
volatile uint32_t writeRegRemainingTimes
Definition: fsl_lpspi.h:407
lpspi_slave_transfer_callback_t callback
Definition: fsl_lpspi.h:416
LPSPI master/slave transfer structure.
Definition: fsl_lpspi.h:344
uint8_t * rxData
Definition: fsl_lpspi.h:346
uint32_t configFlags
Definition: fsl_lpspi.h:349
volatile size_t dataSize
Definition: fsl_lpspi.h:347
uint8_t * txData
Definition: fsl_lpspi.h:345