started rm3100 testing

This commit is contained in:
2021-03-06 18:12:50 +01:00
parent bf56ac90ad
commit 5f3d2b1516
10 changed files with 172 additions and 74 deletions

View File

@ -1,4 +1,5 @@
#include "SpiComIF.h"
#include <OBSWConfig.h>
#include <linux/utility/Utility.h>
#include <linux/spi/SpiCookie.h>
@ -188,6 +189,18 @@ ReturnValue_t SpiComIF::sendMessage(CookieIF *cookie, const uint8_t *sendData, s
utility::handleIoctlError("SpiComIF::sendMessage: ioctl error.");
result = FULL_DUPLEX_TRANSFER_FAILED;
}
#if FSFW_LINUX_SPI_WIRETAPPING == 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << "Sent SPI data: " << std::endl;
size_t dataLen = spiCookie->getTransferStructHandle()->len;
uint8_t* dataPtr = reinterpret_cast<uint8_t*>(spiCookie->getTransferStructHandle()->tx_buf);
arrayprinter::print(dataPtr, dataLen, OutputType::HEX, false);
sif::info << "Received SPI data: " << std::endl;
dataPtr = reinterpret_cast<uint8_t*>(spiCookie->getTransferStructHandle()->rx_buf);
arrayprinter::print(dataPtr, dataLen, OutputType::HEX, false);
#else
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
#endif /* FSFW_LINUX_SPI_WIRETAPPING == 1 */
}
else {
/* We write with a blocking half-duplex transfer here */

View File

@ -1,9 +1,11 @@
#ifndef LINUX_SPI_SPIDEFINITONS_H_
#define LINUX_SPI_SPIDEFINITONS_H_
#include <cstdint>
namespace spi {
enum SpiMode {
enum SpiMode: uint8_t {
MODE_0,
MODE_1,
MODE_2,