SDMP_IOT / Mbed OS AdiSense1000_SmartBabySeat

Fork of Babyseat_NewFirmware_copy_sean by Ross O'Halloran

Revision:
36:7b89e52b48f6
Parent:
35:cc01f0766fc2
--- a/babyseat_conf.c	Fri Aug 17 15:46:16 2018 +0000
+++ b/babyseat_conf.c	Fri Aug 24 10:46:38 2018 +0000
@@ -52,10 +52,30 @@
         .measurement = {
             .operatingMode = ADI_SENSE_1000_OPERATING_MODE_CONTINUOUS,
             .dataReadyMode = ADI_SENSE_1000_DATAREADY_PER_CYCLE,
-            .cycleInterval = 1000000,
+            .cycleInterval = 50000,
         },
         .channels = {
-             [ADI_SENSE_1000_CHANNEL_ID_SENSOR_0] = {
+               [ADI_SENSE_1000_CHANNEL_ID_CJC_0] = {
+                .enableChannel = false,
+                .disablePublishing = false,
+                .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
+                .measurementUnit = ADI_SENSE_1000_MEASUREMENT_UNIT_CELSIUS,
+                .measurementsPerCycle = 1,
+                .extraSettlingTime = 0,
+                .adcChannelConfig = {
+                    .sensor = ADI_SENSE_1000_ADC_SENSOR_THERMISTOR_B_10K_DEF_L1,
+                    .gain = ADI_SENSE_1000_ADC_GAIN_1X,
+                    .filter = {
+                        .type = ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
+                    },
+                    .reference = {
+                        .type = ADI_SENSE_1000_ADC_REFERENCE_RESISTOR_INTERNAL_2,
+                        .disableBuffer = true,
+                    },
+                    .enableVbias = false,
+                },
+            },
+              [ADI_SENSE_1000_CHANNEL_ID_SENSOR_0] = {
                     .enableChannel = true,
                     .disablePublishing = false,
                     .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
@@ -73,26 +93,27 @@
                         },
                         .enableVbias = false,
                             },
+                }, 
+                [ADI_SENSE_1000_CHANNEL_ID_SENSOR_1] = {
+                .enableChannel = false,
+                .disablePublishing = false,
+                .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
+                .measurementUnit = ADI_SENSE_1000_MEASUREMENT_UNIT_CELSIUS,
+                .measurementsPerCycle = 1,
+                .extraSettlingTime = 0,
+                .adcChannelConfig = {
+                    .sensor = ADI_SENSE_1000_ADC_SENSOR_BRIDGE_4WIRE_2_DEF_L2,
+                    .gain = ADI_SENSE_1000_ADC_GAIN_1X,
+                    .filter = {
+                        .type = ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
+                    },
+                    .reference = {
+                        .type = ADI_SENSE_1000_ADC_REFERENCE_BRIDGE_EXCITATION,
+                        .disableBuffer = true,
+                    },
+                    .enableVbias = false,
                 },
-                    [ADI_SENSE_1000_CHANNEL_ID_SENSOR_1] = {
-                        .enableChannel = false,
-                        .disablePublishing = false,
-                        .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
-                        .measurementsPerCycle = 1,
-                        .extraSettlingTime = 25000,
-                        .adcChannelConfig = {
-                            .sensor = ADI_SENSE_1000_ADC_SENSOR_BRIDGE_4WIRE_2_DEF_L2,
-                            .gain = ADI_SENSE_1000_ADC_GAIN_1X,
-                            .filter = {
-                                .type = ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
-                            },
-                            .reference = {
-                                .type = ADI_SENSE_1000_ADC_REFERENCE_BRIDGE_EXCITATION,
-                                .disableBuffer = false,
-                            },
-                            .enableVbias = false,
-                                },
-                },
+            },
                 [ADI_SENSE_1000_CHANNEL_ID_SENSOR_2] = {
                             .enableChannel = false,
                             .disablePublishing = false,
@@ -130,7 +151,26 @@
                                 },
                                 .enableVbias = false,
                                 },
-            },
+            }, 
+               [ADI_SENSE_1000_CHANNEL_ID_VOLTAGE_0] = {
+                .enableChannel = false,
+                .disablePublishing = false,
+                .compensationChannel = ADI_SENSE_1000_CHANNEL_ID_NONE,
+                .measurementsPerCycle = 1,
+                .extraSettlingTime = 0,
+                .adcChannelConfig = {
+                    .sensor =  ADI_SENSE_1000_ADC_SENSOR_VOLTAGE_PRESSURE_1_DEF_L2,
+                    .gain = ADI_SENSE_1000_ADC_GAIN_1X,
+                    .filter = {
+                        .type = ADI_SENSE_1000_ADC_FILTER_FIR_25SPS,
+                    },
+                    .reference = {
+                        .type = ADI_SENSE_1000_ADC_REFERENCE_VOLTAGE_INTERNAL,
+                        .disableBuffer = true,
+                    },
+                    .enableVbias = false,
+                },
+            }, 
                 [ADI_SENSE_1000_CHANNEL_ID_I2C_0] = {
                 .enableChannel = false,
                 .disablePublishing = false,
@@ -150,8 +190,8 @@
                 .measurementsPerCycle = 1,
                 .extraSettlingTime = 10000,
                 /* Optional threshold limits applied to the processed measurement results */
-                .lowThreshold = -6.0,
-                .highThreshold = 6.0,
+                .lowThreshold = -60.0,
+                .highThreshold = 60.0,
                 .spiChannelConfig = {
                     .sensor = ADI_SENSE_1000_SPI_SENSOR_ACCELEROMETER_A_DEF_L1,
                 },
@@ -160,8 +200,8 @@
                 /* Accelerometer Y-Axis (virtual channel) */
                 .enableChannel = false,
                 /* Optional threshold limits applied to the processed measurement results */
-                .lowThreshold = -6.0,
-                .highThreshold = 6.0,
+                .lowThreshold = -60.0,
+                .highThreshold = 60.0,
             },
             [ADI_SENSE_1000_CHANNEL_ID_SPI_2] = {
                 /* Accelerometer Z-Axis (virtual channel) */
@@ -169,8 +209,8 @@
                 /* Optional adjustment applied to the processed measurement result */
                 .offsetAdjustment = -0.2,
                 /* Optional threshold limits applied to the processed measurement results */
-                .lowThreshold = -1.5,
-                .highThreshold = 1.5,
+                .lowThreshold = -10.5,
+                .highThreshold = 10.5,
                               },
                          },
                     },