mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-08-06 08:02:26 +02:00
fixed spi read and write (#1499)
Build and Deploy on local RHEL9 / build (push) Successful in 2m1s
Build on RHEL9 docker image / build (push) Successful in 4m10s
Build and Deploy on local RHEL8 / build (push) Successful in 5m9s
Build on RHEL8 docker image / build (push) Successful in 5m11s
Run Simulator Tests on local RHEL9 / build (push) Successful in 20m12s
Run Simulator Tests on local RHEL8 / build (push) Failing after 9m47s
Build and Deploy on local RHEL9 / build (push) Successful in 2m1s
Build on RHEL9 docker image / build (push) Successful in 4m10s
Build and Deploy on local RHEL8 / build (push) Successful in 5m9s
Build on RHEL8 docker image / build (push) Successful in 5m11s
Run Simulator Tests on local RHEL9 / build (push) Successful in 20m12s
Run Simulator Tests on local RHEL8 / build (push) Failing after 9m47s
* fixed spi read and write * use c array to send chip id etc
This commit is contained in:
@@ -4020,16 +4020,21 @@ void Module::simulatingActivityinDetector(const std::string &functionType,
|
||||
|
||||
std::vector<uint8_t> Module::readSpi(int chip_id, int register_id,
|
||||
int n_bytes) const {
|
||||
auto client = createDetectorSocket();
|
||||
int args[] = {chip_id, register_id, n_bytes};
|
||||
return sendToDetector<std::vector<uint8_t>>(F_SPI_READ, args);
|
||||
client.sendCommand(F_SPI_READ, &args, sizeof(args));
|
||||
|
||||
std::vector<uint8_t> retval(n_bytes);
|
||||
client.readReply(retval.data(), retval.size());
|
||||
return retval;
|
||||
}
|
||||
|
||||
std::vector<uint8_t> Module::writeSpi(int chip_id, int register_id,
|
||||
const std::vector<uint8_t> &data) {
|
||||
int count = static_cast<int>(data.size());
|
||||
int args[] = {chip_id, register_id, count};
|
||||
auto client = createDetectorSocket();
|
||||
client.sendCommand(F_SPI_WRITE, args, sizeof(args));
|
||||
int args[] = {chip_id, register_id, count};
|
||||
client.sendCommand(F_SPI_WRITE, &args, sizeof(args));
|
||||
client.Send(data);
|
||||
// Read the output from the SPI write. This contains the data before the
|
||||
// write
|
||||
|
||||
Reference in New Issue
Block a user