Temperature (cjc0, sensor0) Humidity I2C_0 Accelerometer SPI_0
Fork of ADISense1000_Example_FW by
common/utils.h@0:76fed7dd9235, 2018-01-25 (annotated)
- Committer:
- seanwilson10
- Date:
- Thu Jan 25 16:00:23 2018 +0000
- Revision:
- 0:76fed7dd9235
- Child:
- 1:982f6f565e14
initial;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
seanwilson10 | 0:76fed7dd9235 | 1 | #ifndef __UTILS_H__ |
seanwilson10 | 0:76fed7dd9235 | 2 | #define __UTILS_H__ |
seanwilson10 | 0:76fed7dd9235 | 3 | |
seanwilson10 | 0:76fed7dd9235 | 4 | #include "inc/adi_sense_api.h" |
seanwilson10 | 0:76fed7dd9235 | 5 | #include "inc/adi_sense_1000/adi_sense_1000_api.h" |
seanwilson10 | 0:76fed7dd9235 | 6 | |
seanwilson10 | 0:76fed7dd9235 | 7 | #ifdef __cplusplus |
seanwilson10 | 0:76fed7dd9235 | 8 | extern "C" { |
seanwilson10 | 0:76fed7dd9235 | 9 | #endif |
seanwilson10 | 0:76fed7dd9235 | 10 | |
seanwilson10 | 0:76fed7dd9235 | 11 | /* Utility function to print the status read from the ADI Sense device */ |
seanwilson10 | 0:76fed7dd9235 | 12 | void utils_printStatus( |
seanwilson10 | 0:76fed7dd9235 | 13 | ADI_SENSE_STATUS *pStatus); |
seanwilson10 | 0:76fed7dd9235 | 14 | |
seanwilson10 | 0:76fed7dd9235 | 15 | /* Utility function to print data samples read from the ADI Sense device */ |
seanwilson10 | 0:76fed7dd9235 | 16 | void utils_printSamples( |
seanwilson10 | 0:76fed7dd9235 | 17 | ADI_SENSE_DATA_SAMPLE *pSampleBuffer, |
seanwilson10 | 0:76fed7dd9235 | 18 | uint32_t numSamples); |
seanwilson10 | 0:76fed7dd9235 | 19 | |
seanwilson10 | 0:76fed7dd9235 | 20 | /* Utility function to register callbacks for ADI Sense device notification signals */ |
seanwilson10 | 0:76fed7dd9235 | 21 | ADI_SENSE_RESULT utils_registerCallbacks( |
seanwilson10 | 0:76fed7dd9235 | 22 | ADI_SENSE_DEVICE_HANDLE hDevice, |
seanwilson10 | 0:76fed7dd9235 | 23 | volatile bool_t *pbDataReady, |
seanwilson10 | 0:76fed7dd9235 | 24 | volatile bool_t *pbError, |
seanwilson10 | 0:76fed7dd9235 | 25 | volatile bool_t *pbAlert); |
seanwilson10 | 0:76fed7dd9235 | 26 | |
seanwilson10 | 0:76fed7dd9235 | 27 | /* Utility function to de-register callbacks for ADI Sense device notification signals */ |
seanwilson10 | 0:76fed7dd9235 | 28 | ADI_SENSE_RESULT utils_deregisterCallbacks( |
seanwilson10 | 0:76fed7dd9235 | 29 | ADI_SENSE_DEVICE_HANDLE hDevice); |
seanwilson10 | 0:76fed7dd9235 | 30 | |
seanwilson10 | 0:76fed7dd9235 | 31 | /* Utility function to run measurements on ADI Sense device, according to its current |
seanwilson10 | 0:76fed7dd9235 | 32 | * configuration, and display data samples and device status following each cycle */ |
seanwilson10 | 0:76fed7dd9235 | 33 | ADI_SENSE_RESULT utils_runMeasurement( |
seanwilson10 | 0:76fed7dd9235 | 34 | ADI_SENSE_DEVICE_HANDLE hDevice, |
seanwilson10 | 0:76fed7dd9235 | 35 | ADI_SENSE_MEASUREMENT_MODE eMeasurementMode); |
seanwilson10 | 0:76fed7dd9235 | 36 | |
seanwilson10 | 0:76fed7dd9235 | 37 | /* Utility function to retrieve and print the factory calibration coefficients table from the ADI Sense device */ |
seanwilson10 | 0:76fed7dd9235 | 38 | ADI_SENSE_RESULT utils_printCalTable( |
seanwilson10 | 0:76fed7dd9235 | 39 | ADI_SENSE_DEVICE_HANDLE hDevice); |
seanwilson10 | 0:76fed7dd9235 | 40 | |
seanwilson10 | 0:76fed7dd9235 | 41 | #ifdef __cplusplus |
seanwilson10 | 0:76fed7dd9235 | 42 | } |
seanwilson10 | 0:76fed7dd9235 | 43 | #endif |
seanwilson10 | 0:76fed7dd9235 | 44 | |
seanwilson10 | 0:76fed7dd9235 | 45 | #endif /* __UTILS_H__ */ |
seanwilson10 | 0:76fed7dd9235 | 46 |