Rohan Gurav
/
Sean_AdiSense1000_V21
ADISense1000 Version 2.1 code base
Fork of AdiSense1000_V21 by
common/utils.h@27:567abf893938, 2018-03-26 (annotated)
- Committer:
- Dan O'Donovan
- Date:
- Mon Mar 26 20:28:05 2018 +0100
- Branch:
- v2.0
- Revision:
- 27:567abf893938
- Parent:
- 24:5a2272a25ff1
- Child:
- 30:119ff4f3aef6
Adding host library and example code for v1.1 release
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
danodonovan | 24:5a2272a25ff1 | 1 | #ifndef __UTILS_H__ |
danodonovan | 24:5a2272a25ff1 | 2 | #define __UTILS_H__ |
danodonovan | 24:5a2272a25ff1 | 3 | |
danodonovan | 24:5a2272a25ff1 | 4 | #include "inc/adi_sense_api.h" |
danodonovan | 24:5a2272a25ff1 | 5 | #include "inc/adi_sense_1000/adi_sense_1000_api.h" |
danodonovan | 24:5a2272a25ff1 | 6 | |
danodonovan | 24:5a2272a25ff1 | 7 | #ifdef __cplusplus |
danodonovan | 24:5a2272a25ff1 | 8 | extern "C" { |
danodonovan | 24:5a2272a25ff1 | 9 | #endif |
danodonovan | 24:5a2272a25ff1 | 10 | |
danodonovan | 24:5a2272a25ff1 | 11 | /* Utility function to print the status read from the ADI Sense device */ |
danodonovan | 24:5a2272a25ff1 | 12 | void utils_printStatus( |
danodonovan | 24:5a2272a25ff1 | 13 | ADI_SENSE_STATUS *pStatus); |
danodonovan | 24:5a2272a25ff1 | 14 | |
danodonovan | 24:5a2272a25ff1 | 15 | /* Utility function to print data samples read from the ADI Sense device */ |
danodonovan | 24:5a2272a25ff1 | 16 | void utils_printSamples( |
danodonovan | 24:5a2272a25ff1 | 17 | ADI_SENSE_DATA_SAMPLE *pSampleBuffer, |
Dan O'Donovan |
27:567abf893938 | 18 | uint32_t nNumSamples, |
Dan O'Donovan |
27:567abf893938 | 19 | ADI_SENSE_MEASUREMENT_MODE eMeasurementMode); |
danodonovan | 24:5a2272a25ff1 | 20 | |
danodonovan | 24:5a2272a25ff1 | 21 | /* Utility function to register callbacks for ADI Sense device notification signals */ |
danodonovan | 24:5a2272a25ff1 | 22 | ADI_SENSE_RESULT utils_registerCallbacks( |
danodonovan | 24:5a2272a25ff1 | 23 | ADI_SENSE_DEVICE_HANDLE hDevice, |
danodonovan | 24:5a2272a25ff1 | 24 | volatile bool_t *pbDataReady, |
danodonovan | 24:5a2272a25ff1 | 25 | volatile bool_t *pbError, |
danodonovan | 24:5a2272a25ff1 | 26 | volatile bool_t *pbAlert); |
danodonovan | 24:5a2272a25ff1 | 27 | |
danodonovan | 24:5a2272a25ff1 | 28 | /* Utility function to de-register callbacks for ADI Sense device notification signals */ |
danodonovan | 24:5a2272a25ff1 | 29 | ADI_SENSE_RESULT utils_deregisterCallbacks( |
danodonovan | 24:5a2272a25ff1 | 30 | ADI_SENSE_DEVICE_HANDLE hDevice); |
danodonovan | 24:5a2272a25ff1 | 31 | |
danodonovan | 24:5a2272a25ff1 | 32 | /* Utility function to run measurements on ADI Sense device, according to its current |
danodonovan | 24:5a2272a25ff1 | 33 | * configuration, and display data samples and device status following each cycle */ |
danodonovan | 24:5a2272a25ff1 | 34 | ADI_SENSE_RESULT utils_runMeasurement( |
danodonovan | 24:5a2272a25ff1 | 35 | ADI_SENSE_DEVICE_HANDLE hDevice, |
danodonovan | 24:5a2272a25ff1 | 36 | ADI_SENSE_MEASUREMENT_MODE eMeasurementMode); |
danodonovan | 24:5a2272a25ff1 | 37 | |
danodonovan | 24:5a2272a25ff1 | 38 | /* Utility function to retrieve and print the factory calibration coefficients table from the ADI Sense device */ |
danodonovan | 24:5a2272a25ff1 | 39 | ADI_SENSE_RESULT utils_printCalTable( |
danodonovan | 24:5a2272a25ff1 | 40 | ADI_SENSE_DEVICE_HANDLE hDevice); |
danodonovan | 24:5a2272a25ff1 | 41 | |
danodonovan | 24:5a2272a25ff1 | 42 | #ifdef __cplusplus |
danodonovan | 24:5a2272a25ff1 | 43 | } |
danodonovan | 24:5a2272a25ff1 | 44 | #endif |
danodonovan | 24:5a2272a25ff1 | 45 | |
danodonovan | 24:5a2272a25ff1 | 46 | #endif /* __UTILS_H__ */ |