File tree Expand file tree Collapse file tree 4 files changed +7
-16
lines changed
Expand file tree Collapse file tree 4 files changed +7
-16
lines changed Original file line number Diff line number Diff line change @@ -47,17 +47,10 @@ class Imu final : public ImuComponentBase {
4747 // IMU access methods
4848 // ----------------------------------------------------------------------
4949
50- // ! Get the acceleration reading from the IMU
51- Components::Imu_Acceleration get_acceleration ();
52-
53- // ! Get the angular velocity reading from the IMU
54- Components::Imu_AngularVelocity get_angular_velocity ();
55-
50+
5651 // ! Get the magnetic field reading from the IMU
5752 Components::Imu_MagneticField get_magnetic_field ();
5853
59- // ! Get the temperature reading from the IMU
60- F64 get_temperature ();
6154
6255 // ----------------------------------------------------------------------
6356 // Member variables
@@ -66,8 +59,7 @@ class Imu final : public ImuComponentBase {
6659 // ! Zephyr device stores the initialized LIS2MDL sensor
6760 const struct device * lis2mdl;
6861
69- // ! Zephyr device stores the initialized LSM6DSO sensor
70- const struct device * lsm6dso;
62+
7163};
7264
7365} // namespace Components
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ Components::Acceleration lms6dsoDriver::getAcceleration_handler(FwIndexType port
3232 struct sensor_value x;
3333 struct sensor_value y;
3434 struct sensor_value z;
35+ sensor_sample_fetch_chan (lsm6dso, SENSOR_CHAN_ACCEL_XYZ);
3536
3637 sensor_channel_get (lsm6dso, SENSOR_CHAN_ACCEL_X, &x);
3738 sensor_channel_get (lsm6dso, SENSOR_CHAN_ACCEL_Y, &y);
@@ -44,6 +45,7 @@ Components::AngularVelocity lms6dsoDriver::getAngularVelocity_handler(FwIndexTyp
4445 struct sensor_value x;
4546 struct sensor_value y;
4647 struct sensor_value z;
48+ sensor_sample_fetch_chan (lsm6dso, SENSOR_CHAN_GYRO_XYZ);
4749
4850 sensor_channel_get (lsm6dso, SENSOR_CHAN_GYRO_X, &x);
4951 sensor_channel_get (lsm6dso, SENSOR_CHAN_GYRO_Y, &y);
@@ -56,6 +58,7 @@ Components::AngularVelocity lms6dsoDriver::getAngularVelocity_handler(FwIndexTyp
5658F64 lms6dsoDriver::getTemperature_handler (FwIndexType portNum) {
5759 struct sensor_value temp;
5860
61+ sensor_sample_fetch_chan (lsm6dso, SENSOR_CHAN_DIE_TEMP);
5962 sensor_channel_get (lsm6dso, SENSOR_CHAN_DIE_TEMP, &temp);
6063
6164 return this ->sensor_value_to_f64 (temp);
Original file line number Diff line number Diff line change 11module Components {
2- # @ Extern type to define zepyhr sensor_value
3- # struct SensorValue {
4- # val1: I32
5- # val2: I32
6- # }
2+
73 @ Acceleration Reading in m/ s^2
84 struct Acceleration {
95 x: F64
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ module ReferenceDeployment {
3030 instance watchdog
3131 instance prmDb
3232 instance imu
33- # instance lms6dsoDriver
33+ instance lms6dsoDriver
3434
3535 # ----------------------------------------------------------------------
3636 # Pattern graph specifiers
You can’t perform that action at this time.
0 commit comments