Skip to content

Commit

Permalink
reintroduce MPUCommands
Browse files Browse the repository at this point in the history
  • Loading branch information
pkubanek committed Apr 19, 2024
1 parent 8d30a04 commit cc479d3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/version-history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ v1.11.0
to FPGA class.
* Improved documentation.
* Public constants to explain meaning of the numbers
* mpuCommands redesign

v1.10.1
-------
Expand Down
14 changes: 14 additions & 0 deletions include/cRIO/FPGA.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ namespace cRIO {

class MPU;

/**
* Commands for FPGA MPU unit.
*/
enum MPUCommands {
WRITE = 1,
READ_US = 2,
READ_MS = 3,
WAIT_US = 100,
WAIT_MS = 101,
IRQ = 240,
TELEMETRY = 254,
RESET = 255,
};

/**
* Interface class for cRIO FPGA. Subclasses can talk either to the real HW, or
* be a software simulator.
Expand Down
2 changes: 2 additions & 0 deletions src/LSST/cRIO/FPGA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ void FPGA::mpuCommands(MPU &mpu, const std::chrono::duration<double> &timeout) {
std::vector<uint8_t> data;

data.push_back(mpu.getBus());
data.push_back(cmd.buffer.size() + 2);
data.push_back(MPUCommands::WRITE);
data.push_back(cmd.buffer.size());
data.insert(data.end(), cmd.buffer.begin(), cmd.buffer.end());

Expand Down

0 comments on commit cc479d3

Please sign in to comment.