Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
opalib_pid_voltage
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jean Alinei
opalib_pid_voltage
Commits
a32f0d87
Commit
a32f0d87
authored
3 years ago
by
Luiz-Fernando Lavado-Villa
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/data_conversion.c
+18
-0
18 additions, 0 deletions
src/data_conversion.c
src/data_conversion.h
+12
-0
12 additions, 0 deletions
src/data_conversion.h
with
30 additions
and
0 deletions
src/data_conversion.c
+
18
−
0
View file @
a32f0d87
...
...
@@ -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
*/
...
...
This diff is collapsed.
Click to expand it.
src/data_conversion.h
+
12
−
0
View file @
a32f0d87
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment