|
AM273x MCU+ SDK
09.02.00
|
|
Go to the documentation of this file.
57 #include <drivers/hw_include/cslr_qspi.h>
91 #define QSPI_NOT_IN_USE(x) (void) 0
98 #define QSPI_LLD_CMD_INVALID_ADDR (0xFFFFFFFFU)
110 #define QSPI_RX_LINES_SINGLE (0U)
111 #define QSPI_RX_LINES_DUAL (1U)
112 #define QSPI_RX_LINES_QUAD (2U)
129 #define QSPI_FF_POL0_PHA0 ((CSL_QSPI_SPI_DC_REG_CKPH0_CKP_0_SHIFT_OUT_FALLING_EDGE \
130 << CSL_QSPI_SPI_DC_REG_CKPH0_SHIFT) | \
131 (CSL_QSPI_SPI_DC_REG_CKP0_DATA_INACTIVE << \
132 CSL_QSPI_SPI_DC_REG_CKP0_SHIFT))
133 #define QSPI_FF_POL0_PHA1 ((CSL_QSPI_SPI_DC_REG_CKPH0_CKP_0_SHIFT_OUT_RISING_EDGE \
134 << CSL_QSPI_SPI_DC_REG_CKPH0_SHIFT) | \
135 (CSL_QSPI_SPI_DC_REG_CKP0_DATA_INACTIVE << \
136 CSL_QSPI_SPI_DC_REG_CKP0_SHIFT))
137 #define QSPI_FF_POL1_PHA0 ((CSL_QSPI_SPI_DC_REG_CKPH0_CKP_1_SHIFT_OUT_RISING_EDGE \
138 << CSL_QSPI_SPI_DC_REG_CKPH0_SHIFT) | \
139 (CSL_QSPI_SPI_DC_REG_CKP0_DATA_ACTIVE << \
140 CSL_QSPI_SPI_DC_REG_CKP0_SHIFT))
141 #define QSPI_FF_POL1_PHA1 ((CSL_QSPI_SPI_DC_REG_CKPH0_CKP_1_SHIFT_OUT_FALLING_EDGE \
142 << CSL_QSPI_SPI_DC_REG_CKPH0_SHIFT) | \
143 (CSL_QSPI_SPI_DC_REG_CKP0_DATA_ACTIVE << \
144 CSL_QSPI_SPI_DC_REG_CKP0_SHIFT))
155 #define QSPI_CS_POL_ACTIVE_LOW (CSL_QSPI_SPI_DC_REG_CSP0_ACTIVE_LOW)
156 #define QSPI_CS_POL_ACTIVE_HIGH (CSL_QSPI_SPI_DC_REG_CSP0_ACTIVE_HIGH)
167 #define QSPI_DATA_DELAY_0 (CSL_QSPI_SPI_DC_REG_DD0_CS_TO_DATA_DELAY_0)
168 #define QSPI_DATA_DELAY_1 (CSL_QSPI_SPI_DC_REG_DD0_CS_TO_DATA_DELAY_1)
169 #define QSPI_DATA_DELAY_2 (CSL_QSPI_SPI_DC_REG_DD0_CS_TO_DATA_DELAY_2)
170 #define QSPI_DATA_DELAY_3 (CSL_QSPI_SPI_DC_REG_DD0_CS_TO_DATA_DELAY_3)
182 #define QSPI_MEM_MAP_PORT_SEL_CFG_PORT \
183 (CSL_QSPI_SPI_SWITCH_REG_MMPT_S_SEL_CFG_PORT)
184 #define QSPI_MEM_MAP_PORT_SEL_MEM_MAP_PORT \
185 (CSL_QSPI_SPI_SWITCH_REG_MMPT_S_SEL_MM_PORT)
189 #define QSPI_MAX_WORD_LENGTH (128U)
197 #define QSPI_SYSTEM_SUCCESS ((int32_t )0)
202 #define QSPI_SYSTEM_FAILURE ((int32_t)-1)
207 #define QSPI_TIMEOUT ((int32_t)-2)
212 #define QSPI_LLD_INVALID_PARAM ((int32_t)-3)
217 #define QSPI_BUSY ((int32_t)-4)
222 #define QSPI_INVALID_STATE ((int32_t)-5)
232 #define QSPI_STATE_RESET (0U)
237 #define QSPI_STATE_READY (1U)
242 #define QSPI_STATE_BUSY (2U)
247 #define QSPI_STATE_ERROR (3U)
257 #define QSPI_STATE_IDLE (0U)
261 #define QSPI_STATE_ADDRESS_WRITE (1U)
265 #define QSPI_STATE_DATA_WRITE (2U)
269 #define QSPI_STATE_DATA_READ (3U)
int32_t QSPI_lld_readCmd(QSPILLD_Handle hQspi, QSPILLD_WriteCmdParams *writeMsg)
Function to send specific commands and receive related data from flash in configuration mode.
void * dataBuf
Definition: qspi_lld.h:368
uint32_t memMapBaseAddr
Definition: qspi_lld.h:379
void * args
Definition: qspi_lld.h:443
bool readWriteFlag
Definition: qspi_lld.h:340
void * args
Definition: hsmclient_msg.h:4
uint32_t inputClkFreq
Definition: qspi_lld.h:381
bool wordIntr
Definition: qspi_lld.h:405
uint8_t readCmd
Definition: qspi_lld.h:429
int32_t QSPI_lld_setRxLines(QSPILLD_Handle hQspi, uint32_t rxLines)
Set QSPI Rx lines in the QSPI object.
QSPI_Clock_usecToTicks Clock_usecToTicks
Definition: qspi_lld.h:415
int32_t QSPI_lld_readDma(QSPILLD_Handle hQspi, uint32_t count, void *rxBuf, uint32_t addrOffset, uint32_t timeout)
Function to perform read from the flash in DMA mode.
QSPI Driver Transaction.
Definition: qspi_lld.h:329
uint8_t intrPriority
Definition: qspi_lld.h:409
struct QSPILLD_Transaction * QSPILLD_TransactionHandle
uint32_t wlen
Definition: qspi_lld.h:350
uint32_t wrdLen
Definition: qspi_lld.h:393
bool dmaEnable
Definition: qspi_lld.h:411
int32_t QSPI_lld_getInputClk(QSPILLD_Handle hQspi, uint32_t *inputClk)
This function returns the input clock at which QSPI was programmed.
uint32_t cmdRegVal
Definition: qspi_lld.h:342
int32_t QSPI_lld_setReadCmd(QSPILLD_Handle hQspi, uint8_t command)
Function to set read command to be used.
void * buf
Definition: qspi_lld.h:334
QSPILLD_Transaction * transaction
Definition: qspi_lld.h:445
int32_t QSPI_lld_read(QSPILLD_Handle hQspi, uint32_t count, void *rxBuf, uint32_t addrOffset, uint32_t timeout)
Function to perform reads from the flash in memory map mode.
uint32_t baseAddr
Definition: qspi_lld.h:427
void * QSPI_DmaChConfig
A handle that holds DMA configuration parameters for QSPI.
Definition: qspi_lld.h:72
QSPI driver initialization object.
Definition: qspi_lld.h:378
void(* QSPI_lld_InterruptCallback)(void *args)
The definition of a interrupt completion callback function used by the QSPI driver.
Definition: qspi_lld.h:304
uint32_t dataLen
Definition: qspi_lld.h:370
void QSPI_lld_isr(void *args)
QSPI ISR for Read and Write Functionality.
uint32_t qspiClockDiv
Definition: qspi_lld.h:383
bool status
Definition: qspi_lld.h:338
uint8_t writeCmd
Definition: qspi_lld.h:431
QSPI_lld_InterruptCallback interruptCallback
Definition: qspi_lld.h:449
uint32_t intrNum
Definition: qspi_lld.h:401
uint32_t csPol
Definition: qspi_lld.h:387
struct QSPILLD_Object * QSPILLD_Handle
uint32_t cmdAddr
Definition: qspi_lld.h:363
void(* QSPI_lld_dma_readCompleteCallback)(void *args)
The definition of a dma read completion callback function used by the QSPI driver.
Definition: qspi_lld.h:312
uint8_t numAddrBytes
Definition: qspi_lld.h:348
uint32_t chipSelect
Definition: qspi_lld.h:385
uint32_t frmLength
Definition: qspi_lld.h:433
int32_t QSPI_lld_readCmdIntr(QSPILLD_Handle hQspi, const QSPILLD_WriteCmdParams *msg)
Function to send specific commands and receive related data from flash in interrupt mode.
QSPI driver object.
Definition: qspi_lld.h:423
QSPI_lld_dma_readCompleteCallback readCompleteCallback
Definition: qspi_lld.h:451
uint32_t(* QSPI_Clock_usecToTicks)(uint64_t usecs)
The definition of a micro seconds to ticks function used by the QSPI driver to get ticks from microse...
Definition: qspi_lld.h:295
QSPI_DmaHandle qspiDmaHandle
Definition: qspi_lld.h:397
uint32_t currentIndex
Definition: qspi_lld.h:344
bool intrEnable
Definition: qspi_lld.h:403
uint8_t cmd
Definition: qspi_lld.h:361
uint32_t numDummyBits
Definition: qspi_lld.h:437
int32_t QSPI_lld_setDummyBitCount(QSPILLD_Handle hQspi, uint32_t count)
Function to set number of dummy bits to be used.
int32_t QSPI_lld_writeCmd(QSPILLD_Handle hQspi, QSPILLD_WriteCmdParams *writeMsg)
Function to send specific commands and write data into flash in configuration mode.
uint32_t addrOffset
Definition: qspi_lld.h:336
int32_t QSPI_lld_setWriteCmd(QSPILLD_Handle hQspi, uint8_t command)
Function to set write command to be used.
uint32_t dataDelay
Definition: qspi_lld.h:391
int32_t QSPI_lld_initDma(QSPILLD_Handle hQspi)
This function initializes the QSPI module in DMA Mode.
uint8_t numAddrBytes
Definition: qspi_lld.h:366
void * QSPI_DmaHandle
The handle for DMA instance used with QSPI.
Definition: qspi_lld.h:69
QSPI Transaction Info.
Definition: qspi_lld.h:360
uint8_t cmd
Definition: qspi_lld.h:346
int32_t QSPI_lld_setMemAddrSpace(QSPILLD_Handle hQspi, uint32_t memMappedPortSwitch)
This function is used to switch between memory mapped and configuration mode.
QSPI_Clock_getTicks Clock_getTicks
Definition: qspi_lld.h:413
int32_t QSPI_lld_setPreScaler(QSPILLD_Handle hQspi, uint32_t clkDividerVal)
Set the QSPI clock register divider value.
QSPILLD_InitHandle hQspiInit
Definition: qspi_lld.h:439
bool frameIntr
Definition: qspi_lld.h:407
uint32_t(* QSPI_Clock_getTicks)(void)
The definition of a get System Tick function used by the QSPI driver to keep track of time.
Definition: qspi_lld.h:284
int32_t QSPI_lld_setAddressByteCount(QSPILLD_Handle hQspi, uint32_t count)
Function to set number of address bytes to be used.
uint32_t dataLen
Definition: qspi_lld.h:332
int32_t QSPI_lld_deInit(QSPILLD_Handle hQspi)
This function de-initializes the QSPI module.
int32_t QSPI_lld_deInitDma(QSPILLD_Handle hQspi)
This function de-initializes the QSPI module in DMA Mode.
uint32_t rxLines
Definition: qspi_lld.h:395
uint32_t count
Definition: qspi_lld.h:330
uint32_t state
Definition: qspi_lld.h:441
uint32_t frmFmt
Definition: qspi_lld.h:389
QSPILLD_Transaction trans
Definition: qspi_lld.h:447
void QSPI_lld_readCompleteCallback(void *args)
QSPI Read complete callback for DMA mode.
uint32_t QSPI_lld_getRxLines(QSPILLD_Handle hQspi)
Get QSPI Rx lines in the QSPI object.
int32_t QSPI_lld_init(QSPILLD_Handle hQspi)
This function initializes the QSPI module.
uint32_t numAddrBytes
Definition: qspi_lld.h:435
uint32_t state
Definition: qspi_lld.h:352
QSPI_DmaChConfig qspiDmaChConfig
Definition: qspi_lld.h:399
int32_t QSPI_lld_writeCmdIntr(QSPILLD_Handle hQspi, const QSPILLD_WriteCmdParams *msg)
Function to send specific commands and write data into flash in interrupt mode.
struct QSPILLD_InitObject * QSPILLD_InitHandle