NetBurner 3.5.6
PDF Version |
The Single-Bit SPI mode QSPI Peripheral Class. More...
#include <quadspi.h>
Inherits SPIModule.
Public Member Functions | |
SPI_QSPI (uint8_t QuadSPIModule=DEFAULT_QUADSPI_MODULE) | |
Create a SPI object. | |
SPI_QSPI (uint8_t QuadSPIModule, uint32_t baudRateInBps, uint8_t transferSizeInBits=8, uint8_t peripheralChipSelects=0x00, uint8_t chipSelectPolarity=0x0F, uint8_t clockPolarity=0, uint8_t clockPhase=1, BOOL doutHiz=TRUE, uint8_t csToClockDelay=0, uint8_t delayAfterTransfer=0) | |
Create a SPI object and Initialize with parameters. | |
virtual uint8_t | Init (uint32_t baudRateInBps=2000000, uint8_t transferSizeInBits=8, uint8_t peripheralChipSelects=0x00, uint8_t chipSelectPolarity=0x0F, uint8_t clockPolarity=0, uint8_t clockPhase=1, BOOL doutHiz=TRUE, uint8_t csToClockDelay=0, uint8_t delayAfterTransfer=0) override |
Initialize an existing SPI object. | |
virtual uint32_t | SetBusSpeed (uint32_t maxSpeed) override |
Set the SPI bus speed Will attempt to set the desired bus speed. It may be different based on the available system characteristics. | |
virtual uint8_t | Start (uint8_t *transmitBufferPtr, volatile uint8_t *receiveBufferPtr, uint32_t byteCount, int csReturnToInactive=DEASSERT_AFTER_LAST) override |
Start a SPI transfer. | |
virtual uint8_t | Tx (uint8_t *transmitBufferPtr, uint32_t byteCount, int csReturnToInactive=DEASSERT_AFTER_LAST) override |
Convenience function for unidirectional transmit. | |
uint8_t | Rx (uint8_t *receiveBufferPtr, uint32_t byteCount, int csReturnToInactive=DEASSERT_AFTER_LAST) |
Convenience function for unidirectional receive. | |
virtual bool | SetCS (uint8_t CS) override |
Set the chip select configuration for the SPI object's bus transactions. | |
![]() | |
SPIModule (uint8_t SPIModule) | |
Create a SPI object. | |
SPIModule (uint8_t SPIModule, uint32_t baudRateInBps, uint8_t transferSizeInBits=8, uint8_t peripheralChipSelects=0x00, uint8_t chipSelectPolarity=0x0F, uint8_t clockPolarity=0, uint8_t clockPhase=1, BOOL doutHiz=TRUE, uint8_t csToClockDelay=0, uint8_t delayAfterTransfer=0, uint8_t delayBetweenTransfer=0) | |
Create a SPI object and Initialize with parameters. | |
virtual bool | RegisterSem (OS_SEM *finishedSem) |
Register a semaphore for the SPI module. | |
virtual bool | ClrSem () |
Clear a semaphore registration. | |
virtual OS_SEM * | GetSem () |
Obtain a pointer to the SPI finished semaphore. | |
virtual bool | Done () |
Function to check SPI status. | |
virtual uint32_t | GetActualBaudrate () |
Returns the active baud rate. | |
SPIModule (uint8_t SPIModule) | |
Create a SPI object. | |
SPIModule (uint8_t SPIModule, uint32_t baudRateInBps, uint8_t transferSizeInBits=8, uint8_t peripheralChipSelects=0x00, uint8_t chipSelectPolarity=0x0F, uint8_t clockPolarity=0, uint8_t clockPhase=1, BOOL doutHiz=TRUE, uint8_t csToClockDelay=0, uint8_t delayAfterTransfer=0) | |
Create a SPI object and Initialize with parameters. | |
SPIModule (uint8_t SPIModule, uint32_t baudRateInBps, uint8_t transferSizeInBits=8, PinIO gpioChipSelect=PinDef_INVALID, uint8_t chipSelectPolarity=0x0F, uint8_t clockPolarity=0, uint8_t clockPhase=1, BOOL doutHiz=TRUE, uint8_t csToClockDelay=0, uint8_t delayAfterTransfer=0) | |
Create a SPI object and Initialize with parameters. | |
virtual uint8_t | Init (uint32_t baudRateInBps=2000000, uint8_t transferSizeInBits=8, PinIO gpioChipSelect=PinDef_INVALID, uint8_t chipSelectPolarity=0x0F, uint8_t clockPolarity=0, uint8_t clockPhase=1, BOOL doutHiz=TRUE, uint8_t csToClockDelay=0, uint8_t delayAfterTransfer=0) |
Initialize an existing SPI object. | |
virtual bool | RegisterSem (OS_SEM *finishedSem) |
Register a semaphore for the SPI module. | |
virtual bool | ClrSem () |
Clear a semaphore registration. | |
virtual OS_SEM * | GetSem () |
Obtain a pointer to the SPI finished semaphore. | |
virtual bool | Done () |
Function to check SPI status. | |
virtual uint32_t | GetActualBaudrate () |
Returns the active baud rate. | |
Additional Inherited Members | |
![]() | |
static BOOL | Done (uint8_t SPIModule) |
Static function to check SPI status. | |
static BOOL | Done (uint8_t SPIModule) |
Static function to check SPI status. | |
The Single-Bit SPI mode QSPI Peripheral Class.
Class definition for SPI module objects
SPI_QSPI::SPI_QSPI | ( | uint8_t | QuadSPIModule = DEFAULT_QUADSPI_MODULE | ) |
Create a SPI object.
This constructor will create the object, but will not initialize the SPI module. You must call the Init() member function to initialize.
QuadSPIModule | QSPI module number (0). The SAME70 only has one QuadSPI module. |
SPI_QSPI::SPI_QSPI | ( | uint8_t | QuadSPIModule, |
uint32_t | baudRateInBps, | ||
uint8_t | transferSizeInBits = 8, | ||
uint8_t | peripheralChipSelects = 0x00, | ||
uint8_t | chipSelectPolarity = 0x0F, | ||
uint8_t | clockPolarity = 0, | ||
uint8_t | clockPhase = 1, | ||
BOOL | doutHiz = TRUE, | ||
uint8_t | csToClockDelay = 0, | ||
uint8_t | delayAfterTransfer = 0 ) |
Create a SPI object and Initialize with parameters.
Creates a SPI object and initializes the SPI module. You do not need to call the Init() member function.
QuadSPIModule | QSPI module number (0). The SAME70 has only one QuadSPI module |
baudRateInBps | Maximum baud rate requested |
transferSizeInBits | Number of bits per transfer: 8-bit up to 16-bit transfer sizes are valid |
peripheralChipSelects | SPI chip selects to use for transfer. Only one chip select is available to the QuadSPI peripheral on pin P2[48]. |
chipSelectPolarity | Parameter not supported on the MODM7AE70. Chip select asserts with logic level low. spiChipSelectPolarity |
clockPolarity | 0 = inactive logic level low, 1 = high |
clockPhase | 0 = data captured leading edge clock, changed following edge. 1 = data changed leading edge clock, captured following edge. |
doutHiz | Data output high impedance between transfers |
csToClockDelay | Delay from chip select to valid clock (default is 0). When 0, the delay is half the clock period. |
delayAfterTransfer | When 0, no delay between consecutive transfers is inserted and the clock keeps its duty cycle over the character transfers. |
|
overridevirtual |
Initialize an existing SPI object.
baudRateInBps | Maximum baud rate requested |
transferSizeInBits | Number of bits per transfer: 8-bit up to 16-bit transfer sizes are valid |
peripheralChipSelects | SPI chip selects to use for transfer. Only one chip select is available to the QuadSPI peripheral on pin P2[48]. |
chipSelectPolarity | Parameter not supported on the MODM7AE70. Chip select asserts with logic level low. spiChipSelectPolarity |
clockPolarity | 0 = inactive logic level low, 1 = high |
clockPhase | 0 = data captured leading edge clock, changed following edge. 1 = data changed leading edge clock, captured following edge. |
doutHiz | Data output high impedance between transfers |
csToClockDelay | Delay from chip select to valid clock (default is 0). When 0, the delay is half the clock period. |
delayAfterTransfer | When 0, no delay between consecutive transfers is inserted and the clock keeps its duty cycle over the character transfers. |
Reimplemented from SPIModule.
|
inlinevirtual |
|
overridevirtual |
Set the SPI bus speed Will attempt to set the desired bus speed. It may be different based on the available system characteristics.
maxSpeed | The maximum desired bus speed |
Reimplemented from SPIModule.
|
inlineoverridevirtual |
Set the chip select configuration for the SPI object's bus transactions.
Single-bit SPI mode for the QuadSPI peripheral only supports one chip select. This function is defined for compatibility between SPI drivers.
CS | The QuadSPI module has only one chip select. |
Reimplemented from SPIModule.
|
overridevirtual |
Start a SPI transfer.
transmitBufferPtr | Pointer to the buffer containing the data to transmit |
receiveBufferPtr | Pointer to the buffer to store the received data |
byteCount | Number of bytes to transmit |
csReturnToInactive | Chip select state dspiChipSelectMode |
Reimplemented from SPIModule.
|
inlineoverridevirtual |