![]() |
M480 BSP V3.05.005
The Board Support Package for M480 Series
|
Macros | |
#define | QSPI_CLR_UNIT_TRANS_INT_FLAG(qspi) |
Clear the unit transfer interrupt flag. More... | |
#define | QSPI_TRIGGER_RX_PDMA(qspi) |
Trigger RX PDMA function. More... | |
#define | QSPI_TRIGGER_TX_PDMA(qspi) |
Trigger TX PDMA function. More... | |
#define | QSPI_TRIGGER_TX_RX_PDMA(qspi) |
Trigger TX and RX PDMA function. More... | |
#define | QSPI_DISABLE_RX_PDMA(qspi) |
Disable RX PDMA transfer. More... | |
#define | QSPI_DISABLE_TX_PDMA(qspi) |
Disable TX PDMA transfer. More... | |
#define | QSPI_DISABLE_TX_RX_PDMA(qspi) |
Disable TX and RX PDMA transfer. More... | |
#define | QSPI_GET_RX_FIFO_COUNT(qspi) |
Get the count of available data in RX FIFO. More... | |
#define | QSPI_GET_RX_FIFO_EMPTY_FLAG(qspi) |
Get the RX FIFO empty flag. More... | |
#define | QSPI_GET_TX_FIFO_EMPTY_FLAG(qspi) |
Get the TX FIFO empty flag. More... | |
#define | QSPI_GET_TX_FIFO_FULL_FLAG(qspi) |
Get the TX FIFO full flag. More... | |
#define | QSPI_READ_RX(qspi) |
Get the datum read from RX register. More... | |
#define | QSPI_WRITE_TX(qspi, u32TxData) |
Write datum to TX register. More... | |
#define | QSPI_SET_SS_HIGH(qspi) |
Set QSPIx_SS pin to high state. More... | |
#define | QSPI_SET_SS_LOW(qspi) |
Set QSPIx_SS pin to low state. More... | |
#define | QSPI_ENABLE_BYTE_REORDER(qspi) |
Enable Byte Reorder function. More... | |
#define | QSPI_DISABLE_BYTE_REORDER(qspi) |
Disable Byte Reorder function. More... | |
#define | QSPI_SET_SUSPEND_CYCLE(qspi, u32SuspCycle) |
Set the length of suspend interval. More... | |
#define | QSPI_SET_LSB_FIRST(qspi) |
Set the QSPI transfer sequence with LSB first. More... | |
#define | QSPI_SET_MSB_FIRST(qspi) |
Set the QSPI transfer sequence with MSB first. More... | |
#define | QSPI_SET_DATA_WIDTH(qspi, u32Width) |
Set the data width of a QSPI transaction. More... | |
#define | QSPI_IS_BUSY(qspi) |
Get the QSPI busy state. More... | |
#define | QSPI_ENABLE(qspi) |
Enable QSPI controller. More... | |
#define | QSPI_DISABLE(qspi) |
Disable QSPI controller. More... | |
#define | QSPI_DISABLE_DUAL_MODE(qspi) |
Disable QSPI Dual IO function. More... | |
#define | QSPI_ENABLE_DUAL_INPUT_MODE(qspi) |
Enable Dual IO function and set QSPI Dual IO direction to input. More... | |
#define | QSPI_ENABLE_DUAL_OUTPUT_MODE(qspi) |
Enable Dual IO function and set QSPI Dual IO direction to output. More... | |
#define | QSPI_DISABLE_QUAD_MODE(qspi) |
Disable QSPI Dual IO function. More... | |
#define | QSPI_ENABLE_QUAD_INPUT_MODE(qspi) |
Set QSPI Quad IO direction to input. More... | |
#define | QSPI_ENABLE_QUAD_OUTPUT_MODE(qspi) |
Set QSPI Quad IO direction to output. More... | |
Functions | |
uint32_t | QSPI_Open (QSPI_T *qspi, uint32_t u32MasterSlave, uint32_t u32QSPIMode, uint32_t u32DataWidth, uint32_t u32BusClock) |
This function make QSPI module be ready to transfer. More... | |
void | QSPI_Close (QSPI_T *qspi) |
Disable QSPI controller. More... | |
void | QSPI_ClearRxFIFO (QSPI_T *qspi) |
Clear RX FIFO buffer. More... | |
void | QSPI_ClearTxFIFO (QSPI_T *qspi) |
Clear TX FIFO buffer. More... | |
void | QSPI_DisableAutoSS (QSPI_T *qspi) |
Disable the automatic slave selection function. More... | |
void | QSPI_EnableAutoSS (QSPI_T *qspi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel) |
Enable the automatic slave selection function. More... | |
uint32_t | QSPI_SetBusClock (QSPI_T *qspi, uint32_t u32BusClock) |
Set the QSPI bus clock. More... | |
void | QSPI_SetFIFO (QSPI_T *qspi, uint32_t u32TxThreshold, uint32_t u32RxThreshold) |
Configure FIFO threshold setting. More... | |
uint32_t | QSPI_GetBusClock (QSPI_T *qspi) |
Get the actual frequency of QSPI bus clock. Only available in Master mode. More... | |
void | QSPI_EnableInt (QSPI_T *qspi, uint32_t u32Mask) |
Enable interrupt function. More... | |
void | QSPI_DisableInt (QSPI_T *qspi, uint32_t u32Mask) |
Disable interrupt function. More... | |
uint32_t | QSPI_GetIntFlag (QSPI_T *qspi, uint32_t u32Mask) |
Get interrupt flag. More... | |
void | QSPI_ClearIntFlag (QSPI_T *qspi, uint32_t u32Mask) |
Clear interrupt flag. More... | |
uint32_t | QSPI_GetStatus (QSPI_T *qspi, uint32_t u32Mask) |
Get QSPI status. More... | |
#define QSPI_CLR_UNIT_TRANS_INT_FLAG | ( | qspi | ) |
#define QSPI_DISABLE | ( | qspi | ) |
#define QSPI_DISABLE_BYTE_REORDER | ( | qspi | ) |
#define QSPI_DISABLE_DUAL_MODE | ( | qspi | ) |
#define QSPI_DISABLE_QUAD_MODE | ( | qspi | ) |
#define QSPI_DISABLE_RX_PDMA | ( | qspi | ) |
#define QSPI_DISABLE_TX_PDMA | ( | qspi | ) |
#define QSPI_DISABLE_TX_RX_PDMA | ( | qspi | ) |
#define QSPI_ENABLE | ( | qspi | ) |
#define QSPI_ENABLE_BYTE_REORDER | ( | qspi | ) |
#define QSPI_ENABLE_DUAL_INPUT_MODE | ( | qspi | ) |
#define QSPI_ENABLE_DUAL_OUTPUT_MODE | ( | qspi | ) |
#define QSPI_ENABLE_QUAD_INPUT_MODE | ( | qspi | ) |
#define QSPI_ENABLE_QUAD_OUTPUT_MODE | ( | qspi | ) |
#define QSPI_GET_RX_FIFO_COUNT | ( | qspi | ) |
#define QSPI_GET_RX_FIFO_EMPTY_FLAG | ( | qspi | ) |
#define QSPI_GET_TX_FIFO_EMPTY_FLAG | ( | qspi | ) |
#define QSPI_GET_TX_FIFO_FULL_FLAG | ( | qspi | ) |
#define QSPI_IS_BUSY | ( | qspi | ) |
#define QSPI_READ_RX | ( | qspi | ) |
#define QSPI_SET_DATA_WIDTH | ( | qspi, | |
u32Width | |||
) |
#define QSPI_SET_LSB_FIRST | ( | qspi | ) |
#define QSPI_SET_MSB_FIRST | ( | qspi | ) |
#define QSPI_SET_SS_HIGH | ( | qspi | ) |
#define QSPI_SET_SS_LOW | ( | qspi | ) |
#define QSPI_SET_SUSPEND_CYCLE | ( | qspi, | |
u32SuspCycle | |||
) |
Set the length of suspend interval.
[in] | qspi | The pointer of the specified QSPI module. |
[in] | u32SuspCycle | Decides the length of suspend interval. It could be 0 ~ 15. |
Set the length of suspend interval according to u32SuspCycle. The length of suspend interval is ((u32SuspCycle + 0.5) * the length of one QSPI bus clock cycle).
#define QSPI_TRIGGER_RX_PDMA | ( | qspi | ) |
#define QSPI_TRIGGER_TX_PDMA | ( | qspi | ) |
#define QSPI_TRIGGER_TX_RX_PDMA | ( | qspi | ) |
#define QSPI_WRITE_TX | ( | qspi, | |
u32TxData | |||
) |
void QSPI_ClearIntFlag | ( | QSPI_T * | qspi, |
uint32_t | u32Mask | ||
) |
Clear interrupt flag.
[in] | qspi | The pointer of the specified QSPI module. |
[in] | u32Mask | The combination of all related interrupt sources. Each bit corresponds to a interrupt source. This parameter decides which interrupt flags will be cleared. It could be the combination of: |
Clear QSPI related interrupt flags specified by u32Mask parameter.
void QSPI_ClearRxFIFO | ( | QSPI_T * | qspi | ) |
void QSPI_ClearTxFIFO | ( | QSPI_T * | qspi | ) |
void QSPI_Close | ( | QSPI_T * | qspi | ) |
void QSPI_DisableAutoSS | ( | QSPI_T * | qspi | ) |
void QSPI_DisableInt | ( | QSPI_T * | qspi, |
uint32_t | u32Mask | ||
) |
Disable interrupt function.
[in] | qspi | The pointer of the specified QSPI module. |
[in] | u32Mask | The combination of all related interrupt enable bits. Each bit corresponds to a interrupt bit. This parameter decides which interrupts will be disabled. It is combination of: |
Disable QSPI related interrupts specified by u32Mask parameter.
void QSPI_EnableAutoSS | ( | QSPI_T * | qspi, |
uint32_t | u32SSPinMask, | ||
uint32_t | u32ActiveLevel | ||
) |
Enable the automatic slave selection function.
[in] | qspi | The pointer of the specified QSPI module. |
[in] | u32SSPinMask | Specifies slave selection pins. (QSPI_SS) |
[in] | u32ActiveLevel | Specifies the active level of slave selection signal. (QSPI_SS_ACTIVE_HIGH, QSPI_SS_ACTIVE_LOW) |
This function will enable the automatic slave selection function. Only available in Master mode. The slave selection pin and the active level will be set in this function.
void QSPI_EnableInt | ( | QSPI_T * | qspi, |
uint32_t | u32Mask | ||
) |
Enable interrupt function.
[in] | qspi | The pointer of the specified QSPI module. |
[in] | u32Mask | The combination of all related interrupt enable bits. Each bit corresponds to a interrupt enable bit. This parameter decides which interrupts will be enabled. It is combination of: |
Enable QSPI related interrupts specified by u32Mask parameter.
uint32_t QSPI_GetBusClock | ( | QSPI_T * | qspi | ) |
Get the actual frequency of QSPI bus clock. Only available in Master mode.
[in] | qspi | The pointer of the specified QSPI module. |
This function will calculate the actual QSPI bus clock rate according to the QSPInSEL and DIVIDER settings. Only available in Master mode.
uint32_t QSPI_GetIntFlag | ( | QSPI_T * | qspi, |
uint32_t | u32Mask | ||
) |
Get interrupt flag.
[in] | qspi | The pointer of the specified QSPI module. |
[in] | u32Mask | The combination of all related interrupt sources. Each bit corresponds to a interrupt source. This parameter decides which interrupt flags will be read. It is combination of: |
Get QSPI related interrupt flags specified by u32Mask parameter.
uint32_t QSPI_GetStatus | ( | QSPI_T * | qspi, |
uint32_t | u32Mask | ||
) |
Get QSPI status.
[in] | qspi | The pointer of the specified QSPI module. |
[in] | u32Mask | The combination of all related sources. Each bit corresponds to a source. This parameter decides which flags will be read. It is combination of: |
Get QSPI related status specified by u32Mask parameter.
uint32_t QSPI_Open | ( | QSPI_T * | qspi, |
uint32_t | u32MasterSlave, | ||
uint32_t | u32QSPIMode, | ||
uint32_t | u32DataWidth, | ||
uint32_t | u32BusClock | ||
) |
This function make QSPI module be ready to transfer.
[in] | qspi | The pointer of the specified QSPI module. |
[in] | u32MasterSlave | Decides the QSPI module is operating in master mode or in slave mode. (QSPI_SLAVE, QSPI_MASTER) |
[in] | u32QSPIMode | Decides the transfer timing. (QSPI_MODE_0, QSPI_MODE_1, QSPI_MODE_2, QSPI_MODE_3) |
[in] | u32DataWidth | Decides the data width of a QSPI transaction. |
[in] | u32BusClock | The expected frequency of QSPI bus clock in Hz. |
By default, the QSPI transfer sequence is MSB first, the slave selection signal is active low and the automatic slave selection function is disabled. In Slave mode, the u32BusClock shall be NULL and the QSPI clock divider setting will be 0. The actual clock rate may be different from the target QSPI clock rate. For example, if the QSPI source clock rate is 12 MHz and the target QSPI bus clock rate is 7 MHz, the actual QSPI clock rate will be 6MHz.
uint32_t QSPI_SetBusClock | ( | QSPI_T * | qspi, |
uint32_t | u32BusClock | ||
) |
Set the QSPI bus clock.
[in] | qspi | The pointer of the specified QSPI module. |
[in] | u32BusClock | The expected frequency of QSPI bus clock in Hz. |
This function is only available in Master mode. The actual clock rate may be different from the target QSPI bus clock rate. For example, if the QSPI source clock rate is 12 MHz and the target QSPI bus clock rate is 7 MHz, the actual QSPI bus clock rate will be 6 MHz.
void QSPI_SetFIFO | ( | QSPI_T * | qspi, |
uint32_t | u32TxThreshold, | ||
uint32_t | u32RxThreshold | ||
) |
Configure FIFO threshold setting.
[in] | qspi | The pointer of the specified QSPI module. |
[in] | u32TxThreshold | Decides the TX FIFO threshold. It could be 0 ~ 7. |
[in] | u32RxThreshold | Decides the RX FIFO threshold. It could be 0 ~ 7. |
Set TX FIFO threshold and RX FIFO threshold configurations.