I2C hang recover function added
Dependencies: UniGraphic mbed vt100
edge_pressure Class Reference
edge_pressure edge_sensor for measuring gas presssure More...
#include <edge_pressure.h>
Inherits edge_sensor.
Public Member Functions | |
edge_pressure (PSE530 *pse, DigitalOut *en) | |
constructor | |
~edge_pressure (void) | |
destructor | |
virtual void | reset (void) |
reset and clear internal values | |
virtual void | prepare (void) |
prepare for sampling (not used) | |
virtual int | sample (void) |
sample the value | |
virtual int | deliver (void) |
deliver the sampled value to afero cloud | |
virtual void | show (void) |
show the value in the display (TFT) | |
float | get_value (void) |
get_value sample sensor value and calcurate it to the metric value | |
void | set_thr_mode (int mode) |
Set threshold mode. | |
int | get_thr_mode (void) |
Get threshold mode. | |
void | set_thr_high (int16_t thr_high) |
Set higher threshold. | |
float | get_thr_high (float expected) |
Get higher threshold, the value is calcurated with expected value. | |
void | set_thr_low (int16_t thr_low) |
Set lower threshold. | |
float | get_thr_low (float expected) |
Get lower threshold, the value is calcurated with expected value. | |
void | drawPointer (int c) |
draw triangle pointer for GAS pressure mode display | |
virtual void | setId (uint16_t id) |
assign _id manually | |
virtual void | enable (void) |
enable the edge_sensor | |
virtual void | disable (void) |
disable the edge_sensor | |
virtual bool | isEnabled (void) |
test if the edge_sensor is enabled (or not) | |
virtual void | toJson (char *buf) |
toJson convert sampled data to json format | |
virtual void | displayTime (int32_t ts) |
display timestamp in human readable format ts int32_t timestamp value to display | |
void | setInterval (uint16_t interval) |
setInterval assign sampling interval time (in sec) | |
uint16_t | getInterval (void) |
getInterval get sampling interval time (in sec) | |
int | getStatus (void) |
getStatus get current status of the state machine | |
int | advanceStatus (void) |
advanceStatus proceed status into the next state | |
virtual int | runStateMachine (void) |
runStateMachine run the statemachine for single cycle |
Detailed Description
edge_pressure edge_sensor for measuring gas presssure
Definition at line 11 of file edge_pressure.h.
Constructor & Destructor Documentation
edge_pressure | ( | PSE530 * | pse, |
DigitalOut * | en | ||
) |
constructor
- Parameters:
-
*pse PSE530 pressure sensor object
Definition at line 41 of file edge_pressure.cpp.
~edge_pressure | ( | void | ) |
destructor
Definition at line 52 of file edge_pressure.cpp.
Member Function Documentation
int advanceStatus | ( | void | ) | [inherited] |
advanceStatus proceed status into the next state
- Returns:
- advanced status
int deliver | ( | void | ) | [virtual] |
deliver the sampled value to afero cloud
Reimplemented from edge_sensor.
Definition at line 161 of file edge_pressure.cpp.
void disable | ( | void | ) | [virtual, inherited] |
disable the edge_sensor
Definition at line 36 of file edge_sensor.cpp.
void displayTime | ( | int32_t | ts ) | [virtual, inherited] |
display timestamp in human readable format ts int32_t timestamp value to display
Definition at line 70 of file edge_sensor.cpp.
void drawPointer | ( | int | c ) |
draw triangle pointer for GAS pressure mode display
drawPointer
draw a triangle pointer at value place in GAS pressure display mode
Definition at line 230 of file edge_pressure.cpp.
void enable | ( | void | ) | [virtual, inherited] |
enable the edge_sensor
Definition at line 31 of file edge_sensor.cpp.
float get_thr_high | ( | float | expected ) |
Get higher threshold, the value is calcurated with expected value.
- Parameters:
-
expected float the expected pressure value for current temperature
Definition at line 106 of file edge_pressure.cpp.
float get_thr_low | ( | float | expected ) |
Get lower threshold, the value is calcurated with expected value.
- Parameters:
-
expected float the expected pressure value for current temperature
Definition at line 142 of file edge_pressure.cpp.
int get_thr_mode | ( | void | ) |
Get threshold mode.
- Returns:
- the mode 0: absolute value 1: relative value in percent
Definition at line 68 of file edge_pressure.h.
float get_value | ( | void | ) |
get_value sample sensor value and calcurate it to the metric value
- Returns:
- measured value in kgf/cm2
Definition at line 60 of file edge_pressure.cpp.
uint16_t getInterval | ( | void | ) | [inherited] |
getInterval get sampling interval time (in sec)
- Returns:
- the interval time in uint16_t
Definition at line 103 of file edge_sensor.cpp.
int getStatus | ( | void | ) | [inherited] |
getStatus get current status of the state machine
- Returns:
- current status as int
Definition at line 108 of file edge_sensor.cpp.
bool isEnabled | ( | void | ) | [virtual, inherited] |
test if the edge_sensor is enabled (or not)
- Returns:
- true: the sensor is enabled false: the sensor is disabled
Definition at line 41 of file edge_sensor.cpp.
void prepare | ( | void | ) | [virtual] |
prepare for sampling (not used)
Reimplemented from edge_sensor.
Definition at line 73 of file edge_pressure.cpp.
void reset | ( | void | ) | [virtual] |
reset and clear internal values
Reimplemented from edge_sensor.
Definition at line 67 of file edge_pressure.cpp.
int runStateMachine | ( | void | ) | [virtual, inherited] |
runStateMachine run the statemachine for single cycle
- Returns:
- the result status
Definition at line 122 of file edge_sensor.cpp.
int sample | ( | void | ) | [virtual] |
sample the value
- Returns:
- 0: success non-0: failure
Reimplemented from edge_sensor.
Definition at line 77 of file edge_pressure.cpp.
void set_thr_high | ( | int16_t | thr_high ) |
Set higher threshold.
- Parameters:
-
thr_high int16_t the higher threshold
Definition at line 89 of file edge_pressure.cpp.
void set_thr_low | ( | int16_t | thr_low ) |
Set lower threshold.
- Parameters:
-
thr_low int16_t the lower threshold
Definition at line 125 of file edge_pressure.cpp.
void set_thr_mode | ( | int | mode ) |
Set threshold mode.
- Parameters:
-
mode int 0: absolute value 1: relative value in percent
Definition at line 62 of file edge_pressure.h.
virtual void setId | ( | uint16_t | id ) | [virtual, inherited] |
assign _id manually
Definition at line 32 of file edge_sensor.h.
void setInterval | ( | uint16_t | interval ) | [inherited] |
setInterval assign sampling interval time (in sec)
- Parameters:
-
interval uint16_t the value to assign
Definition at line 98 of file edge_sensor.cpp.
void show | ( | void | ) | [virtual] |
show the value in the display (TFT)
Reimplemented from edge_sensor.
Definition at line 245 of file edge_pressure.cpp.
void toJson | ( | char * | buf ) | [virtual, inherited] |
toJson convert sampled data to json format
- Parameters:
-
buf char* string buf to store the json string
Definition at line 93 of file edge_sensor.cpp.
Generated on Sat Jul 16 2022 08:26:44 by 1.7.2