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