Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
neOCampus-arduino
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
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
GIS-neOCampus
neOSensor
neOCampus-arduino
Commits
9a5891e1
Commit
9a5891e1
authored
3 years ago
by
thiebolt
Browse files
Options
Downloads
Patches
Plain Diff
update
parent
fd4a368e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
neosensor/libraries/neocampus_drivers/SCD4x.h
+46
-17
46 additions, 17 deletions
neosensor/libraries/neocampus_drivers/SCD4x.h
with
46 additions
and
17 deletions
neosensor/libraries/neocampus_drivers/SCD4x.h
+
46
−
17
View file @
9a5891e1
...
...
@@ -5,8 +5,8 @@
@license
This is part of a the neOCampus drivers library.
SCD4x is an ultrasonic CO2 sensor that features
both temperature and hygro
on an I2C interface
SCD4x is an ultrasonic CO2 sensor that
also
features
both temperature and hygro
on an I2C interface
:)
Remember: all transfers are 16bits wide
...
...
@@ -29,9 +29,6 @@
#include
"generic_driver.h"
#if 0
TO BE CONTINUED
/*
* Definitions
...
...
@@ -39,26 +36,60 @@ TO BE CONTINUED
/* SCD4x sensor send back both CO2, T and RH at the same time, but since
* we'll have three instances of this class ==> we implement a cache to
* avoid reading the sensor multiple times */
#define S
HT3
X_SENSOR_CACHE_MS 5000 // ms caches values validity
#define S
CD4
X_SENSOR_CACHE_MS 5000 // ms caches values validity
// Enable CRC lookup table (regular computation otherwise)
#ifndef S
HT3
X_CRC_LOOKUP_TABLE
#define S
HT3
X_CRC_LOOKUP_TABLE 1
#ifndef S
CD4
X_CRC_LOOKUP_TABLE
#define S
CD4
X_CRC_LOOKUP_TABLE 1
#endif
/* s
ht3
x commands
/* s
cd4
x commands
* Note:
* - we won't make use of the 'Periodic Mode' features (i.e continuous measurement)
* - avoid stretch modes because measuremernt can take up to 16ms
* - useless heater
* - Repeatability is resolution
* - 1ms min. delay between two commands
* - both temperature and humidity are measured and sent in a single 6bytes frame
* 16bits T + CRC + 16bits RH + CRC
* - most commands need a 1ms execution time
* - CO2, temp and humidity are measured and sent in a single 9bytes frame
* 16bits C02 + CRC + 16bits T + CRC + 16bits RH + CRC
* - every 16bits frames are CRC protected
* - CRC8 0x31, initial=0xFF for 16bits data (first is )
*/
enum
class
sht3xCmd_t
:
uint16_t
{
// basic commands
start_periodic_measurement
=
0x21b1
,
// 5000ms measurement delay
read_measurement
=
0xec05
,
// execution time: 1ms
stop_periodic_measurement
=
0x3f86
,
// execution time: 500ms
// output signal compensation
set_temperature_offset
=
0x241d
,
// execution time: 1ms
get_temperature_offset
=
0x2318
,
// execution time: 1ms
set_sensor_altitude
=
0x2427
,
// execution time: 1ms
get_sensor_altitude
=
0x2322
,
// execution time: 1ms
set_ambiant_pressure
=
0xe000
,
// execution time: 1ms
// field calibration
perform_forced_calibration
=
0x362f
// execution time: 400ms
set_automatic_self_calibration_enabled
=
0x2416
// execution time: 1ms
get_automatic_self_calibration_enabled
=
0x2313
// execution time: 1ms
// low-power operations
start_low_power_periodoc_measurement
=
0x21ac
,
// 30s measurement delay
get_data_ready_status
=
0xe4b8
,
// execution time: 1ms
TO
BE
CONTINUED
//Advanced features
#define SCD4x_COMMAND_PERSIST_SETTINGS 0x3615 // execution time: 800ms
#define SCD4x_COMMAND_GET_SERIAL_NUMBER 0x3682 // execution time: 1ms
#define SCD4x_COMMAND_PERFORM_SELF_TEST 0x3639 // execution time: 10000ms
#define SCD4x_COMMAND_PERFORM_FACTORY_RESET 0x3632 // execution time: 1200ms
#define SCD4x_COMMAND_REINIT 0x3646 // execution time: 20ms
//Low power single shot - SCD41 only
#define SCD4x_COMMAND_MEASURE_SINGLE_SHOT 0x219d // execution time: 5000ms
#define SCD4x_COMMAND_MEASURE_SINGLE_SHOT_RHT_ONLY 0x2196 // execution time: 50ms
soft_reset
=
0X30A2
,
// software reset
heater_enable
=
0x306D
,
// on-chip heater enable
heater_disable
=
0x3066
,
// on-chip heater disable
...
...
@@ -158,6 +189,4 @@ class SHT3x : public generic_driver {
#endif
/* SHT3X_CRC_LOOKUP_TABLE */
};
#endif /* 0 */
#endif
/* _SCD4X_H_ */
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