I am a chinese user,how to realize the MOD5282's 24bit communication?
thank you.
How to realize QSPI 24bit communication
-
- Posts: 6
- Joined: Sun Aug 05, 2012 8:27 pm
- Location: tianjin China
Re: How to realize QSPI 24bit communication
If I understand you correctly, you wish to send 24 bits as a single transmission (not as three separate 1 byte sequences).
Here's the code for doing that.
Here's the code for doing that.
Code: Select all
BYTE TXBuffer[4];
OS_Sem QSPI_SEM;
OSSemInit( &QSPI_SEM, 0 );
UCOS_ENTER_CRITICAL();
TXBuffer[0] = data[0];
TXBuffer[1] = data[1];
TXBuffer[2] = data[2];
// if you've set the hardware chip enable pin via QSPIInit ignore the pin_.CE lines
pin_.CE = 0; // set the hardware Chip Enable pin low
QSPIStart(TXBuffer, NULL, 3, &QSPI_SEM_);
OSSemPend( &QSPI_SEM_, 0 ); // Wait for QSPI to complete
pin_.CE = 1; // set the hardware Chip Enable pin high
UCOS_EXIT_CRITICAL();
Dan Ciliske
Project Engineer
Netburner, Inc
Project Engineer
Netburner, Inc