some tweaks to make callback usage more easy

This commit is contained in:
2021-05-25 12:14:22 +02:00
parent 73a427d7e0
commit bf8f3db41c
2 changed files with 17 additions and 3 deletions
+11 -1
View File
@@ -344,7 +344,13 @@ ReturnValue_t SpiComIF::readReceivedMessage(CookieIF *cookie, uint8_t **buffer,
return HasReturnvaluesIF::RETURN_OK;
}
MutexIF* SpiComIF::getMutex() {
MutexIF* SpiComIF::getMutex(MutexIF::TimeoutType* timeoutType, uint32_t* timeoutMs) {
if(timeoutType != nullptr) {
*timeoutType = this->timeoutType;
}
if(timeoutMs != nullptr) {
*timeoutMs = this->timeoutMs;
}
return spiMutex;
}
@@ -362,6 +368,10 @@ ReturnValue_t SpiComIF::getReadBuffer(address_t spiAddress, uint8_t** buffer) {
return HasReturnvaluesIF::RETURN_OK;
}
GpioIF* SpiComIF::getGpioInterface() {
return gpioComIF;
}
void SpiComIF::setSpiSpeedAndMode(int spiFd, spi::SpiModes mode, uint32_t speed) {
int retval = ioctl(spiFd, SPI_IOC_WR_MODE, reinterpret_cast<uint8_t*>(&mode));
if(retval != 0) {