NetBurner 3.5.6
PDF Version |
SPI Peripheral Module Class. More...
#include <dspi.h>
Inherited by SPI_QSPI, and SPI_USART.
Public Member Functions | |
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 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) |
Initialize an existing SPI object. | |
virtual uint32_t | SetBusSpeed (uint32_t maxSpeed) |
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) |
Start a SPI transfer. | |
virtual uint8_t | Tx (uint8_t *transmitBufferPtr, uint32_t byteCount, int csReturnToInactive=DEASSERT_AFTER_LAST) |
Convenience function for unidirectional transmit. | |
virtual uint8_t | Rx (uint8_t *receiveBufferPtr, uint32_t byteCount, int csReturnToInactive=DEASSERT_AFTER_LAST) |
Convenience function for unidirectional receive. | |
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. | |
virtual bool | SetCS (uint8_t CS) |
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) | |
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, 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) |
Initialize an existing SPI object. | |
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 uint32_t | SetBusSpeed (uint32_t maxSpeed) |
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) |
Start a SPI transfer. | |
virtual uint8_t | Tx (uint8_t *transmitBufferPtr, uint32_t byteCount, int csReturnToInactive=DEASSERT_AFTER_LAST) |
Convenience function for unidirectional transmit. | |
virtual uint8_t | Rx (uint8_t *receiveBufferPtr, uint32_t byteCount, int csReturnToInactive=DEASSERT_AFTER_LAST) |
Convenience function for unidirectional receive. | |
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. | |
virtual bool | SetCS (uint8_t CS) |
Set the chip select configuration for the SPI object's bus transactions. | |
Static Public Member Functions | |
static BOOL | Done (uint8_t SPIModule) |
Static function to check SPI status. | |
static BOOL | Done (uint8_t SPIModule) |
Static function to check SPI status. | |
SPI Peripheral Module Class.
Class definition for SPI module objects
SPIModule::SPIModule | ( | uint8_t | SPIModule | ) |
SPIModule::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.
Creaets a SPI object and initializes the SPI module. You do not need to call the Init() member function.
SPIModule | SPI module number (0 or 1) |
baudRateInBps | Maximum baud rate requested |
transferSizeInBits | Number of bits per transfer: 8, 16 or 32 |
peripheralChipSelects | SPI chip selects to use for transfer spiChipSelect |
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) |
delayAfterTransfer | Chip select mode dspiChipSelectMode |
delayBetweenTransfer | Min Delay between transfers |
SPIModule::SPIModule | ( | uint8_t | SPIModule | ) |
SPIModule::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.
Creaets a SPI object and initializes the SPI module. You do not need to call the Init() member function.
SPIModule | SPI module number (0 or 1) |
baudRateInBps | Maximum baud rate requested |
transferSizeInBits | Number of bits per transfer: 8, 16 or 32 |
peripheralChipSelects | SPI chip selects to use for transfer spiChipSelect |
chipSelectPolarity | Parameter not supported on the SOMRT1061. 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) |
delayAfterTransfer | Chip select mode dspiChipSelectMode |
SPIModule::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.
Creaets a SPI object and initializes the SPI module. You do not need to call the Init() member function.
SPIModule | SPI module number (0 or 1) |
baudRateInBps | Maximum baud rate requested |
transferSizeInBits | Number of bits per transfer: 8, 16 or 32 |
gpioChipSelect | PinIO to be configured as GPIO and used as chip select. Only supports spiDriverStruct::csReturnToInactive values of DEASSERT_AFTER_LAST and DEASSERT_NEVER |
chipSelectPolarity | Parameter not supported on the SOMRT1061. 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) |
delayAfterTransfer | Chip select mode dspiChipSelectMode |
|
inlinevirtual |
Clear a semaphore registration.
|
inlinevirtual |
Clear a semaphore registration.
|
inlinevirtual |
Function to check SPI status.
Called as a class method on a specific SPI object. For example: MySpi.Done()
|
inlinevirtual |
Function to check SPI status.
Called as a class method on a specific SPI object. For example: MySpi.Done()
|
static |
Static function to check SPI status.
Is called as a class wide static method. For example: SPIModule::Done(0)
SPIModule | The SPI module to check, 0, 1 or 2 |
|
static |
Static function to check SPI status.
Is called as a class wide static method. For example: SPIModule::Done(0)
SPIModule | The SPI module to check, 0, 1 or 2 |
|
inlinevirtual |
Returns the active baud rate.
The baud rate will be set to the value specified when the SPI module is initialized. If that value is not possible, the next lowest baud rate will be chosen.
|
inlinevirtual |
Returns the active baud rate.
The baud rate will be set to the value specified when the SPI module is initialized. If that value is not possible, the next lowest baud rate will be chosen.
|
inlinevirtual |
Obtain a pointer to the SPI finished semaphore.
|
inlinevirtual |
Obtain a pointer to the SPI finished semaphore.
|
virtual |
Initialize an existing SPI object.
baudRateInBps | Maximum baud rate requested |
transferSizeInBits | Number of bits per transfer: 8, 16 or 32 |
gpioChipSelect | PinIO to be configured as GPIO and used as chip select. Only supports spiDriverStruct::csReturnToInactive values of DEASSERT_AFTER_LAST and DEASSERT_NEVER |
chipSelectPolarity | Parameter not supported on the SOMRT1061. 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) |
delayAfterTransfer | Chip select mode dspiChipSelectMode |
|
virtual |
Initialize an existing SPI object.
baudRateInBps | Maximum baud rate requested |
transferSizeInBits | Number of bits per transfer: 8, 16 or 32 |
peripheralChipSelects | SPI chip selects to use for transfer spiChipSelect |
chipSelectPolarity | Parameter not supported on the SOMRT1061. 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) |
delayAfterTransfer | Chip select mode dspiChipSelectMode |
|
virtual |
Initialize an existing SPI object.
baudRateInBps | Maximum baud rate requested |
transferSizeInBits | Number of bits per transfer: 8, 16 or 32 |
peripheralChipSelects | SPI chip selects to use for transfer spiChipSelect |
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) |
delayAfterTransfer | Chip select mode dspiChipSelectMode |
|
virtual |
Register a semaphore for the SPI module.
The SPI module will post to this semaphore when a transaction is complete
finishedSem | Pointer to the semaphore |
|
virtual |
Register a semaphore for the SPI module.
The SPI module will post to this semaphore when a transaction is complete
finishedSem | Pointer to the semaphore |
|
inlinevirtual |
|
inlinevirtual |
|
virtual |
|
virtual |
|
inlinevirtual |
|
inlinevirtual |
|
virtual |
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 |
|
virtual |
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 |
|
inlinevirtual |
|
inlinevirtual |