NetBurner 3.5.0
PDF Version
 
qspi.h
Go to the documentation of this file.
1/*NB_REVISION*/
2
3/*NB_COPYRIGHT*/
4
65#ifndef _QSPI_H
66#define _QSPI_H
67#include <basictypes.h>
68#include <nbrtos.h>
69
70/*
71 *****************************************************************************-
72 *
73 * Queued Serial Peripheral Interface (QSPI)
74 *
75 * Interface consists of data output (QSPI_DOUT), data input (QSPI_DIN),
76 * serial clock (QSPI_CLK) & peripheral chip selects (QSPI_CS[3:0]).
77 *
78 * SPI parameters are used to match the master (processor) with the slave
79 * device. Chip select can be used to multiplex devices.
80 *
81 * The specific hardware initialization for MFCXXXX and MODXXXX are
82 * microprocessor and module specific and need to be correctly
83 * implemented in the module specific library for each SPI device.
84 *
85 * More than one SPI device requires careful coordination of hardware use
86 * and synchronization of use.
87 *
88 *****************************************************************************-
89 */
90
96#define QSPI_OK (0)
97#define QSPI_BUSY (1)
142uint8_t QSPIInit(uint32_t baudRateInBps = 2000000,
143 uint8_t transferSizeInBits = 8,
144 uint8_t peripheralChipSelects = 0x0F,
145 uint8_t chipSelectPolarity = 1,
146 uint8_t clockPolarity = 0,
147 uint8_t clockPhase = 1,
148 BOOL doutHiz = TRUE,
149 uint8_t csToClockDelay = 0,
150 uint8_t delayAfterTransfer = 0);
151
167uint8_t QSPIStart(puint8_t transmitBufferPtr, volatile uint8_t *receiveBufferPtr, uint32_t byteCount, OS_SEM *finishedSem = NULL);
168
180BOOL QSPIdone(void);
181
188{
189 volatile uint8_t *pQSPIRxbuf;
190 volatile uint8_t *pQSPITxbuf;
191 uint8_t BitsPerQueue;
192 uint32_t QSPI_SizeLeft;
193 uint16_t Command_Mask;
195};
196
197#endif
198
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
NetBurner Real-Time Operating System (NBRTOS) API.
Semaphores are used to control access to shared resources or or to communicate between tasks in a mul...
Definition nbrtos.h:386
This struct contains the major variables/configurations used for a QSPI transfer.
Definition qspi.h:188
uint8_t BitsPerQueue
This is the number if bits per transfer, (value = 8 - 32).
Definition qspi.h:191
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:189
uint16_t Command_Mask
This is a partial configuration for the queue's command reg.
Definition qspi.h:193
uint32_t QSPI_SizeLeft
This is the number if bytes left in the transfer.
Definition qspi.h:192
OS_SEM * QSPI_Sem
This is a pointer to an external semaphore provided by QSPIStart().
Definition qspi.h:194
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:190