continued test task
This commit is contained in:
parent
178c3e2540
commit
a47c8d91a0
@ -43,9 +43,13 @@ ReturnValue_t SpiTestClass::performPeriodicAction() {
|
||||
}
|
||||
|
||||
void SpiTestClass::performRm3100Test() {
|
||||
/* Configure all SPI chip selects and pull them high */
|
||||
acsInit();
|
||||
|
||||
/* Adapt accordingly */
|
||||
uint8_t chipSelectPin = mgm1Rm3100ChipSelect;
|
||||
uint32_t rm3100Speed = 3'900'000;
|
||||
uint8_t rm3100whoAmIReg = 0b0000'1111;
|
||||
int rm3100mode = SPI_MODE_3;
|
||||
#ifdef RASPBERRY_PI
|
||||
std::string deviceName = "spidev0.0";
|
||||
@ -61,11 +65,16 @@ void SpiTestClass::performRm3100Test() {
|
||||
return;
|
||||
}
|
||||
|
||||
int retval = ioctl(fileDescriptor, SPI_IOC_WR_MODE, rm3100Speed);
|
||||
int retval = ioctl(fileDescriptor, SPI_IOC_WR_MODE, rm3100mode);
|
||||
if(retval != 0) {
|
||||
utility::handleIoctlError("SpiTestClass::performRm3100Test: Setting SPI mode failed!");
|
||||
}
|
||||
acsInit();
|
||||
|
||||
retval = ioctl(fileDescriptor, SPI_IOC_WR_MAX_SPEED_HZ, rm3100Speed);
|
||||
if(retval != 0) {
|
||||
utility::handleIoctlError("SpiTestClass::performRm3100Test: Setting SPI speed failed!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void SpiTestClass::acsInit() {
|
||||
|
Loading…
Reference in New Issue
Block a user