
MWARE-1930 fixed
common/utils.h@0:85855ecd3257, 2019-04-01 (annotated)
- Committer:
- ADIJake
- Date:
- Mon Apr 01 11:09:52 2019 +0000
- Revision:
- 0:85855ecd3257
- Child:
- 5:0728bde67bdb
Initial Commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ADIJake | 0:85855ecd3257 | 1 | #ifndef __UTILS_H__ |
ADIJake | 0:85855ecd3257 | 2 | #define __UTILS_H__ |
ADIJake | 0:85855ecd3257 | 3 | |
ADIJake | 0:85855ecd3257 | 4 | #include "adi_sense_api.h" |
ADIJake | 0:85855ecd3257 | 5 | #include "adi_sense_1000/adi_sense_1000_api.h" |
ADIJake | 0:85855ecd3257 | 6 | |
ADIJake | 0:85855ecd3257 | 7 | #ifdef __cplusplus |
ADIJake | 0:85855ecd3257 | 8 | extern "C" { |
ADIJake | 0:85855ecd3257 | 9 | #endif |
ADIJake | 0:85855ecd3257 | 10 | |
ADIJake | 0:85855ecd3257 | 11 | /* Utility function to print the status read from the ADI Sense device */ |
ADIJake | 0:85855ecd3257 | 12 | void utils_printStatus( |
ADIJake | 0:85855ecd3257 | 13 | ADI_SENSE_STATUS *pStatus); |
ADIJake | 0:85855ecd3257 | 14 | |
ADIJake | 0:85855ecd3257 | 15 | /* Utility function to print data samples read from the ADI Sense device */ |
ADIJake | 0:85855ecd3257 | 16 | void utils_printSamples( |
ADIJake | 0:85855ecd3257 | 17 | ADI_SENSE_DATA_SAMPLE *pSampleBuffer, |
ADIJake | 0:85855ecd3257 | 18 | uint32_t nNumSamples, |
ADIJake | 0:85855ecd3257 | 19 | ADI_SENSE_MEASUREMENT_MODE eMeasurementMode); |
ADIJake | 0:85855ecd3257 | 20 | |
ADIJake | 0:85855ecd3257 | 21 | /* Utility function to register callbacks for ADI Sense device notification signals */ |
ADIJake | 0:85855ecd3257 | 22 | ADI_SENSE_RESULT utils_registerCallbacks( |
ADIJake | 0:85855ecd3257 | 23 | ADI_SENSE_DEVICE_HANDLE hDevice, |
ADIJake | 0:85855ecd3257 | 24 | volatile bool *pbDataReady, |
ADIJake | 0:85855ecd3257 | 25 | volatile bool *pbError, |
ADIJake | 0:85855ecd3257 | 26 | volatile bool *pbAlert); |
ADIJake | 0:85855ecd3257 | 27 | |
ADIJake | 0:85855ecd3257 | 28 | /* Utility function to de-register callbacks for ADI Sense device notification signals */ |
ADIJake | 0:85855ecd3257 | 29 | ADI_SENSE_RESULT utils_deregisterCallbacks( |
ADIJake | 0:85855ecd3257 | 30 | ADI_SENSE_DEVICE_HANDLE hDevice); |
ADIJake | 0:85855ecd3257 | 31 | |
ADIJake | 0:85855ecd3257 | 32 | /* Utility function to run measurements on ADI Sense device, according to its current |
ADIJake | 0:85855ecd3257 | 33 | * configuration, and display data samples and device status following each cycle */ |
ADIJake | 0:85855ecd3257 | 34 | ADI_SENSE_RESULT utils_runMeasurement( |
ADIJake | 0:85855ecd3257 | 35 | ADI_SENSE_DEVICE_HANDLE hDevice, |
ADIJake | 0:85855ecd3257 | 36 | ADI_SENSE_MEASUREMENT_MODE eMeasurementMode); |
ADIJake | 0:85855ecd3257 | 37 | |
ADIJake | 0:85855ecd3257 | 38 | /* Utility function to retrieve and print the factory calibration coefficients table from the ADI Sense device */ |
ADIJake | 0:85855ecd3257 | 39 | ADI_SENSE_RESULT utils_printCalTable( |
ADIJake | 0:85855ecd3257 | 40 | ADI_SENSE_DEVICE_HANDLE hDevice); |
ADIJake | 0:85855ecd3257 | 41 | |
ADIJake | 0:85855ecd3257 | 42 | #ifdef __cplusplus |
ADIJake | 0:85855ecd3257 | 43 | } |
ADIJake | 0:85855ecd3257 | 44 | #endif |
ADIJake | 0:85855ecd3257 | 45 | |
ADIJake | 0:85855ecd3257 | 46 | #endif /* __UTILS_H__ */ |
ADIJake | 0:85855ecd3257 | 47 |