suppressed warning flags
This commit is contained in:
43
bsp_rpi/boardtest/SpiTest.cpp
Normal file
43
bsp_rpi/boardtest/SpiTest.cpp
Normal file
@ -0,0 +1,43 @@
|
||||
#include "SpiTest.h"
|
||||
|
||||
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <wiringPi.h>
|
||||
|
||||
SpiTest::SpiTest(object_id_t objectId): SystemObject(objectId) {
|
||||
wiringPiSetupGpio();
|
||||
|
||||
int spiFd = open(spiDeviceName.c_str(), O_RDWR);
|
||||
if (spiFd < 0){
|
||||
sif::error << "Could not open SPI device!" << std::endl;
|
||||
}
|
||||
|
||||
spiMode = SPI_MODE_3;
|
||||
int ret = ioctl(spiFd, SPI_IOC_WR_MODE, &spiMode);
|
||||
if(ret < 0) {
|
||||
sif::error << "Could not set write mode!" << std::endl;
|
||||
}
|
||||
|
||||
/* Datenrate setzen */
|
||||
ret = ioctl(spiFd, SPI_IOC_WR_MAX_SPEED_HZ, &spiSpeed);
|
||||
if(ret < 0) {
|
||||
sif::error << "Could not SPI speed!" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
ReturnValue_t SpiTest::performOperation(uint8_t opCode) {
|
||||
if(oneShot) {
|
||||
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t SpiTest::initialize() {
|
||||
//transferHandle.rx_buf = reinterpret_cast<__u64>(receiveBuffer);
|
||||
//transferHandle.tx_buf = reinterpret_cast<__u64>(sendBuffer);
|
||||
//transferHandle.speed_hz = 976000;
|
||||
//transferHandle.len = 2;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
Reference in New Issue
Block a user