NetBurner 3.1
qspi.h
Go to the documentation of this file.
1 /*NB_REVISION*/
2 
3 /*NB_COPYRIGHT*/
4 
51 #ifndef _QSPI_H
52 #define _QSPI_H
53 #include <basictypes.h>
54 
55 /*
56  *****************************************************************************-
57  *
58  * Queued Serial Peripheral Interface (QSPI)
59  *
60  * Interface consists of data output (QSPI_DOUT), data input (QSPI_DIN),
61  * serial clock (QSPI_CLK) & peripheral chip selects (QSPI_CS[3:0]).
62  *
63  * SPI parameters are used to match the master (processor) with the slave
64  * device. Chip select can be used to multiplex devices.
65  *
66  * The specific hardware initialization for MFCXXXX and MODXXXX are
67  * microprocessor and module specific and need to be correctly
68  * implemented in the module specific library for each SPI device.
69  *
70  * More than one SPI device requires careful coordination of hardware use
71  * and synchronization of use.
72  *
73  *****************************************************************************-
74  */
75 
80 #define QSPI_OK (0)
81 #define QSPI_BUSY (1)
82 
135 uint8_t QSPIInit(uint32_t baudRateInBps = 2000000,
136  uint8_t transferSizeInBits = 8,
137  uint8_t peripheralChipSelects = 0x0F,
138  uint8_t chipSelectPolarity = 1,
139  uint8_t clockPolarity = 0,
140  uint8_t clockPhase = 1,
141  BOOL doutHiz = TRUE,
142  uint8_t csToClockDelay = 0,
143  uint8_t delayAfterTransfer = 0);
144 
160 uint8_t QSPIStart(puint8_t transmitBufferPtr, volatile uint8_t *receiveBufferPtr, uint32_t byteCount, OS_SEM *finishedSem = NULL);
161 
173 BOOL QSPIdone(void);
174 
181 {
182  volatile uint8_t *pQSPIRxbuf;
183  volatile uint8_t *pQSPITxbuf;
184  uint8_t BitsPerQueue;
185  uint32_t QSPI_SizeLeft;
186  uint16_t Command_Mask;
188 };
189 
190 #endif
191 
uint8_t QSPIStart(puint8_t transmitBufferPtr, volatile uint8_t *receiveBufferPtr, uint32_t byteCount, OS_SEM *finishedSem=NULL)
Start QSPI Data Transfer.
Definition: dspi.h:465
Semaphores are used to control access to shared resource critical section, or to communicate between ...
Definition: nbrtos.h:318
uint16_t Command_Mask
This is a partial configuration for the queue&#39;s command reg.
Definition: qspi.h:186
volatile uint8_t * pQSPITxbuf
This pointer is used to track the locations in memory where data will be written to the peripheral...
Definition: qspi.h:183
BOOL QSPIdone(void)
Can be called after QSPIStart(). Returns TRUE when transfer is complete. This is an alternative to us...
Definition: dspi.h:479
uint32_t QSPI_SizeLeft
This is the number if bytes left in the transfer.
Definition: qspi.h:185
OS_SEM * QSPI_Sem
This is a pointer to an external semaphore provided by QSPIStart().
Definition: qspi.h:187
This struct contains the major variables/configurations used for a QSPI transfer. ...
Definition: qspi.h:180
#define NULL
Definition: nm_bsp.h:76
volatile uint8_t * pQSPIRxbuf
This pointer is used to track the locations in memory where data will be read from the peripheral...
Definition: qspi.h:182
uint8_t BitsPerQueue
This is the number if bits per transfer, (value = 8 - 32).
Definition: qspi.h:184