Skip to content
Snippets Groups Projects
Commit a32f0d87 authored by Luiz-Fernando Lavado-Villa's avatar Luiz-Fernando Lavado-Villa
Browse files

Added support for separate data conversin functions (to be tested)

parent 88f6767b
No related branches found
No related tags found
No related merge requests found
......@@ -94,6 +94,24 @@ float32_t data_conversion_convert_temp(uint16_t raw_value)
}
float32_t v1_low_last_value_get()
{
uint32_t v1_low_count;
float32_t data;
//Vhigh data acquisition
uint16_t* v1_low_buffer = data_acquisition_get_v1_low_values(&v1_low_count);
if (v1_low_count){ //if data was received it gets converted
uint32_t raw_value = v1_low_buffer[v1_low_count - 1];
data = data_conversion_convert_v_high(raw_value);
}else{
data = -1000; // returns an impossible value
}
return data;
}
/**
* These functions update the parameters of the variables
*/
......
......@@ -106,6 +106,18 @@ float32_t data_conversion_convert_i2_low(uint16_t raw_value);
float32_t data_conversion_convert_i_high(uint16_t raw_value);
float32_t data_conversion_convert_temp(uint16_t raw_value);
/**
* @brief Get the latest value from a measurement
*
* @return the last measurement value relative to the physical unit and channel
* (v1, v2, v_high) in volts
* (i1, i2, i_high) in amperes
* (t) in degree celsius
* If conversion is unsuccessful, it returns an impossible value (-1000)
*/
float32_t v1_low_last_value_get();
#ifdef __cplusplus
}
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment