MVMFirmwareCpp v0.1
driver_5525DSO.h
Go to the documentation of this file.
1 // driver_5525DSO.h
2 
3 #ifndef _DRIVER_5525DSO_h
4 #define _DRIVER_5525DSO_h
5 
6 #if defined(ARDUINO) && ARDUINO >= 100
7  #include "arduino.h"
8 #else
9  #include "WProgram.h"
10 #endif
11 #include "DriverContext.h"
12 
13 typedef struct
14 {
15  int32_t C[6];
16  int32_t Q[6];
17  float ZERO;
19 
20 //#define PBUFFER_SIZE 32
21 typedef enum { DS_01, GS_05 } t_ps_sensor;
23 
43  {
44  public:
45 
46 
47  bool Init(t_i2cdevices device, t_ps_sensor model, t_ps_resolution ps_resolution, void* hw_handle);
48  bool doMeasure(float* P, float* T);
49 
50  bool asyncMeasure();
51  bool asyncGetResult(float *P, float *T);
52 
53  void setZero(float value);
54  float doZero();
55  void correctZero(float value);
56  float GetConversionDelay();
57 
58  private:
59 
60 
61 
66 
67  void CalibrateDate_5525DSO(int32_t raw_temp, int32_t raw_pressure, float* T, float* P);
68  bool Reset_5525DSO();
69  uint8_t GetResolutionByteCodeTemp();
71  uint32_t GetResolutionDelay();
72 
73 
74  HW* hwi;
76 
77  uint32_t __chache_P;
78  uint32_t __chache_T;
79  int __TDiv;
82  uint64_t __last_millis;
83  //float PBuffer[PBUFFER_SIZE];
85  bool data_valid;
86 
87  bool _initialized = false;
88  };
89 
90 #endif
91 
92 
93 
94 // # # ###
95 // ## # #
96 // # # # #
97 // # # # #
98 // # # # #
99 // # ## #
100 // # # ###
101 //
102 // Nuclear Instruments 2020 - All rights reserved
103 // Any commercial use of this code is forbidden
104 // Contact info@nuclearinstruments.eu
Sensor5525DSO::data_valid
bool data_valid
Definition: driver_5525DSO.h:85
DriverContext.h
Sensor5525DSO::sensor_resolution
t_ps_resolution sensor_resolution
Definition: driver_5525DSO.h:65
Sensor5525DSO::doMeasure
bool doMeasure(float *P, float *T)
Perform a full measure in blocking mode.
Definition: driver_5525DSO.cpp:107
Sensor5525DSO::__chache_P
uint32_t __chache_P
Definition: driver_5525DSO.h:77
Sensor5525DSO::i2c_device
t_i2cdevices i2c_device
Definition: driver_5525DSO.h:63
Sensor5525DSO::__last_millis
uint64_t __last_millis
Definition: driver_5525DSO.h:82
Sensor5525DSO::Init
bool Init(t_i2cdevices device, t_ps_sensor model, t_ps_resolution ps_resolution, void *hw_handle)
Init pressure sensor TE 5525DSO.
Definition: driver_5525DSO.cpp:24
Sensor5525DSO::correctZero
void correctZero(float value)
Incremental 0 correction for Venturi cycle to cycle adjust.
Definition: driver_5525DSO.cpp:455
arduino.h
Sensor5525DSO::__pending_meas
bool __pending_meas
Definition: driver_5525DSO.h:81
Sensor5525DSO::doZero
float doZero()
Calculate sensor zero.
Definition: driver_5525DSO.cpp:422
Sensor5525DSO::_initialized
bool _initialized
Definition: driver_5525DSO.h:87
Sensor5525DSO::CalibrateDate_5525DSO
void CalibrateDate_5525DSO(int32_t raw_temp, int32_t raw_pressure, float *T, float *P)
Convert row measure in P/V.
Definition: driver_5525DSO.cpp:275
Sensor5525DSO::Reset_5525DSO
bool Reset_5525DSO()
Reset the sensor.
Definition: driver_5525DSO.cpp:390
OVS_512
@ OVS_512
Definition: driver_5525DSO.h:22
OVS_256
@ OVS_256
Definition: driver_5525DSO.h:22
OVS_2048
@ OVS_2048
Definition: driver_5525DSO.h:22
Sensor5525DSO::GetResolutionDelay
uint32_t GetResolutionDelay()
Obtain the conversion time for specified resolution.
Definition: driver_5525DSO.cpp:366
OVS_1024
@ OVS_1024
Definition: driver_5525DSO.h:22
t_5525DSO_calibration_table::ZERO
float ZERO
Definition: driver_5525DSO.h:17
Sensor5525DSO::hwi
HW * hwi
Definition: driver_5525DSO.h:74
Sensor5525DSO::startup_counter
int startup_counter
Definition: driver_5525DSO.h:84
Sensor5525DSO
The class provide support for TE 5525DSO Pressure sensor.
Definition: driver_5525DSO.h:43
t_ps_resolution
t_ps_resolution
Definition: driver_5525DSO.h:22
t_5525DSO_calibration_table
Definition: driver_5525DSO.h:14
Sensor5525DSO::GetConversionDelay
float GetConversionDelay()
Return correction delay.
Definition: driver_5525DSO.cpp:465
Sensor5525DSO::asyncMeasure
bool asyncMeasure()
Start an asynchronous measure process (NON BLOKING)
Definition: driver_5525DSO.cpp:168
DS_01
@ DS_01
Definition: driver_5525DSO.h:21
Sensor5525DSO::__TDiv
int __TDiv
Definition: driver_5525DSO.h:79
HW_V4
Driver for the Nuclear Instruments V4 Hardware Board.
Definition: fw_board_ni_v4.h:23
Sensor5525DSO::sensor_model
t_ps_sensor sensor_model
Definition: driver_5525DSO.h:64
Sensor5525DSO::__chache_T
uint32_t __chache_T
Definition: driver_5525DSO.h:78
t_i2cdevices
t_i2cdevices
Definition: generic_definitions.h:36
Sensor5525DSO::dbg
DebugIfaceClass * dbg
Definition: driver_5525DSO.h:75
t_ps_sensor
t_ps_sensor
Definition: driver_5525DSO.h:21
DebugIfaceClass
Debug class: this class print debug message.
Definition: DebugIface.h:38
OVS_4096
@ OVS_4096
Definition: driver_5525DSO.h:22
GS_05
@ GS_05
Definition: driver_5525DSO.h:21
Sensor5525DSO::GetResolutionByteCodePressure
uint8_t GetResolutionByteCodePressure()
Obtain the conversion code for P for specified resolution.
Definition: driver_5525DSO.cpp:341
Sensor5525DSO::__last_is_T
bool __last_is_T
Definition: driver_5525DSO.h:80
Sensor5525DSO::asyncGetResult
bool asyncGetResult(float *P, float *T)
Get result from an NON BLOCKING measure process.
Definition: driver_5525DSO.cpp:211
Sensor5525DSO::setZero
void setZero(float value)
Calibrate sensor zero with a specified value.
Definition: driver_5525DSO.cpp:409
Sensor5525DSO::sensorCT
t_5525DSO_calibration_table sensorCT
Definition: driver_5525DSO.h:62
Sensor5525DSO::GetResolutionByteCodeTemp
uint8_t GetResolutionByteCodeTemp()
Obtain the conversion code for T for specified resolution.
Definition: driver_5525DSO.cpp:317