Expand description
Defines data structures, constants, and protocol logic for interacting with an 8-Channel temperature module using the Modbus RTU protocol, based on the protocol specification document.
Assumes standard Modbus function codes “Read Holding Registers” (0x03) and “Write Single Register” (0x06) are used externally to interact with the device.
Structs§
- Address
- Represents a validated Modbus device address, used for RTU communication over RS485.
- Automatic
Report - Represents the automatic temperature reporting interval in seconds. A value of 0 disables automatic reporting (query mode). Values 1-255 set the reporting interval in seconds.
- Channel
- Represents a validated temperature channel index, guaranteed to be within the valid range
0..NUMBER_OF_CHANNELS. - Error
Address OutOf Range - Error indicating that a provided Modbus device address (
u8) is outside the valid range for assignable addresses, defined byAddress::MINandAddress::MAX(inclusive). - Error
Channel OutOf Range - Error indicating that the channel value is out of range.
- Error
Degree Celsius OutOf Range - Error indicating that the degree Celsius value is out of range.
- Error
Duration OutOf Range - Error indicating that a
Durationcannot be represented as anAutomaticReportinterval (0-255 seconds). - Error
Invalid Baud Rate - Error returned when attempting to create a
BaudRatefrom an unsupportedu16value. - Factory
Reset - Represents the factory reset command. This is a write-only operation.
- Temperature
- Represents a temperature value in degrees Celsius, as read from or written to the R4DCB08.
- Temperature
Correction - Represents the temperature correction values for all 8 channels. Correction values are added to the raw temperature reading. Setting a correction value to 0 disables correction for that channel.
- Temperatures
- Represents the temperature readings for all 8 channels.
Enums§
- Baud
Rate - Enum representing the supported baud rates for RS485 communication.
- Error
- A comprehensive error type for all operations within the
protocolmodule.
Constants§
- NUMBER_
OF_ CHANNELS - Number of temperature channels available in the R4DCB08 module.
Type Aliases§
- Word
- Represents a single 16-bit value stored in a Modbus register.