few commands implemented for the ploc supervisor
This commit is contained in:
@ -30,10 +30,11 @@ namespace RAD_SENSOR {
|
||||
* conversions to perform.
|
||||
* @details Bit0: 1 - Enables temperature conversion
|
||||
* Bit2 (SCAN1) and Bit1 (SCAN0): 0b00 (channel conversion from 0 to N)
|
||||
* Bit6 - Bit3 defines N: 0b0001 (N = 1)
|
||||
* Bit6 - Bit3 defines N: 0b0111 (N = 7)
|
||||
* Bit7: Always 1. Tells the ADC that this is the conversion register.
|
||||
*/
|
||||
static const uint8_t CONVERSION_DEFINITION = 0b10001001;
|
||||
static const uint8_t CONVERSION_DEFINITION = 0b10111001;
|
||||
// static const uint8_t CONVERSION_DEFINITION = 0b10111111;
|
||||
|
||||
/**
|
||||
* @brief Writing this value resets the fifo of the MAX1227.
|
||||
@ -44,18 +45,23 @@ namespace RAD_SENSOR {
|
||||
|
||||
static const uint8_t RAD_SENSOR_DATA_SET_ID = READ_CONVERSIONS;
|
||||
|
||||
static const uint8_t DATASET_ENTRIES = 7;
|
||||
/**
|
||||
* One temperature value, conversion of channel 0 and conversion of channel 1
|
||||
* One temperature value and conversions for AIN0 - AIN7
|
||||
*/
|
||||
static const uint8_t READ_SIZE = 6;
|
||||
static const uint8_t READ_SIZE = 18;
|
||||
|
||||
enum Max1227PoolIds: lp_id_t {
|
||||
TEMPERATURE_C,
|
||||
CHANNEL_0,
|
||||
CHANNEL_1,
|
||||
AIN0,
|
||||
AIN1,
|
||||
AIN4,
|
||||
AIN5,
|
||||
AIN6,
|
||||
AIN7,
|
||||
};
|
||||
|
||||
class RadSensorDataset: public StaticLocalDataSet<sizeof(float)> {
|
||||
class RadSensorDataset: public StaticLocalDataSet<DATASET_ENTRIES> {
|
||||
public:
|
||||
|
||||
RadSensorDataset(HasLocalDataPoolIF* owner) :
|
||||
@ -67,8 +73,12 @@ public:
|
||||
}
|
||||
|
||||
lp_var_t<float> temperatureCelcius = lp_var_t<float>(sid.objectId, TEMPERATURE_C, this);
|
||||
lp_var_t<uint16_t> channel0 = lp_var_t<uint16_t>(sid.objectId, CHANNEL_0, this);
|
||||
lp_var_t<uint16_t> channel1 = lp_var_t<uint16_t>(sid.objectId, CHANNEL_1, this);
|
||||
lp_var_t<uint16_t> ain0 = lp_var_t<uint16_t>(sid.objectId, AIN0, this);
|
||||
lp_var_t<uint16_t> ain1 = lp_var_t<uint16_t>(sid.objectId, AIN1, this);
|
||||
lp_var_t<uint16_t> ain4 = lp_var_t<uint16_t>(sid.objectId, AIN4, this);
|
||||
lp_var_t<uint16_t> ain5 = lp_var_t<uint16_t>(sid.objectId, AIN5, this);
|
||||
lp_var_t<uint16_t> ain6 = lp_var_t<uint16_t>(sid.objectId, AIN6, this);
|
||||
lp_var_t<uint16_t> ain7 = lp_var_t<uint16_t>(sid.objectId, AIN7, this);
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user