NetBurner 3.5.6
PDF Version
qspi.h
1/*NB_REVISION*/
2
3/*NB_COPYRIGHT*/
4
67#ifndef _QSPI_H
68#define _QSPI_H
69#include <basictypes.h>
70#include <nbrtos.h>
71
72/*
73 *****************************************************************************-
74 *
75 * Queued Serial Peripheral Interface (QSPI)
76 *
77 * Interface consists of data output (QSPI_DOUT), data input (QSPI_DIN),
78 * serial clock (QSPI_CLK) & peripheral chip selects (QSPI_CS[3:0]).
79 *
80 * SPI parameters are used to match the master (processor) with the slave
81 * device. Chip select can be used to multiplex devices.
82 *
83 * The specific hardware initialization for MFCXXXX and MODXXXX are
84 * microprocessor and module specific and need to be correctly
85 * implemented in the module specific library for each SPI device.
86 *
87 * More than one SPI device requires careful coordination of hardware use
88 * and synchronization of use.
89 *
90 *****************************************************************************-
91 */
92
98#define QSPI_OK (0)
99#define QSPI_BUSY (1)
144uint8_t QSPIInit(uint32_t baudRateInBps = 2000000,
145 uint8_t transferSizeInBits = 8,
146 uint8_t peripheralChipSelects = 0x0F,
147 uint8_t chipSelectPolarity = 1,
148 uint8_t clockPolarity = 0,
149 uint8_t clockPhase = 1,
150 BOOL doutHiz = TRUE,
151 uint8_t csToClockDelay = 0,
152 uint8_t delayAfterTransfer = 0);
153
169uint8_t QSPIStart(puint8_t transmitBufferPtr, volatile uint8_t *receiveBufferPtr, uint32_t byteCount, OS_SEM *finishedSem = NULL);
170
182BOOL QSPIdone(void);
183
190{
191 volatile uint8_t *pQSPIRxbuf;
192 volatile uint8_t *pQSPITxbuf;
193 uint8_t BitsPerQueue;
194 uint32_t QSPI_SizeLeft;
195 uint16_t Command_Mask;
196 OS_SEM *QSPI_Sem;
197};
198
199#endif
200
uint8_t QSPIInit(uint32_t baudRateInBps=2000000, uint8_t transferSizeInBits=8, uint8_t peripheralChipSelects=0x0F, uint8_t chipSelectPolarity=1, uint8_t clockPolarity=0, uint8_t clockPhase=1, BOOL doutHiz=TRUE, uint8_t csToClockDelay=0, uint8_t delayAfterTransfer=0)
Initialize Queued Serial Peripheral Interface (QSPI)
Definition coldfire/cpu/MCF5441X/include/dspi.h:620
uint8_t QSPIStart(puint8_t transmitBufferPtr, volatile uint8_t *receiveBufferPtr, uint32_t byteCount, OS_SEM *finishedSem=NULL)
Start QSPI Data Transfer.
Definition coldfire/cpu/MCF5441X/include/dspi.h:634
BOOL QSPIdone(void)
Can be called after QSPIStart(). Returns TRUE when transfer is complete. This is an alternative to us...
Definition coldfire/cpu/MCF5441X/include/dspi.h:639
This struct contains the major variables/configurations used for a QSPI transfer.
Definition qspi.h:190
uint8_t BitsPerQueue
This is the number if bits per transfer, (value = 8 - 32).
Definition qspi.h:193
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:191
uint16_t Command_Mask
This is a partial configuration for the queue's command reg.
Definition qspi.h:195
uint32_t QSPI_SizeLeft
This is the number if bytes left in the transfer.
Definition qspi.h:194
OS_SEM * QSPI_Sem
This is a pointer to an external semaphore provided by QSPIStart().
Definition qspi.h:196
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:192