continued spi com if
This commit is contained in:
@ -13,6 +13,8 @@
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
class SpiCookie;
|
||||
|
||||
class SpiComIF:
|
||||
public SystemObject,
|
||||
public DeviceCommunicationIF {
|
||||
@ -36,6 +38,8 @@ public:
|
||||
*/
|
||||
void configureCacheMaintenanceOnTxBuffer(bool enable);
|
||||
|
||||
void setDefaultPollingTimeout(dur_millis_t timeout);
|
||||
|
||||
/**
|
||||
* Add the DMA handles. These need to be set in the DMA transfer mode is used
|
||||
* @param txHandle
|
||||
@ -60,16 +64,25 @@ private:
|
||||
struct SpiInstance {
|
||||
std::vector<uint8_t> replyBuffer;
|
||||
};
|
||||
uint32_t defaultPollingTimeout = 50;
|
||||
|
||||
spi::TransferModes transferMode;
|
||||
SPI_HandleTypeDef* spiHandle;
|
||||
SemaphoreIF* spiSemaphore;
|
||||
|
||||
MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING;
|
||||
dur_millis_t timeoutMs = 20;
|
||||
|
||||
SemaphoreIF* spiSemaphore = nullptr;
|
||||
MutexIF* spiMutex = nullptr;
|
||||
bool cacheMaintenanceOnTxBuffer = true;
|
||||
|
||||
using SpiDeviceMap = std::map<address_t, SpiInstance>;
|
||||
using SpiDeviceMapIter = SpiDeviceMap::iterator;
|
||||
|
||||
SpiDeviceMap spiDeviceMap;
|
||||
|
||||
ReturnValue_t handlePollingSendOperation(SpiDeviceMapIter iter, SpiCookie* spiCookie,
|
||||
const uint8_t * sendData, size_t sendLen);
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user