Jake Greaves / Mbed OS AdiSense1000_V21
Revision:
19:a6d4bdcffb84
Parent:
17:fd5ab3d27b15
Child:
23:2adb6216b001
diff -r fa3a317ebeaa -r a6d4bdcffb84 spi0_adiAdxl362_config.c
--- a/spi0_adiAdxl362_config.c	Fri Dec 15 22:41:56 2017 +0000
+++ b/spi0_adiAdxl362_config.c	Mon Jan 08 16:32:34 2018 +0000
@@ -54,8 +54,9 @@
             .supplyVoltage = 3.3,
         },
         .measurement = {
-            .operatingMode = ADI_SENSE_1000_OPERATING_MODE_SINGLECYCLE,
+            .operatingMode = ADI_SENSE_1000_OPERATING_MODE_CONTINUOUS,
             .dataReadyMode = ADI_SENSE_1000_DATAREADY_PER_CYCLE,
+            .cycleInterval = 1000000,
         },
         .channels = {
             [ADI_SENSE_1000_CHANNEL_ID_CJC_0] = {
@@ -89,11 +90,15 @@
                 .enableChannel = false,
             },
             [ADI_SENSE_1000_CHANNEL_ID_SPI_0] = {
+                /* Accelerometer X-Axis (and common settings for physical channel) */
                 .enableChannel = true,
                 .disablePublishing = false,
                 .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
                 .measurementsPerCycle = 10,
                 .extraSettlingTime = 10000,
+                /* Optional threshold limits applied to the processed measurement results */
+                .lowThreshold = -6.0,
+                .highThreshold = 6.0,
                 .spiChannelConfig = {
                     .sensor = ADI_SENSE_1000_SPI_SENSOR_ACCELEROMETER_ADI_ADXL362,
                     .configurationCommand = {
@@ -103,10 +108,20 @@
                 },
             },
             [ADI_SENSE_1000_CHANNEL_ID_SPI_1] = {
+                /* Accelerometer Y-Axis (virtual channel) */
                 .enableChannel = true,
+                /* Optional threshold limits applied to the processed measurement results */
+                .lowThreshold = -6.0,
+                .highThreshold = 6.0,
             },
             [ADI_SENSE_1000_CHANNEL_ID_SPI_2] = {
+                /* Accelerometer Z-Axis (virtual channel) */
                 .enableChannel = true,
+                /* Optional adjustment applied to the raw input value from the sensor */
+                .offsetAdjustment = -100,
+                /* Optional threshold limits applied to the processed measurement results */
+                .lowThreshold = -1.5,
+                .highThreshold = 1.5,
             },
         },
     },