56 lines
1.0 KiB
C++
56 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#define DEBUGLOG_DEFAULT_LOG_LEVEL_INFO
|
|
|
|
#include <DebugLog.h>
|
|
#include <RS485_Driver.h>
|
|
|
|
namespace drivers
|
|
{
|
|
|
|
class R4DCB08
|
|
{
|
|
|
|
public:
|
|
enum tempCh
|
|
{
|
|
T1,
|
|
T2,
|
|
T3,
|
|
T4,
|
|
T5,
|
|
T6,
|
|
T7,
|
|
T8,
|
|
T_MAX
|
|
};
|
|
|
|
private:
|
|
const uint8_t c_maxRetries = 5;
|
|
const uint32_t c_minDelay = 500;
|
|
const uint16_t REG_TEMP = 0x0000;
|
|
const uint16_t REG_TEMPCORR = 0x0008;
|
|
|
|
public:
|
|
R4DCB08(drivers::MODBUS &bus, const uint8_t address);
|
|
~R4DCB08();
|
|
|
|
const float getTemp(const uint8_t ch);
|
|
const std::vector<float> getTempAll();
|
|
|
|
void setCorrection(std::vector<float> corr);
|
|
std::vector<float> getCorrection();
|
|
|
|
const uint8_t getNum();
|
|
|
|
private:
|
|
void delayRequest();
|
|
|
|
private:
|
|
const uint8_t m_address;
|
|
uint8_t m_sensors;
|
|
MODBUS &m_bus;
|
|
uint32_t m_lastRequest;
|
|
};
|
|
}
|