This document consists of sections titled with Driver Overview, Data Structures, Enumerations, Functions, etc., each with an overview list and detailed documentation. It is recommended to read the Driver Overview first for it includes a comprehensive description of the peripheral, driver and driver changes. Other sections give detailed information for APIs, enums, macros, etc., for your further reference.
|
#define | QSPI_DUMMY_DATA (0x00U) |
| User Configuraiton item dummy data filled into Output signal if there is no Tx data. More...
|
|
|
enum | {
kStatus_QSPI_Busy = MAKE_STATUS(kStatusGroup_QUEUEDSPI, 0),
kStatus_QSPI_Error = MAKE_STATUS(kStatusGroup_QUEUEDSPI, 1),
kStatus_QSPI_Idle = MAKE_STATUS(kStatusGroup_QUEUEDSPI, 2),
kStatus_QSPI_OutOfRange = MAKE_STATUS(kStatusGroup_QUEUEDSPI, 3)
} |
| Status return code for the QUEUEDSPI driver. More...
|
|
enum | _qspi_status_flags {
kQSPI_TxEmptyFlag = QSPI_SPSCR_SPTE_MASK,
kQSPI_ModeFaultFlag = QSPI_SPSCR_MODF_MASK,
kQSPI_RxOverflowFlag = QSPI_SPSCR_OVRF_MASK,
kQSPI_RxFullFlag = QSPI_SPSCR_SPRF_MASK
} |
| QUEUEDSPI peripheral status flags. More...
|
|
enum | _qspi_interrupt_enable {
kQSPI_TxInterruptEnable = (QSPI_SPSCR_SPTIE_MASK >> 4U),
kQSPI_RxInterruptEnable = (QSPI_SPSCR_SPRIE_MASK >> 4U),
kQSPI_RxOverFlowInterruptEnable = (QSPI_SPSCR_ERRIE_MASK >> 4U)
} |
| QUEUEDSPI interrupt source. More...
|
|
enum | qspi_ss_direction_t {
kQSPI_SlaveSelectDirectionInput,
kQSPI_SlaveSelectDIrectionOutput = 1U
} |
| options for Slave Select (SSB) signal direction. More...
|
|
enum | qspi_ss_data_logic_level_t {
kQSPI_SlaveSelectLogicLow = 0U,
kQSPI_SlaveSelectLogicHigh = 1U
} |
| logical level for Slave Select (SSB) signal data More...
|
|
enum | qspi_txfifo_watermark_t {
kQSPI_TxFifoWatermarkEmpty = 0U,
kQSPI_TxFifoWatermarkOneWord = 1U,
kQSPI_TxFifoWatermarkTwoWord = 2U,
kQSPI_TxFifoWatermarkThreeWord
} |
| QUEUEDSPI Transmit FIFO watermark settings. More...
|
|
enum | qspi_rxfifo_watermark_t {
kQSPI_RxFifoWatermarkOneWord = 0U,
kQSPI_RxFifoWatermarkTwoWord = 1U,
kQSPI_RxFifoWatermarkThreeWord = 2U,
kQSPI_RxFifowatermarkFull = 3U
} |
| QUEUEDSPI Receive FIFO watermark settings. More...
|
|
enum | qspi_data_width_t {
kQSPI_Data2Bits = 1U,
kQSPI_Data3Bits = 2U,
kQSPI_Data4Bits = 3U,
kQSPI_Data5Bits = 4U,
kQSPI_Data6Bits = 5U,
kQSPI_Data7Bits = 6U,
kQSPI_Data8Bits = 7U,
kQSPI_Data9Bits = 8U,
kQSPI_Data10Bits = 9U,
kQSPI_Data11Bits = 10U,
kQSPI_Data12Bits = 11U,
kQSPI_Data13Bits = 12U,
kQSPI_Data14Bits = 13U,
kQSPI_Data15Bits = 14U,
kQSPI_Data16Bits = 15U
} |
| Transfer data width in each frame. More...
|
|
enum | _qspi_dma_enable_flags {
kQSPI_DmaRx = 1U,
kQSPI_DmaTx = 2U
} |
| QUEUEDSPI DMA configuration for Transmit and Receive. More...
|
|
enum | qspi_master_slave_mode_t {
kQSPI_Slave = 0U,
kQSPI_Master = 1U
} |
| QUEUEDSPI master or slave mode configuration. More...
|
|
enum | qspi_clock_polarity_t {
kQSPI_ClockPolarityActiveRisingEdge,
kQSPI_ClockPolarityActiveFallingEdge
} |
| QUEUEDSPI clock polarity configuration. More...
|
|
enum | qspi_clock_phase_t {
kQSPI_ClockPhaseSlaveSelectHighBetweenWords = 0U,
kQSPI_ClockPhaseSlaveSelectLowBetweenWords = 1U
} |
| QUEUEDSPI clock phase configuration. More...
|
|
enum | qspi_data_shift_direction_t {
kQSPI_MsbFirst = 0U,
kQSPI_LsbFirst = 1U
} |
| QUEUEDSPI data shifter direction options for a given CTAR. More...
|
|
enum | qspi_pcs_polarity_config_t {
kQSPI_PcsActiveHigh = 0U,
kQSPI_PcsActiveLow = 1U
} |
| QUEUEDSPI Peripheral Chip Select Polarity configuration. More...
|
|
enum | _qspi_master_transfer_flag {
kQSPI_MasterPCSContinous,
kQSPI_MasterActiveAfterTransfer
} |
| transaction layer configuration options for each transaction More...
|
|
enum | _qspi_transfer_state {
kQSPI_Idle = 0x0U,
kQSPI_Busy,
kQSPI_Error
} |
| QUEUEDSPI transfer state, used internally for transactional layer. More...
|
|
|
static void | QSPI_Enable (QSPI_Type *base, bool bEnable) |
| Enable or disable the QUEUEDSPI peripheral. More...
|
|
uint32_t | QSPI_MasterSetBaudRate (QSPI_Type *base, uint32_t u32BaudRateBps, uint32_t u32SrcClockHz) |
| Set the QUEUEDSPI baud rate in bits-per-second. More...
|
|
static void | QSPI_SetMasterSlaveMode (QSPI_Type *base, qspi_master_slave_mode_t eMode) |
| Set the QUEUEDSPI as master or slave. More...
|
|
static bool | QSPI_IsMaster (QSPI_Type *base) |
| Return whether the QUEUEDSPI module is in master mode. More...
|
|
static void | QSPI_SetDataShiftOrder (QSPI_Type *base, qspi_data_shift_direction_t eDataShiftOrder) |
| Set Data Shift Order as MSB first or LSB first. More...
|
|
static void | QSPI_EnableModeFault (QSPI_Type *base, bool bEnable) |
| Enable/Disable mode fault detection. More...
|
|
static void | QSPI_SetClockPolarity (QSPI_Type *base, qspi_clock_polarity_t ePolarity) |
| Set clock polarity. More...
|
|
static void | QSPI_SetClockPhase (QSPI_Type *base, qspi_clock_phase_t eClockPhase) |
| Set clock phase. More...
|
|
static void | QSPI_EnableWiredORMode (QSPI_Type *base, bool bEnable) |
| Enable/Disable Wired OR mode for SPI pins which means open-drain when enabled and push-pull when disabled. More...
|
|
static void | QSPI_SetTransactionDataSize (QSPI_Type *base, qspi_data_width_t eDataWidth) |
| Set the transaction data width. More...
|
|
static void | QSPI_MasterSetWaitDelay (QSPI_Type *base, uint16_t u16WaitDelayInPeriClockCount) |
| For master mode, set wait delay in clock cycle with delay is set value + 1 peripheral bus clock. More...
|
|
static void | QSPI_EnableStopModeHoldOff (QSPI_Type *base, bool bEnable) |
| Enable/Disable hold off entry to stop mode is a word is being transmitted/received for Master Mode. More...
|
|
uint32_t | QSPI_GetInstance (QSPI_Type *base) |
| Helper function exported for QSPI DMA driver. More...
|
|
|
static qspi_ss_data_logic_level_t | QSPI_MasterGetSlaveSelectLogicLevel (QSPI_Type *base) |
| For master mode, get the SS_B input logic level while true means drive High and false means drive Low. More...
|
|
static void | QSPI_MasterSetSlaveSelectLogicLevel (QSPI_Type *base, qspi_ss_data_logic_level_t eLogicLevel) |
| for master mode, drive Slave Select pin logic high or low More...
|
|
static void | QSPI_MasterEnableSlaveSelectOpenDrainMode (QSPI_Type *base, bool bEnable) |
| For master mode, Enable open drain in SSB pad pin. More...
|
|
static void | QSPI_MasterEnableSlaveSelectAutomaticMode (QSPI_Type *base, bool bEnable) |
| For master mode, Enable/Disable Slave Select pin automatic mode. More...
|
|
static void | QSPI_SetSlaveSelectDirection (QSPI_Type *base, qspi_ss_direction_t eDirection) |
| Set Input/Output mode for SSB signal. More...
|
|
static void | QSPI_MasterEnableSlaveSelectStrobe (QSPI_Type *base, bool bEnable) |
| For master, set strobe mode for SSB signal. More...
|
|
static void | QSPI_EnableSlaveSelectOverride (QSPI_Type *base, bool bEnable) |
| Enable / Disable SSB signal from Master/Slave configuration or GPIO pin state. More...
|
|
|
void | QSPI_SetDummyData (QSPI_Type *base, uint8_t u8DummyData) |
| Set up the dummy data used when there is not transmit data provided. More...
|
|
uint8_t | QSPI_GetDummyData (QSPI_Type *base) |
| Get the dummy data for each peripheral. More...
|
|
static void | QSPI_WriteData (QSPI_Type *base, uint16_t data) |
| Write data into the transmit data register without polling the status of shifting. More...
|
|
static uint16_t | QSPI_ReadData (QSPI_Type *base) |
| Read data from the receive data register. More...
|
|
struct qspi_master_config_t |
uint32_t qspi_master_config_t::u32BaudRateBps |
bool qspi_master_config_t::bEnableWiredOrMode |
bool qspi_master_config_t::bEnableSlaveSelAutoMode |
uint16_t qspi_master_config_t::u16DelayBetweenFrameInCLK |
struct qspi_slave_config_t |
bool qspi_slave_config_t::bEnableWiredOrMode |
void* qspi_transfer_t::pTxData |
void* qspi_transfer_t::pRxData |
volatile uint16_t qspi_transfer_t::u16DataSize |
uint8_t qspi_transfer_t::u8ConfigFlags |
This is not used in slave transfer.
struct _qspi_master_handle |
Forward declaration of the _qspi_master_handle typedefs.
volatile bool qspi_master_transfer_handle_t::bIsPcsActiveAfterTransfer |
uint8_t* volatile qspi_master_transfer_handle_t::pu8TxData |
uint8_t* volatile qspi_master_transfer_handle_t::pu8RxData |
volatile uint16_t qspi_master_transfer_handle_t::u16RemainingSendByteCount |
volatile uint16_t qspi_master_transfer_handle_t::u16RemainingReceiveByteCount |
volatile uint8_t qspi_master_transfer_handle_t::u8State |
void* qspi_master_transfer_handle_t::pUserData |
volatile uint16_t qspi_master_transfer_handle_t::u16ErrorCount |
#define QSPI_DUMMY_DATA (0x00U) |
Dummy data used for Tx if there is no txData.
#define QSPI_TRANSFER_GET_BASE |
( |
|
handle | ) |
(handle->base) |
#define QSPI_TRANSFER_GET_USER_DATA |
( |
|
handle | ) |
(handle->pUserData) |
typedef void(* qspi_master_transfer_callback_t)(qspi_master_transfer_handle_t *psHandle, status_t eCompletionStatus, void *pUserData) |
- Parameters
-
base | QUEUEDSPI peripheral address. |
psHandle | Pointer to the handle for the QUEUEDSPI master. |
eCompletionStatus | Success or error code describing whether the transfer completed. |
pUserData | Arbitrary pointer-dataSized value passed from the application. |
typedef void(* qspi_slave_transfer_callback_t)(qspi_slave_transfer_handle_t *psHandle, status_t eCompletionStatus, void *pUserData) |
- Parameters
-
base | QUEUEDSPI peripheral address. |
handle | Pointer to the handle for the QUEUEDSPI slave. |
status | Success or error code describing whether the transfer completed. |
pUserData | Arbitrary pointer-dataSized value passed from the application. |
Only used in transactional layer in this driver.
Enumerator |
---|
kStatus_QSPI_Busy |
QUEUEDSPI transfer is busy.
|
kStatus_QSPI_Error |
QUEUEDSPI driver error.
|
kStatus_QSPI_Idle |
QUEUEDSPI is idle.
|
kStatus_QSPI_OutOfRange |
QUEUEDSPI transfer out of range.
|
Enumerator |
---|
kQSPI_TxEmptyFlag |
Transmitter Empty Flag.
|
kQSPI_ModeFaultFlag |
Mode Fault Flag.
|
kQSPI_RxOverflowFlag |
Receiver Overflow Flag.
|
kQSPI_RxFullFlag |
Receiver Full Flag.
|
Enumerator |
---|
kQSPI_TxInterruptEnable |
SPTE interrupt enable.
|
kQSPI_RxInterruptEnable |
SPRF interrupt enable.
|
kQSPI_RxOverFlowInterruptEnable |
Bus error interrupt enable.
|
Enumerator |
---|
kQSPI_SlaveSelectDirectionInput |
SSB signal as input for slave mode or master mode with Mode fault enabled.
|
kQSPI_SlaveSelectDIrectionOutput |
SSB signal as output.
|
Enumerator |
---|
kQSPI_SlaveSelectLogicLow |
Slave select logic level low.
|
kQSPI_SlaveSelectLogicHigh |
Slave select logic level high.
|
Enumerator |
---|
kQSPI_TxFifoWatermarkEmpty |
Transmit interrupt active when Tx FIFO is empty.
|
kQSPI_TxFifoWatermarkOneWord |
Transmit interrupt active when Tx FIFO has one or fewer words available.
|
kQSPI_TxFifoWatermarkTwoWord |
Transmit interrupt active when Tx FIFO has two or fewer words available.
|
kQSPI_TxFifoWatermarkThreeWord |
Transmit interrupt active when Tx FIFO has three or fewer words available.
|
Enumerator |
---|
kQSPI_RxFifoWatermarkOneWord |
Receive interrupt active when Rx FIFO has at least one word used.
|
kQSPI_RxFifoWatermarkTwoWord |
Receive interrupt active when Rx FIFO has at least two words used.
|
kQSPI_RxFifoWatermarkThreeWord |
Receive interrupt active when Rx FIFO has at least three words used.
|
kQSPI_RxFifowatermarkFull |
Receive interrupt active when Rx FIFO is full.
|
Enumerator |
---|
kQSPI_Data2Bits |
2 bits data width
|
kQSPI_Data3Bits |
3 bits data width
|
kQSPI_Data4Bits |
4 bits data width
|
kQSPI_Data5Bits |
5 bits data width
|
kQSPI_Data6Bits |
6 bits data width
|
kQSPI_Data7Bits |
7 bits data width
|
kQSPI_Data8Bits |
8 bits data width
|
kQSPI_Data9Bits |
9 bits data width
|
kQSPI_Data10Bits |
10 bits data width
|
kQSPI_Data11Bits |
11 bits data width
|
kQSPI_Data12Bits |
12 bits data width
|
kQSPI_Data13Bits |
13 bits data width
|
kQSPI_Data14Bits |
14 bits data width
|
kQSPI_Data15Bits |
15 bits data width
|
kQSPI_Data16Bits |
16 bits data width
|
Enumerator |
---|
kQSPI_DmaRx |
Receive DMA Enable Flag.
|
kQSPI_DmaTx |
Transmit DMA Enable Flag.
|
Enumerator |
---|
kQSPI_Slave |
QUEUEDSPI peripheral operates in slave mode.
|
kQSPI_Master |
QUEUEDSPI peripheral operates in master mode.
|
Enumerator |
---|
kQSPI_ClockPolarityActiveRisingEdge |
CPOL=0.
Active-high QUEUEDSPI clock (idles low), rising edge of SCLK starts transaction.
|
kQSPI_ClockPolarityActiveFallingEdge |
CPOL=1.
Active-low QUEUEDSPI clock (idles high), falling edge of SCLK starts transaction.
|
Enumerator |
---|
kQSPI_ClockPhaseSlaveSelectHighBetweenWords |
CPHA=0, Slave Select toggle high during data frames.
|
kQSPI_ClockPhaseSlaveSelectLowBetweenWords |
CPHA=1, Slave Select keep low during data frames.
|
Enumerator |
---|
kQSPI_MsbFirst |
Data transfers start with most significant bit.
|
kQSPI_LsbFirst |
Data transfers start with least significant bit.
|
Enumerator |
---|
kQSPI_PcsActiveHigh |
Pcs Active High (idles low).
|
kQSPI_PcsActiveLow |
Pcs Active Low (idles high).
|
Enumerator |
---|
kQSPI_MasterPCSContinous |
Indicates whether the PCS signal de-asserts during transfer between frames, note this flag should not be used when CPHA is 0.
|
kQSPI_MasterActiveAfterTransfer |
Indicates whether the PCS signal is active after the last frame transfer, note 1.
this flag should not be used when CPHA is 0, 2. this flag can only be used when kQSPI_MasterPCSContinous is used.
|
Enumerator |
---|
kQSPI_Idle |
Nothing in the transmitter/receiver.
|
kQSPI_Busy |
Transfer queue is not finished.
|
kQSPI_Error |
Transfer error.
|
Use helpher function QSPI_MasterGetDefaultConfig to get ready-to-use structure.
- Parameters
-
The purpose of this API is to get the configuration structure initialized for the QSPI_MasterInit. Users may use the initialized structure unchanged in the QSPI_MasterInit or modify the structure before calling the QSPI_MasterInit. Example:
The default values are: Example:
psConfig->u32BaudRateBps = u32BaudRateBps;
psConfig->u32ClockFrequencyHz = u32ClockFreqHz;
psConfig->eDataWidth = eDataWidth;
psConfig->u16DelayBetweenFrameInCLK = 1U;
psConfig->bEnableWiredOrMode = false;
psConfig->bEnableModeFault = false;
psConfig->u8DmaEnableFlags = 0U;
psConfig->bEnableFIFO = false;
psConfig->bEnableStopModeHoldOff = false;
psConfig->u8Interrupts = 0U;
psConfig->bEnableModule = false;
* @todo To be added
*
- Parameters
-
Use helpher function QSPI_SlaveGetDefaultConfig to get ready-to-use structure.
- Parameters
-
The purpose of this API is to get the configuration structure initialized for the QSPI_SlaveInit. Users may use the initialized structure unchanged in the QSPI_SlaveInit or modify the structure before calling the QSPI_SlaveInit. Example:
The default values are: Example:
- Parameters
-
void QSPI_Deinit |
( |
QSPI_Type * |
base | ) |
|
- Parameters
-
base | QUEUEDSPI peripheral address. |
static void QSPI_EnableInterrupts |
( |
QSPI_Type * |
base, |
|
|
uint8_t |
u8Interrupts |
|
) |
| |
|
inlinestatic |
This function enable one or multiple interrupts.
- Note
- for TX and RX requests, while enabling the interrupt request the DMA request will be disabled as well. Do not use this API while QUEUEDSPI is in running state.
- Parameters
-
static void QSPI_DisableInterrupts |
( |
QSPI_Type * |
base, |
|
|
uint8_t |
u8Interrupts |
|
) |
| |
|
inlinestatic |
static void QSPI_EnableDMA |
( |
QSPI_Type * |
base, |
|
|
uint8_t |
u8DmaFlags |
|
) |
| |
|
inlinestatic |
Note that if the DMA is enabled for Transmit or Receive, make sure the interurpt is disabled for Transmit or Receive.
- Parameters
-
static void QSPI_DisableDMA |
( |
QSPI_Type * |
base, |
|
|
uint8_t |
u8DmaFlags |
|
) |
| |
|
inlinestatic |
Note that if the DMA is enabled for Transmit or Receive, make sure the interurpt is disabled for Transmit or Receive.
- Parameters
-
static uint32_t QSPI_GetTxRegisterAddress |
( |
QSPI_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | QUEUEDSPI peripheral address. |
- Returns
- The QUEUEDSPI master PUSHR data register address.
static uint32_t QSPI_GetRxRegisterAddress |
( |
QSPI_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | QUEUEDSPI peripheral address. |
- Returns
- The QUEUEDSPI POPR data register address.
static uint16_t QSPI_GetStatusFlags |
( |
QSPI_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | QUEUEDSPI peripheral address. |
- Returns
- QUEUEDSPI status.
static void QSPI_ClearStatusFlags |
( |
QSPI_Type * |
base, |
|
|
uint16_t |
u16StatusFlags |
|
) |
| |
|
inlinestatic |
Clear the status flag only for mode fault.
- Note
- only kQSPI_ModeFaultFlag can be cleared by this API.
- Parameters
-
static void QSPI_Enable |
( |
QSPI_Type * |
base, |
|
|
bool |
bEnable |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | QUEUEDSPI peripheral address. |
bEnable | true to enable module, otherwise disable module |
uint32_t QSPI_MasterSetBaudRate |
( |
QSPI_Type * |
base, |
|
|
uint32_t |
u32BaudRateBps, |
|
|
uint32_t |
u32SrcClockHz |
|
) |
| |
This function takes in the desired baud rate, calculates the nearest possible baud rate, and returns the calculated baud rate in bits-per-second.
- Parameters
-
base | QUEUEDSPI peripheral address. |
u32BaudRateBps | The desired baud rate in bits-per-second. |
u32SrcClockHz | Module source input clock in Hertz. |
- Returns
- The actual calculated baud rate.
- Parameters
-
base | QUEUEDSPI peripheral address. |
eMode | Mode setting of type qspi_master_slave_mode_t. |
static bool QSPI_IsMaster |
( |
QSPI_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | QUEUEDSPI peripheral address. |
- Returns
- Returns true if the module is in master mode or false if the module is in slave mode.
- Parameters
-
base | QUEUEDSPI peripheral address. |
eDataShiftOrder | MSB or LSB first from _qspi_shift_direction |
static void QSPI_EnableModeFault |
( |
QSPI_Type * |
base, |
|
|
bool |
bEnable |
|
) |
| |
|
inlinestatic |
If enable, allows the kQSPI_ModeFaultFlag flag to be set. If the kQSPI_ModeFaultFlag flag is set, disable the Mod detection does not clear the flag. If the mod detection is disabled, the level of the SS_B pin does not affect the operation of an enabled SPI configured as a master. If configured as a master and mod fault detection is enabled, a transaction in progress will stop if SS_B goes low. For an enabled SPI configured as a slave, having this feature disabled only prevents the flag from being set. It does not affect any other part of SPI operation
- Parameters
-
base | QUEUEDSPI peripheral address. |
bEnable | true to enable Mode Fault detection, false to disable |
- Note
- module shall be disabled before change the polarity by calling QSPI_Enable.
- Parameters
-
base | QUEUEDSPI peripheral address. |
ePolarity | clock polarity option |
Configure whether get the Slave Select signal toggle high during 2 data frames. Get the SS toggle high between data frames will lead to SPI to be trigged with transaction for the falling edge of SS signal. Otherwise, the data transaction is started on the first active SCLK edge.
- Note
- module shall be disabled before change the polarity by calling QSPI_Enable.
-
Do not use kQSPI_ClockPhaseSlaveSelectHighBetweenWords in DMA mode.
- Parameters
-
base | QUEUEDSPI peripheral address. |
eClockPhase | Option for clock phase |
static void QSPI_EnableWiredORMode |
( |
QSPI_Type * |
base, |
|
|
bool |
bEnable |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | QUEUEDSPI peripheral address. |
bEnable | true to configure SPI pins as open-drain, false to configure as push-pull |
static void QSPI_SetTransactionDataSize |
( |
QSPI_Type * |
base, |
|
|
qspi_data_width_t |
eDataWidth |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | QUEUEDSPI peripheral address. |
eDataWidth | datawidth for bits in each data frame. |
static void QSPI_MasterSetWaitDelay |
( |
QSPI_Type * |
base, |
|
|
uint16_t |
u16WaitDelayInPeriClockCount |
|
) |
| |
|
inlinestatic |
This controls the time between data transactions in master mode. Delay will not be added if no word is waiting for transmitting.
- Parameters
-
base | QUEUEDSPI peripheral address. |
u16WaitDelayInPeriClockCount | Clock count for the delay during data frames |
static void QSPI_EnableStopModeHoldOff |
( |
QSPI_Type * |
base, |
|
|
bool |
bEnable |
|
) |
| |
|
inlinestatic |
When enabled, this bit allows the SPI module to hold off entry to chip level stop mode if a word is being transmitted or received. Stop mode will be entered after the SPI finishes transmitting/receiving. This bit does not allow the SPI to wake the chip from stop mode in any way. The SHEN bit can only delay the entry into stop mode. This bit should not be set in slave mode because the state of SS_B (which would be controlled by an external master device) may cause the logic to hold off stop mode entry forever.
- Parameters
-
base | QUEUEDSPI peripheral address. |
bEnable | true to enable hold-off entrying stop mode if there is transmitting/receiving |
uint32_t QSPI_GetInstance |
( |
QSPI_Type * |
base | ) |
|
Get the instance index from the base address. User need not understand this function.
- Parameters
-
base | QUEUEDSPI peripheral address. |
- Returns
- uint32_t Index of the peripheral instance for given base address.
Get the value to drive on the SS_B pin. This bit is disabled when SSB_AUTO=1 or SSB_STRB=1. Only apply for Master mode.
- Parameters
-
base | QUEUEDSPI peripheral address. |
- Returns
- true SS_B input level High
-
false SS_B input level Low
This feature is disabled if Slave Select automatic mode is enabled or Slave Select Strobe feature is enabled
- Parameters
-
base | QUEUEDSPI peripheral address. |
eLogicLevel | logic level |
static void QSPI_MasterEnableSlaveSelectOpenDrainMode |
( |
QSPI_Type * |
base, |
|
|
bool |
bEnable |
|
) |
| |
|
inlinestatic |
Enable it means SS_B is configured for high and low drive. This mode is generally used in single master systems. Disable it means SS_B is configured as an open drain pin (only drives low output level). This mode is useful for multiple master systems
- Parameters
-
base | QUEUEDSPI peripheral address. |
bEnable | Enable/Disable option. |
static void QSPI_MasterEnableSlaveSelectAutomaticMode |
( |
QSPI_Type * |
base, |
|
|
bool |
bEnable |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | QUEUEDSPI peripheral address. |
bEnable | Enable/Disable option. |
- Parameters
-
base | QUEUEDSPI peripheral address. |
eDirection | options from _qspi_ssb_direction |
static void QSPI_MasterEnableSlaveSelectStrobe |
( |
QSPI_Type * |
base, |
|
|
bool |
bEnable |
|
) |
| |
|
inlinestatic |
If enabled, Slave select pulse high during data frames irrespective of Clock Phase configuration
- Parameters
-
base | QUEUEDSPI peripheral address. |
bEnable | Enable/Disable option. |
static void QSPI_EnableSlaveSelectOverride |
( |
QSPI_Type * |
base, |
|
|
bool |
bEnable |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | QUEUEDSPI peripheral address. |
bEnable | Enable/Disable option. |
void QSPI_SetDummyData |
( |
QSPI_Type * |
base, |
|
|
uint8_t |
u8DummyData |
|
) |
| |
- Parameters
-
base | QUEUEDSPI peripheral address. |
u8DummyData | Data to be transferred when tx buffer is NULL. |
uint8_t QSPI_GetDummyData |
( |
QSPI_Type * |
base | ) |
|
- Parameters
-
base | QUEUEDSPI peripheral base address. |
static void QSPI_WriteData |
( |
QSPI_Type * |
base, |
|
|
uint16_t |
data |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | QUEUEDSPI peripheral address. |
data | The data to send. |
static uint16_t QSPI_ReadData |
( |
QSPI_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | QUEUEDSPI peripheral address. |
- Returns
- The data from the receive data register.
static void QSPI_EnableFifo |
( |
QSPI_Type * |
base, |
|
|
bool |
bEnable |
|
) |
| |
|
inlinestatic |
This function allows the caller to disable or enable the TX and RX FIFOs together.
- Parameters
-
base | QUEUEDSPI peripheral address. |
bEnable | Pass true to enable, pass false to disable |
static uint16_t QSPI_GetTxFIFOCount |
( |
QSPI_Type * |
base | ) |
|
|
inlinestatic |
This function gets how many words are in the TX FIFO.
- Parameters
-
base | QUEUEDSPI peripheral address. |
- Returns
- TX FIFO word count.
static uint16_t QSPI_GetRxFIFOCount |
( |
QSPI_Type * |
base | ) |
|
|
inlinestatic |
This function gets how many words are in the RX FIFO.
- Parameters
-
base | QUEUEDSPI peripheral address. |
- Returns
- RX FIFO word count.
static void QSPI_SetFifoWatermarks |
( |
QSPI_Type * |
base, |
|
|
uint16_t |
txWatermark, |
|
|
uint16_t |
rxWatermark |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | QUEUEDSPI peripheral address. |
txWatermark | The TX FIFO watermark value. Refer to qspi_txfifo_watermark_t for available values. |
rxWatermar | The RX FIFO watermark value. Refer to qspi_rxfifo_watermark_t for available values. |
static void QSPI_GetFifoWatermarks |
( |
QSPI_Type * |
base, |
|
|
uint8_t * |
pu8TxWatermark, |
|
|
uint8_t * |
pu8RxWatermark |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | QUEUEDSPI peripheral address. |
pu8TxWatermark | The TX FIFO watermark value. |
pu8RxWatermark | The RX FIFO watermark value. |
static void QSPI_EmptyRxFifo |
( |
QSPI_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | QUEUEDSPI peripheral address. |
void QSPI_MasterTransferCreateHandle |
( |
QSPI_Type * |
base, |
|
|
qspi_master_transfer_handle_t * |
psHandle, |
|
|
qspi_master_transfer_callback_t |
pfCallback, |
|
|
void * |
pUserData |
|
) |
| |
This function initializes the QUEUEDSPI handle, which can be used for other QUEUEDSPI transactional APIs. Usually, for a specified QUEUEDSPI instance, call this API once to get the initialized handle.
- Note
- If only use the QSPI_MasterTransferBlocking, this API is not necessary be called.
- Parameters
-
psHandle | QUEUEDSPI handle pointer to qspi_master_transfer_handle_t. |
pfCallback | QUEUEDSPI callback. |
pUserData | Callback function parameter. |
This function transfers data using a polling method for master. This is a blocking function, which does not return until all transfers have been completed.
- Parameters
-
- Returns
- status of status_t.
This function transfers data using interrupts for master. This is a non-blocking function, which returns right away. When all data is transferred, the callback function is called.
- Parameters
-
psHandle | QUEUEDSPI handle pointer to qspi_master_transfer_handle_t. |
psXfer | Pointer to the qspi_transfer_t structure. |
- Returns
- status of status_t.
status_t QSPI_MasterTransferGetCount |
( |
qspi_master_transfer_handle_t * |
psHandle, |
|
|
uint16_t * |
pu16Count |
|
) |
| |
- Parameters
-
psHandle | QUEUEDSPI handle pointer to qspi_master_transfer_handle_t. |
pu16Count | The number of bytes transferred by using the non-blocking transaction. |
- Returns
- status of status_t.
void QSPI_MasterTransferAbort |
( |
qspi_master_transfer_handle_t * |
psHandle | ) |
|
- Parameters
-
psHandle | QUEUEDSPI handle pointer to qspi_master_transfer_handle_t. |
void QSPI_MasterTransferHandleIRQ |
( |
qspi_master_transfer_handle_t * |
psHandle | ) |
|
This function processes the QUEUEDSPI transmit and receive IRQ.
- Parameters
-
psHandle | QUEUEDSPI handle pointer to qspi_master_transfer_handle_t. |
void QSPI_SlaveTransferCreateHandle |
( |
QSPI_Type * |
base, |
|
|
qspi_slave_transfer_handle_t * |
psHandle, |
|
|
qspi_slave_transfer_callback_t |
pfCallback, |
|
|
void * |
pUserData |
|
) |
| |
This function initializes the QUEUEDSPI handle, which can be used for other QUEUEDSPI transactional APIs. Usually, for a specified QUEUEDSPI instance, call this API once to get the initialized handle.
- Parameters
-
base | QUEUEDSPI peripheral base address. |
psHandle | QUEUEDSPI handle pointer to the qspi_slave_transfer_handle_t. |
pfCallback | QUEUEDSPI callback. |
pUserData | Callback function parameter. |
This function transfers data using interrupts for slave. This is a non-blocking function, which returns right away. When all data is transferred, the callback function is called.
- Parameters
-
base | QUEUEDSPI peripheral base address. |
psHandle | Pointer to the qspi_slave_transfer_handle_t structure which stores the transfer state. |
psXfer | Pointer to the qspi_transfer_t structure. |
- Returns
- status of status_t.
status_t QSPI_SlaveTransferGetCount |
( |
qspi_slave_transfer_handle_t * |
psHandle, |
|
|
uint16_t * |
pu16Count |
|
) |
| |
- Parameters
-
psHandle | Pointer to the qspi_slave_transfer_handle_t structure which stores the transfer state. |
pu16Count | The number of bytes transferred by using the non-blocking transaction. |
- Returns
- status of status_t.
void QSPI_SlaveTransferAbort |
( |
qspi_slave_transfer_handle_t * |
psHandle | ) |
|
- Parameters
-
base | QUEUEDSPI peripheral base address. |
psHandle | Pointer to the qspi_slave_transfer_handle_t structure which stores the transfer state. |
void QSPI_SlaveTransferHandleIRQ |
( |
qspi_slave_transfer_handle_t * |
psHandle | ) |
|
This function processes the QUEUEDSPI transmit and receive IRQ.
- Parameters
-
psHandle | Pointer to the qspi_slave_transfer_handle_t structure which stores the transfer state. |
volatile uint16_t g_u8QueuedSpiDummyData[] |