|
RMM API 2.0.0
|
Base class for controlling and monitoring the RMM system. More...
#include <RMMApi.h>

Public Types | |
| enum class | LEMOImpedance : uint8_t { IMP_100K_OHM , IMP_50_OHM } |
| Enum class representing the possible impedance values for LEMO connectors. More... | |
| enum class | LogTopic : uint8_t { ALL , RMM_API , REGISTER_ACCESS , CLOCK , OUTPUT_QUEUES , RAILS , RINGS , UDP_CORE , SIDE_CHANNELS } |
| Enum class representing the possible logging topics in the RMM. More... | |
Public Member Functions | |
| RMMAPI (const std::string &serverIP, int serverPort, const char *configFile) | |
| Constructs an RMMAPI object and initializes the system. | |
| RMMRegisterAccess & | getRMMRegAccess () |
| Provides access to the RMM register interface. | |
| Topology & | getTopology () |
| Provides access to the topology structure. | |
| void | loadConfig (const std::string &cfgJsonPath) |
| Loads the RMM configuration from a JSON file. | |
| rmmStatus | fillDetectorConfigFromJson (json &detectorConfig) |
| Fills the detector configuration from a JSON object. | |
| double | getTemperature () |
| Gets the temperature of the RMM FPGA. | |
| rmmStatus | enablePowerMonitoring (int interval_ms) |
| Enables the internal state machine to start reading out the Voltage, Current, and Power of various power rails on the VCU118. | |
| rmmStatus | disablePowerMonitoring () |
| Disables the internal state machine that reads out the power rail information. | |
| rmmStatus | tearDownAllRings () |
| Teardown all possible rings. | |
| rmmStatus | tearDownRing (int ring, bool waitTime) |
| Teardown a specific ring of the RMM. | |
| rmmStatus | setupAllClocks (TimingMode timingMode) |
| Setup all clocks and the timing system. | |
| rmmStatus | configUDPCore () |
| Configure the UDP Core with the configuration storaged into udpCore struct. | |
| rmmStatus | bringUpAllRings () |
| Initializes and configures all active rings. | |
| rmmStatus | bringUpAllRingsInSequence () |
| Initializes and configures all active rings, one by one. | |
| rmmStatus | checkRings () |
| Perform a slow control read from all FEs in the topology to confirm the ring is active. | |
| rmmStatus | configOutputQueues () |
| Configures the output queues for data processing. | |
| rmmStatus | readyForBulkData () |
| Inform all FEs in the topology that they can start sending bulk data. | |
| rmmStatus | configAllFE () |
| Configures all front-end nodes in the topology. | |
| rmmStatus | getTimingStatus (TimingStatus *time) |
| Get the status of the timestamping system (including the embedded EVR) in the RMM. | |
| rmmStatus | getCurrentTiming (uint32_t *currentTime) |
| Get the current timestamping for RMM. | |
| rmmStatus | getFirmwareInfo (std::unordered_map< std::string, std::string > *info) |
| Gets the firmware information, including FPGA DNA, git hash, and build time. | |
| rmmStatus | getRegBankVersion (RegBankVersion *banks) |
| Gets the register bank version details for the different register banks. | |
| rmmStatus | config (TimingMode timingMode=TimingMode::LCL, BringUpMode=BringUpMode::CONCURRENT, uint32_t eventCode=0x10) |
| Configures the RMM for operation. | |
| rmmStatus | resetPacketCounters () |
| Reset all packet counters back to 0. Useful if the counters start saturating at 0xFFFF_FFFF. | |
| rmmStatus | getPacketCounters (PacketCountMap *packets) |
| Return the updated packet counters.. There are 2 types of counters, one set that counts the per-fibre (odd and even) bulk data packets, and then one set that counts per-node in the output queues. | |
| rmmStatus | arpStatus (const int index, std::unordered_map< std::string, int > *status) |
| Get the ARP status. | |
| rmmStatus | getPowerVoltageCurrent (float voltageTolerancePercent, PowerResultsMap *result) |
| Gets the power, voltage, and current for all INA226 sensors on the VCU118. | |
| rmmStatus | getOutputQueuesData (const int ring, std::shared_ptr< OutputQueueBase > &result) |
| Retrieves the output queue data for a specific ring. | |
| rmmStatus | getUDPCoreData (UDPCoreData *result) |
| Retrieve the UDP core configuration data. | |
| rmmStatus | configSideChannels () |
| Configures all side channels based on stored settings. | |
| rmmStatus | getSideChannelStats (SideChannelStatsData &stats) |
| Retrieves statistics for the side channels. | |
| rmmStatus | getSideChannelPacketCounters (const uint8_t sideChIdx, uint32_t *value) |
| Retrieves the packet counter value for a specific side channel. | |
| rmmStatus | fetchSideChannelData (const uint8_t sideChIdx, SideChannelsData &data) |
| Fetches and populates the data for a specific side channel. | |
| rmmStatus | setLEMOTermination (const uint8_t inLEMOIdx, LEMOImpedance impedance) |
| Sets the termination impedance for a specified LEMO input. Each bit in the gpio_input_term value corresponds to the termination impedance of a LEMO input. Bit 0 -> LEMO IN0, Bit 1 -> LEMO IN1, etc. | |
| rmmStatus | getLEMOTermination (const uint8_t inLEMOIdx, LEMOImpedance &impedance) |
| Retrieves the termination impedance for a specified LEMO input. | |
| rmmStatus | getLogMsg (std::string *msg, LogTopic topic=LogTopic::RMM_API) |
| Retrieves the latest log message for the specified log topic. | |
| void | allLogRelays (std::string logLevel, FILE *out) |
| Relays log output to a specified file for all RMM components. | |
| rmmStatus | setLogMasks (int logMask, LogTopic topic=LogTopic::ALL) |
| Sets the log mask for the specified log topic. | |
| void | setAllLogTimeouts (int milliseconds) |
| Sets the log timeout for all components. | |
| void | setAllFileWriteTimeouts (int milliseconds) |
| Sets the file write timeout for all components. | |
| int | getPollTimeout () |
| Gets the timeout for polling in seconds. | |
| void | setPollTimeout (int value) |
| Sets the timeout for polling in seconds. Timeout starts counting after the polling exceeds initial estimated, not at start of polling. | |
| rmmStatus | setLogFilePathAll (std::string filePath, bool useName=false) |
| Sets the log file path for all components. | |
| rmmStatus | setLogFilePathAll (std::string path, std::string name) |
| Sets the log file path for all components with a custom file name. | |
| rmmStatus | setWriteToFileAll (bool option, char mode='w') |
| Enables or disables writing to log files for all components *. | |
| void | requestStop () |
| Requests to stop ongoing operations in the RMM system. | |
| RMMResult | regRead (const std::string ®Name, RegisterTag tag=RegisterTag::ALL) |
| Reads a register value by its name from the register map. | |
| RMMResult | regRead (uint32_t address) |
| Reads a register value using its address. | |
| RMMResult | regWrite (const std::string ®Name, uint32_t data, RegisterTag tag=RegisterTag::ALL) |
| Writes a value to a named register. | |
| RMMResult | regWrite (uint32_t address, uint32_t data) |
| Performs a write operation to a register using its address. | |
| RMMResult | fieldRead (const std::string ®, RegisterTag tag, int bitBegin, int bitWidth) |
| Reads a field from a register in the RMM space using a register name. | |
| RMMResult | fieldRead (uint32_t reg, int bitBegin, int bitWidth) |
| RMMResult | fieldWrite (const std::string ®, RegisterTag tag, int bitBegin, int bitWidth, uint32_t data) |
| Writes a field to a register in the RMM space using a register name. | |
| RMMResult | fieldWrite (uint32_t reg, int bitBegin, int bitWidth, uint32_t data) |
| Writes a field to a register in the RMM space using a register address. | |
| bool | isLegacyFW () |
| Checks if the FW version is legagy (Non UDP Core version). | |
| const std::vector< DetectorConfig > & | getDetectorConfigs () const |
| Retrieves the list of detector configurations. | |
Public Attributes | |
| RMMLog | rmmLog |
| Log handler for RMM API messages. | |
| json | jsonConfigData |
| Stores the JSON configuration data. | |
Base class for controlling and monitoring the RMM system.
The RMMAPI class serves as the primary interface for interacting with various RMM components. It acts as a wrapper for the underlying component classes, providing a unified API for system control, monitoring, and configuration
|
strong |
Enum class representing the possible impedance values for LEMO connectors.
IMP_100K_OHM: Represents 100K Ohm impedance [High impedance].IMP_50_OHM: Represents 50 Ohm impedance.
|
strong |
Enum class representing the possible logging topics in the RMM.
ALL: Retrieves all log messages.RMM_API: Logs related to the RMM API.REGISTER_ACCESS: Logs related to register access operations.CLOCK: Logs related to clock configuration and management.OUTPUT_QUEUES: Logs related to output queue operations.RAILS: Logs related to power rails.RINGS: Logs related to the RMM ring management.UDP_CORE: Logs related to the UDP core module.SIDE_CHANNELS: Logs related to side-channel communications. | RMMAPI::RMMAPI | ( | const std::string & | serverIP, |
| int | serverPort, | ||
| const char * | configFile ) |
Constructs an RMMAPI object and initializes the system.
This constructor initializes the RMMAPI class by setting up logging, establishing register access, and configuring various system components. It also loads the configuration from the provided JSON file.
| [in] | serverIP | The IP address of the RMM. |
| [in] | serverPort | The port number of the RMM. |
| [in] | configFile | Path to the configuration file. |
| void RMMAPI::allLogRelays | ( | std::string | logLevel, |
| FILE * | out ) |
Relays log output to a specified file for all RMM components.
This method configures logging redirection for multiple subsystems, setting the log output file for the specified log level.
| [in] | logLevel | The log level to be redirected. Valid values are: "debug", "info", "warn", "error", "critical". |
| [in] | out | The file pointer where the logs should be written. |
| std::invalid_argument | If an invalid log level is provided. |
| rmmStatus RMMAPI::arpStatus | ( | const int | index, |
| std::unordered_map< std::string, int > * | status ) |
Get the ARP status.
| index | The index of the ARP status entry. |
| status | Pointer to std::unordered_map<std::string, int> to be populated with status info. |
| rmmStatus RMMAPI::bringUpAllRings | ( | ) |
Initializes and configures all active rings.
This method performs the setup required to bring up all rings in the system. It first calls commonRingSetup() to apply common configurations, then iterates over all active rings retrieved from the topology and asynchronously executes ringSetup() for each ring.
The setup tasks are executed concurrently using std::async to improve performance, and the method waits for all tasks to complete before returning.
| rmmStatus RMMAPI::bringUpAllRingsInSequence | ( | ) |
Initializes and configures all active rings, one by one.
same as RMMRings::bringUpAllRings, but with sequential execution. Intended to be used by developers who want to troubleshoot problematic ring so that error logs are not flooded by other rings that are working well.
| rmmStatus RMMAPI::checkRings | ( | ) |
Perform a slow control read from all FEs in the topology to confirm the ring is active.
| rmmStatus RMMAPI::config | ( | TimingMode | timingMode = TimingMode::LCL, |
| BringUpMode | bringUpMode = BringUpMode::CONCURRENT, | ||
| uint32_t | eventCode = 0x10 ) |
Configures the RMM for operation.
This method performs a series of initialization and configuration steps to prepare the RMM for operation. The setup includes disabling power monitoring, configuring clocks, bringing up all rings, configuring UDP cores, setting up output queues, and configuring front-end components.
The method executes certain operations asynchronously for efficiency, including tearing down all rings and setting up clocks.
| [in] | timingMode | The timing mode to be used for clock configuration. |
The following TimingMode values are supported:
MRF: Mode for MRF-based timing configuration.LCL: Local mode for internal clock synchronization.EXT: External mode for using external clock sources.If the timingMode is omitted, LCL (Local mode) is selected by default.
| [in] | bringUpMode | The bringup mode to be used for ring configuration. |
The following TimingMode values are supported:
CONCURRENT: Run ring bringup in parallel for all rings on topology.SEQUENCTIAL: Run ring bringup one by one.If the bringUpMode is omitted, CONCURRENT is selected by default.
| [in] | eventCode | The EVR event code to be used on MRF timing configuration. If the eventCode is omitted, 0x10 (event16) is selected by default. |
rmmSuccess upon successful configuration. | rmmStatus RMMAPI::configAllFE | ( | ) |
Configures all front-end nodes in the topology.
This method iterates through all entries in the topology and calls the configFE() method on each front-end instance, thereby configuring all front-end nodes in the system.
The topology is retrieved using the getTopology() method, and each front-end entry is accessed to perform the configuration.
rmmSuccess upon successful configuration of all front-end nodes. | rmmStatus RMMAPI::configOutputQueues | ( | ) |
Configures the output queues for data processing.
This method sets up the output queues by writing appropriate values to hardware registers. It first disables all output queues and packet generators before applying configuration settings. The method then iterates through all available output queues, applying necessary configurations based on the OutputQueueData structure.
| rmmStatus RMMAPI::configSideChannels | ( | ) |
Configures all side channels based on stored settings.
This method disables both side channels before applying configurations to ensure synchronization with the JSON configuration file. It then iterates through all side channels and applies their respective settings.
rmmSuccess on successful configuration, or rmmError if any side channel fails to configure. | rmmStatus RMMAPI::configUDPCore | ( | ) |
Configure the UDP Core with the configuration storaged into udpCore struct.
| rmmStatus RMMAPI::disablePowerMonitoring | ( | ) |
Disables the internal state machine that reads out the power rail information.
| rmmStatus RMMAPI::enablePowerMonitoring | ( | int | interval_ms | ) |
Enables the internal state machine to start reading out the Voltage, Current, and Power of various power rails on the VCU118.
| interval_ms | interval between updates. |
| rmmStatus RMMAPI::fetchSideChannelData | ( | const uint8_t | sideChIdx, |
| SideChannelsData & | data ) |
Fetches and populates the data for a specific side channel.
| [in] | sideChIdx | The index of the side channel to fetch data for (0-based). Valid range is 0 to NUMBER_SIDE_CHANNELS - 1. |
| [out] | data | A reference to a SideChannelsData structure where the fetched data will be stored. |
sideChIdx is out of the valid range or any other error occurs. | RMMResult RMMAPI::fieldRead | ( | const std::string & | reg, |
| RegisterTag | tag, | ||
| int | bitBegin, | ||
| int | bitWidth ) |
Reads a field from a register in the RMM space using a register name.
This method reads a field from the specified register, identified by its name (reg). The requested field is extracted based on the bit index (bitBegin) and the field width (bitWidth).
| [in] | reg | The name of the register to read from. |
| [in] | tag | The tag identifying which address map to use. Valid values for tag are defined in the RMMRegisterAccess::RegisterTag enum class. |
| [in] | bitBegin | The index of the lowest bit in the register that is part of the field. |
| [in] | bitWidth | The width of the field in bits. |
value: The final register value after modification.status: The status of the operation (e.g., rmmSuccess or an error status). | std::invalid_argument | If any of the following conditions are met:
|
| RMMResult RMMAPI::fieldRead | ( | uint32_t | reg, |
| int | bitBegin, | ||
| int | bitWidth ) |
| RMMResult RMMAPI::fieldWrite | ( | const std::string & | reg, |
| RegisterTag | tag, | ||
| int | bitBegin, | ||
| int | bitWidth, | ||
| uint32_t | data ) |
Writes a field to a register in the RMM space using a register name.
| [in] | reg | The name of the register to write to. |
| [in] | tag | The tag identifying which address map to use. Valid values for tag are defined in the RMMRegisterAccess::RegisterTag enum class. |
| [in] | bitBegin | The index of the lowest bit in the register that is part of the field. |
| [in] | bitWidth | The width of the field in bits. |
| [in] | data | The data to write to the field. |
value: The final register value after modification.status: The status of the operation (e.g., rmmSuccess or an error status). | std::invalid_argument | If any of the following conditions are met:
|
| RMMResult RMMAPI::fieldWrite | ( | uint32_t | reg, |
| int | bitBegin, | ||
| int | bitWidth, | ||
| uint32_t | data ) |
Writes a field to a register in the RMM space using a register address.
| [in] | reg | The numerical address of the register to write to. |
| [in] | bitBegin | The index of the lowest bit in the register that is part of the field. |
| [in] | bitWidth | The width of the field in bits. |
| [in] | data | The data to write to the field. |
value: The final register value after modification.status: The status of the operation (e.g., rmmSuccess or an error status). | std::invalid_argument | If any of the following conditions are met:
|
| rmmStatus RMMAPI::fillDetectorConfigFromJson | ( | json & | detectorConfig | ) |
Fills the detector configuration from a JSON object.
This method parses a JSON configuration describing detectors and their associated ring topologies.
The resulting configuration objects are stored in the class member detConfigs.
| [in] | detectorConfig | Reference to a JSON object containing the detector configuration. |
| std::exception | If any error occurs during parsing, it is caught internally and logged via rmmLog, and the method returns rmmError. |
| rmmStatus RMMAPI::getCurrentTiming | ( | uint32_t * | currentTime | ) |
Get the current timestamping for RMM.
| currentTime | pointer to current time. |
|
inline |
Retrieves the list of detector configurations.
| rmmStatus RMMAPI::getFirmwareInfo | ( | std::unordered_map< std::string, std::string > * | info | ) |
Gets the firmware information, including FPGA DNA, git hash, and build time.
| [out] | info | Pointer to a std::unordered_map<std::string, std::string> to store the firmware information. The map will contain:
|
| rmmStatus RMMAPI::getLEMOTermination | ( | const uint8_t | inLEMOIdx, |
| LEMOImpedance & | impedance ) |
Retrieves the termination impedance for a specified LEMO input.
| [in] | inLEMOIdx | The index of the LEMO input to query. Valid values are 0, 1, 2, or 3. |
| [out] | impedance | A reference to a LEMOImpedance enum where the retrieved impedance will be stored. |
rmmSuccess if the termination impedance was successfully retrieved.rmmError if the specified LEMO index is invalid or if the read operation fails. | rmmStatus RMMAPI::getLogMsg | ( | std::string * | msg, |
| LogTopic | topic = LogTopic::RMM_API ) |
Retrieves the latest log message for the specified log topic.
| [out] | msg | A pointer to a string where the log message will be stored. |
| [in] | topic | The log topic to retrieve the message for. Valid topics include are defined on RMMAPI::LogTopic. |
rmmSuccess if the message was successfully retrieved, or rmmError if the topic is invalid. | rmmStatus RMMAPI::getOutputQueuesData | ( | const int | ring, |
| std::shared_ptr< OutputQueueBase > & | result ) |
Retrieves the output queue data for a specific ring.
| [in] | ring | The ring identifier. |
| [out] | result | Pointer to store the output queue data. |
rmmSuccess if the ring is found, rmmError otherwise. | rmmStatus RMMAPI::getPacketCounters | ( | PacketCountMap * | packets | ) |
Return the updated packet counters.. There are 2 types of counters, one set that counts the per-fibre (odd and even) bulk data packets, and then one set that counts per-node in the output queues.
| packets | pointer to packets counters map to be updated. |
| int RMMAPI::getPollTimeout | ( | ) |
Gets the timeout for polling in seconds.
| rmmStatus RMMAPI::getPowerVoltageCurrent | ( | float | voltageTolerancePercent, |
| PowerResultsMap * | result ) |
Gets the power, voltage, and current for all INA226 sensors on the VCU118.
Internal power monitoring must be enabled first using enablePowerMonitoring(interval_ms) to set the internal polling interval.
| voltageTolerancePercent | Percent tolerance of voltage from expected values (default = 1.0). |
| result | Pointer to a PowerResultsMap that will be filled with power, voltage, and current data for all sensors. |
| rmmStatus RMMAPI::getRegBankVersion | ( | RegBankVersion * | banks | ) |
Gets the register bank version details for the different register banks.
| [out] | banks | Pointer to a RegBankVersion structure where the register bank versions will be populated. |
|
inline |
Provides access to the RMM register interface.
This method returns a reference to the RMMRegisterAccess instance, allowing direct interaction with the underlying register access mechanism.
| rmmStatus RMMAPI::getSideChannelPacketCounters | ( | const uint8_t | sideChIdx, |
| uint32_t * | value ) |
Retrieves the packet counter value for a specific side channel.
| [in] | sideChIdx | The side channel index for which the packet counter is requested. Valid indices are 0 and 1. |
| [out] | value | Pointer to a uint32_t variable where the packet counter value will be stored. |
rmmSuccess if the packet counter was successfully retrieved. rmmError if the side channel index is invalid. | rmmStatus RMMAPI::getSideChannelStats | ( | SideChannelStatsData & | stats | ) |
Retrieves statistics for the side channels.
This method reads the frequency and overflow status for each side channel.
| [out] | stats | A reference to a SideChannelStatsData structure where the retrieved statistics will be stored. |
rmmSuccess upon successful retrieval of statistics. | double RMMAPI::getTemperature | ( | ) |
Gets the temperature of the RMM FPGA.
| rmmStatus RMMAPI::getTimingStatus | ( | TimingStatus * | time | ) |
Get the status of the timestamping system (including the embedded EVR) in the RMM.
| time | pointer to struct of timing status registers to be populated. |
|
inline |
| rmmStatus RMMAPI::getUDPCoreData | ( | UDPCoreData * | result | ) |
Retrieve the UDP core configuration data.
This function reads the hardware registers to populate a UDPCoreData structure with the current configuration of the UDP core.
| [out] | result | Pointer to a UDPCoreData structure to store the retrieved data. |
rmmStatus. | bool RMMAPI::isLegacyFW | ( | ) |
Checks if the FW version is legagy (Non UDP Core version).
| void RMMAPI::loadConfig | ( | const std::string & | cfgJsonPath | ) |
Loads the RMM configuration from a JSON file.
Reads the specified JSON configuration file and stores its contents in the jsonConfigData member. If the file does not exist or cannot be opened, an error is logged, and an exception is thrown.
| [in] | cfgJsonPath | Path to the JSON configuration file. |
| std::runtime_error | if the configuration file cannot be opened. |
| rmmStatus RMMAPI::readyForBulkData | ( | ) |
Inform all FEs in the topology that they can start sending bulk data.
| RMMResult RMMAPI::regRead | ( | const std::string & | regName, |
| RegisterTag | tag = RegisterTag::ALL ) |
Reads a register value by its name from the register map.
This method retrieves the address of the specified register using the register map and performs a raw read operation.
| [in] | regName | The name of the register to read from the register map. |
| [in] | tag | (Optional) The tag identifying which address map to use. If not specified, RegisterTag::ALL is assumed, and all maps are searched. Valid values for tag are defined in the RMMRegisterAccess::RegisterTag enum class. |
RMMResult object containing the register value and the status of the operation. If the register is not found, the value is set to 0, and the status indicates an error. | RMMResult RMMAPI::regRead | ( | uint32_t | address | ) |
Reads a register value using its address.
This method formats the given 32-bit address as an 8-character uppercase hexadecimal string and performs a raw read using the RMMRegisterAccess instance.
| address | The 32-bit address of the register to read. |
| RMMResult RMMAPI::regWrite | ( | const std::string & | regName, |
| uint32_t | data, | ||
| RegisterTag | tag = RegisterTag::ALL ) |
Writes a value to a named register.
This method retrieves the address of the specified register using the register map and performs a write operation.
| [in] | regName | The name of the register to write to. |
| [in] | data | The 32-bit value to be written. |
| [in] | tag | (Optional) The tag identifying which address map to use. If not specified, RegisterTag::ALL is assumed, and all maps are searched. Valid values for tag are defined in the RMMRegisterAccess::RegisterTag enum class. |
| RMMResult RMMAPI::regWrite | ( | uint32_t | address, |
| uint32_t | data ) |
Performs a write operation to a register using its address.
This method formats the given 32-bit address as an 8-character uppercase hexadecimal string and performs a raw write using the RMMRegisterAccess instance.
| [in] | address | The 32-bit address of the register to read. |
| [in] | data | The 32-bit value to be written to the register. |
| void RMMAPI::requestStop | ( | ) |
Requests to stop ongoing operations in the RMM system.
This method forwards the stop request to the RMMRegisterAccess instance, setting the stop flag to indicate that operations should be halted.
| rmmStatus RMMAPI::resetPacketCounters | ( | ) |
Reset all packet counters back to 0. Useful if the counters start saturating at 0xFFFF_FFFF.
| void RMMAPI::setAllFileWriteTimeouts | ( | int | milliseconds | ) |
Sets the file write timeout for all components.
| [in] | milliseconds | The timeout value in milliseconds. |
| void RMMAPI::setAllLogTimeouts | ( | int | milliseconds | ) |
Sets the log timeout for all components.
| [in] | milliseconds | The timeout value in milliseconds. |
| rmmStatus RMMAPI::setLEMOTermination | ( | const uint8_t | inLEMOIdx, |
| LEMOImpedance | impedance ) |
Sets the termination impedance for a specified LEMO input. Each bit in the gpio_input_term value corresponds to the termination impedance of a LEMO input. Bit 0 -> LEMO IN0, Bit 1 -> LEMO IN1, etc.
| inLEMOIdx | The index of the LEMO input to configure. Valid values are 0, 1, 2, or 3. |
| impedance | The desired termination impedance, represented as a LEMOImpedance enum. |
rmmOK if the termination impedance was successfully set.rmmError if the specified LEMO index is invalid or if the write operation fails. | rmmStatus RMMAPI::setLogFilePathAll | ( | std::string | filePath, |
| bool | useName = false ) |
Sets the log file path for all components.
This method sets the log file path for all components by calling the setLogFilePath method on each component's rmmLog object. Refer to RMMLog::setLogFilePath for details on how the file path is set.
| [in] | filePath | The directory path where the log file will be stored. |
| [in] | useName | A flag indicating whether to use the default component name for the log file. |
rmmSuccess if the log file path is successfully set for all components, or rmmError if any component fails to set the path. | rmmStatus RMMAPI::setLogFilePathAll | ( | std::string | path, |
| std::string | name ) |
Sets the log file path for all components with a custom file name.
This method sets the log file path for all components by calling the setLogFilePath method on each component's rmmLog object. The log file name is specified by the name parameter. Refer to RMMLog::setLogFilePath for more details.
| [in] | path | The directory path where the log file will be stored. |
| [in] | name | The custom name for the log file. This name will be used for all components. |
rmmSuccess if the log file path is successfully set for all components, or rmmError if any component fails to set the path. | rmmStatus RMMAPI::setLogMasks | ( | int | logMask, |
| LogTopic | topic = LogTopic::ALL ) |
Sets the log mask for the specified log topic.
This method allows the user to set the log mask for different log topics. The log mask determines which types of log messages are captured.
| [in] | logMask | The log mask to be set (should be between 0 and 31). |
| [in] | topic | The log topic for which the log mask should be set. This can be one of the values from the RMMAPI::LogTopic enum class. The default value is LogTopic::ALL. |
rmmSuccess if the log mask is successfully set, or rmmError if the log topic is invalid or the log mask is out of the valid range. | void RMMAPI::setPollTimeout | ( | int | value | ) |
Sets the timeout for polling in seconds. Timeout starts counting after the polling exceeds initial estimated, not at start of polling.
| [in] | value | value in seconds to set timeout. |
| rmmStatus RMMAPI::setupAllClocks | ( | TimingMode | timingMode | ) |
Setup all clocks and the timing system.
| [in] | timingMode | The timing mode to be used for clock configuration. |
The following TimingMode values are supported:
MRF: Mode for MRF-based timing configuration.LCL: Local mode for internal clock synchronization.EXT: External mode for using external clock sources.rmmSuccess if all configurations are completed successfully. Otherwise, returns an appropriate error status if any clock configuration step fails. | rmmStatus RMMAPI::setWriteToFileAll | ( | bool | option, |
| char | mode = 'w' ) |
Enables or disables writing to log files for all components *.
This method retrieves the latest log message for a specific log topic and stores it in the provided string pointer. It checks the topic argument and calls the getMsg method of the corresponding log object.
If the topic is invalid, the method will set the message to "Unable to getMsg: Invalid Topic" and return an error..
This method enables or disables writing logs to files for all components by calling the setWriteToFile method on each component's rmmLog object. Refer to RMMLog::setWriteToFile for more details.
| [in] | option | A boolean flag that enables (true) or disables (false) writing to the log file. |
| [in] | mode | The write mode for the log file: 'w' for creating a new file, 'a' for appending to an existing file. |
rmmSuccess if the write-to-file option is successfully set for all components, or rmmError if any component fails to set the option. | rmmStatus RMMAPI::tearDownAllRings | ( | ) |
Teardown all possible rings.
| rmmStatus RMMAPI::tearDownRing | ( | int | ring, |
| bool | waitTime ) |
Teardown a specific ring of the RMM.
| ring | The index of the ring to tear down. |
| waitTime | If true, the function waits for the full teardown timeout. |
| json RMMAPI::jsonConfigData |
Stores the JSON configuration data.
The data is parsed and managed using the nlohmann::json library for seamless JSON handling.