![]() |
Open FFBoard
Open source force feedback firmware
|
#include <SPI.h>
Public Member Functions | |
SPIPort (SPI_HandleTypeDef &hspi, const std::vector< OutputPin > &csPins, uint32_t baseclk, bool allowReconfigure=true) | |
void | takeSemaphore () |
void | giveSemaphore () |
void | configurePort (SPI_InitTypeDef *config) |
std::vector< OutputPin > & | getCsPins () |
OutputPin * | getCsPin (uint16_t idx) |
std::vector< OutputPin > & | getFreeCsPins () |
bool | reserveCsPin (OutputPin pin) |
bool | freeCsPin (OutputPin pin) |
bool | isPinFree (OutputPin pin) |
void | transmit_DMA (const uint8_t *buf, uint16_t size, SPIDevice *device) |
void | transmitReceive_DMA (const uint8_t *txbuf, uint8_t *rxbuf, uint16_t size, SPIDevice *device) |
void | receive_DMA (uint8_t *buf, uint16_t size, SPIDevice *device) |
void | transmit_IT (const uint8_t *buf, uint16_t size, SPIDevice *device) |
void | transmitReceive_IT (const uint8_t *txbuf, uint8_t *rxbuf, uint16_t size, SPIDevice *device) |
void | receive_IT (uint8_t *buf, uint16_t size, SPIDevice *device) |
void | transmit (const uint8_t *buf, uint16_t size, SPIDevice *device, uint16_t timeout) |
void | receive (uint8_t *buf, uint16_t size, SPIDevice *device, int16_t timeout) |
void | transmitReceive (const uint8_t *txbuf, uint8_t *rxbuf, uint16_t size, SPIDevice *device, uint16_t timeout) |
void | SpiTxCplt (SPI_HandleTypeDef *hspi) override |
void | SpiRxCplt (SPI_HandleTypeDef *hspi) override |
void | SpiTxRxCplt (SPI_HandleTypeDef *hspi) override |
void | SpiError (SPI_HandleTypeDef *hspi) override |
bool | isTaken () |
void | takeExclusive (bool exclusive) |
bool | hasFreePins () |
uint32_t | getBaseClk () |
std::pair< uint32_t, float > | getClosestPrescaler (float clock) |
SPI_HandleTypeDef * | getPortHandle () |
![]() | |
SpiHandler () | |
virtual | ~SpiHandler () |
virtual void | SpiTxHalfCplt (SPI_HandleTypeDef *hspi) |
virtual void | SpiRxHalfCplt (SPI_HandleTypeDef *hspi) |
virtual void | SpiTxRxHalfCplt (SPI_HandleTypeDef *hspi) |
Private Member Functions | |
void | beginTransfer (SPIConfig *config) |
void | endTransfer (SPIConfig *config) |
Private Attributes | |
SPI_HandleTypeDef & | hspi |
SPIDevice * | current_device = nullptr |
std::vector< OutputPin > | csPins |
std::vector< OutputPin > | freePins |
cpp_freertos::BinarySemaphore | semaphore = cpp_freertos::BinarySemaphore(true) |
bool | allowReconfigure = false |
volatile bool | isTakenFlag = false |
bool | takenExclusive = false |
uint32_t | baseclk |
Additional Inherited Members | |
![]() | |
static std::vector< SpiHandler * > & | getSPIHandlers () |
SPIPort::SPIPort | ( | SPI_HandleTypeDef & | hspi, |
const std::vector< OutputPin > & | csPins, | ||
uint32_t | baseclk, | ||
bool | allowReconfigure = true |
||
) |
|
private |
|
private |
uint32_t SPIPort::getBaseClk | ( | ) |
std::pair< uint32_t, float > SPIPort::getClosestPrescaler | ( | float | clock | ) |
void SPIPort::receive | ( | uint8_t * | buf, |
uint16_t | size, | ||
SPIDevice * | device, | ||
int16_t | timeout | ||
) |
void SPIPort::receive_DMA | ( | uint8_t * | buf, |
uint16_t | size, | ||
SPIDevice * | device | ||
) |
void SPIPort::receive_IT | ( | uint8_t * | buf, |
uint16_t | size, | ||
SPIDevice * | device | ||
) |
|
overridevirtual |
Reimplemented from SpiHandler.
|
overridevirtual |
Reimplemented from SpiHandler.
|
overridevirtual |
Reimplemented from SpiHandler.
|
overridevirtual |
Reimplemented from SpiHandler.
void SPIPort::transmit | ( | const uint8_t * | buf, |
uint16_t | size, | ||
SPIDevice * | device, | ||
uint16_t | timeout | ||
) |
void SPIPort::transmit_DMA | ( | const uint8_t * | buf, |
uint16_t | size, | ||
SPIDevice * | device | ||
) |
void SPIPort::transmit_IT | ( | const uint8_t * | buf, |
uint16_t | size, | ||
SPIDevice * | device | ||
) |
void SPIPort::transmitReceive | ( | const uint8_t * | txbuf, |
uint8_t * | rxbuf, | ||
uint16_t | size, | ||
SPIDevice * | device, | ||
uint16_t | timeout | ||
) |
void SPIPort::transmitReceive_DMA | ( | const uint8_t * | txbuf, |
uint8_t * | rxbuf, | ||
uint16_t | size, | ||
SPIDevice * | device | ||
) |
void SPIPort::transmitReceive_IT | ( | const uint8_t * | txbuf, |
uint8_t * | rxbuf, | ||
uint16_t | size, | ||
SPIDevice * | device | ||
) |
|
private |