Skip to content

Commit 2d66609

Browse files
authored
Merge pull request #277 from ShimmerResearch/DEV-793_LSM6DSV_gen2_file_parser
DEV-793 Add 2nd-gen Verisense LSM6DSV IMU file-parser support
2 parents e3c960d + 90f4ccf commit 2d66609

14 files changed

Lines changed: 2197 additions & 23 deletions

ShimmerDriver/src/main/java/com/shimmerresearch/driver/Configuration.java

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2639,6 +2639,18 @@ public class SensorBitmap {
26392639
public static final int MAX86150_ECG = 1 << (3 + (8*1));
26402640
public static final int MAX86916_PPG_BLUE = 1 << (2 + (8*1));
26412641
public static final int VBATT = 1 << (1 + (8*1));
2642+
2643+
// Second-generation hardware (SR68-9/10, SR61-5/6): LSM6DSV accel/gyro +
2644+
// LIS2MDL mag. Distinct host-internal bits; accel/gyro enables are derived
2645+
// from the payload header ACCEL2/GYRO bits and mag from GEN_CFG_3 (see
2646+
// VerisenseDevice.configBytesParse second-generation branch).
2647+
public static final int LSM6DSV_ACCEL = 1 << (4 + (8*0));
2648+
public static final int LSM6DSV_GYRO = 1 << (3 + (8*0));
2649+
public static final int LSM6DSV_MAG = 1 << (2 + (8*0));
2650+
/** VD6283TX45 ambient light (second-generation HW); enable is GEN_CFG_3 bit 3. */
2651+
public static final int VD6283 = 1 << (1 + (8*0));
2652+
/** MLX90632 skin temperature (second-generation HW); enable is GEN_CFG_3 bit 4. */
2653+
public static final int MLX90632 = 1 << (0 + (8*0));
26422654
}
26432655

26442656
public class DerivedSensorsBitMask {
@@ -2652,6 +2664,9 @@ public class DerivedSensorsBitMask {
26522664
public final static int GYRO_ON_THE_FLY_CAL = (1 << 7);
26532665
public final static int ORIENTATION_6DOF_QUAT = (1 << 8);
26542666
public final static int ORIENTATION_6DOF_EULER = (1 << 9);
2667+
/** Second-generation IMU (SR61-5/6, SR68-9/10). Bit assignment must stay
2668+
* unique against any consumer that persists these derived-sensor bits. */
2669+
public final static int NON_WEAR_DETECTION_LSM6DSV = (1 << 10);
26552670
}
26562671

26572672
public class SENSOR_ID {
@@ -2667,6 +2682,12 @@ public class SENSOR_ID {
26672682
public static final int MAX86916_PPG_BLUE = 2012;
26682683
public static final int VBATT = 2013;
26692684
public static final int GSR = 2014;
2685+
// Second-generation hardware (SR68-9/10, SR61-5/6)
2686+
public static final int LSM6DSV_ACCEL = 2015;
2687+
public static final int LSM6DSV_GYRO = 2016;
2688+
public static final int LSM6DSV_MAG = 2017;
2689+
public static final int VD6283 = 2018;
2690+
public static final int MLX90632 = 2019;
26702691
}
26712692

26722693
public enum LABEL_SENSOR_TILE{
@@ -2709,8 +2730,17 @@ public static class CompatibilityInfoForMaps{
27092730
public static final List<ShimmerVerObject> listOfCompatibleVersionInfoVbatt = Arrays.asList(
27102731
svoVerisenseDevBrd, svoVerisenseImu, svoVerisensePpg0, svoVerisensePpg1, svoVerisenseGsrPlus, svoVerisensePulsePlus);
27112732

2733+
// SR61 (Verisense IMU) carries GSR from minor rev 5 (second-generation); the
2734+
// runtime minor-rev gating is in VerisenseDevice.doesHwSupportGsr() which
2735+
// mirrors the firmware's ShimBrd_isGsrSupportedForHwVersion.
27122736
public static final List<ShimmerVerObject> listOfCompatibleVersionInfoGsr = Arrays.asList(
2713-
svoVerisenseGsrPlus, svoVerisensePulsePlus);
2737+
svoVerisenseGsrPlus, svoVerisensePulsePlus, svoVerisenseImu);
2738+
2739+
// Second-generation IMU: LSM6DSV (accel/gyro) + LIS2MDL (mag), SR68-9/10 and
2740+
// SR61-5/6. TODO refine to HW minor gating once compat supports it; the
2741+
// runtime isPayloadDesignV13orAbove() gate protects gen-1 units meanwhile.
2742+
public static final List<ShimmerVerObject> listOfCompatibleVersionInfoLSM6DSV = Arrays.asList(
2743+
svoVerisensePulsePlus, svoVerisenseImu);
27142744
}
27152745

27162746
}

ShimmerDriver/src/main/java/com/shimmerresearch/sensors/AbstractSensor.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ public enum SENSORS{
6868
LIS3MDL("LIS3MDL"), //to be changed
6969
LIS2MDL("LIS2MDL"),
7070
LSM6DSV("LSM6DSV"),
71+
VD6283("VD6283"),
72+
MLX90632("MLX90632"),
7173
BMP390("BMP390");
7274

7375
private final String text;

ShimmerDriver/src/main/java/com/shimmerresearch/sensors/SensorBattVoltage.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ public static class ObjectClusterSensorName{
6868

6969
// The battery voltage is divided by half before entering the Microcontroller's ADC. The value is not quite equal to 2 due to the components used in the circuit.
7070
public static final double BATTERY_VOLTAGE_DIVIDER_RATIO = 1.988;
71+
72+
// Second-generation Verisense hardware (SR61-5/6, SR68-9/10) battery-sense divider.
73+
// Matches the firmware's conversion in hal_asm_battery.c (measureBatteryVoltage).
74+
public static final double BATTERY_VOLTAGE_DIVIDER_RATIO_GEN2 = 2.469;
7175

7276
//--------- Sensor specific variables end --------------
7377

0 commit comments

Comments
 (0)