Sean Wilson / Mbed OS AdiSense1000_V21

Fork of AdiSense1000 by PoC_Team

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers utils.h Source File

utils.h

00001 #ifndef __UTILS_H__
00002 #define __UTILS_H__
00003 
00004 #include "inc/adi_sense_api.h"
00005 #include "inc/adi_sense_1000/adi_sense_1000_api.h"
00006 
00007 #ifdef __cplusplus
00008 extern "C" {
00009 #endif
00010 
00011 /* Utility function to print the status read from the ADI Sense device */
00012 void utils_printStatus(
00013     ADI_SENSE_STATUS  *pStatus);
00014 
00015 /* Utility function to print data samples read from the ADI Sense device */
00016 void utils_printSamples(
00017     ADI_SENSE_DATA_SAMPLE  *pSampleBuffer,
00018     uint32_t nNumSamples,
00019     ADI_SENSE_MEASUREMENT_MODE  eMeasurementMode);
00020 
00021 /* Utility function to register callbacks for ADI Sense device notification signals  */
00022 ADI_SENSE_RESULT  utils_registerCallbacks(
00023     ADI_SENSE_DEVICE_HANDLE  hDevice,
00024     volatile bool_t *pbDataReady,
00025     volatile bool_t *pbError,
00026     volatile bool_t *pbAlert);
00027 
00028 /* Utility function to de-register callbacks for ADI Sense device notification signals */
00029 ADI_SENSE_RESULT  utils_deregisterCallbacks(
00030     ADI_SENSE_DEVICE_HANDLE  hDevice);
00031 
00032 /* Utility function to run measurements on ADI Sense device, according to its current
00033  * configuration, and display data samples and device status following each cycle */
00034 ADI_SENSE_RESULT  utils_runMeasurement(
00035     ADI_SENSE_DEVICE_HANDLE  hDevice,
00036     ADI_SENSE_MEASUREMENT_MODE  eMeasurementMode);
00037  
00038 /* Utility function to retrieve and print the factory calibration coefficients table from the ADI Sense device */
00039 ADI_SENSE_RESULT  utils_printCalTable(
00040     ADI_SENSE_DEVICE_HANDLE  hDevice);
00041 
00042 #ifdef __cplusplus
00043 }
00044 #endif
00045 
00046 #endif /* __UTILS_H__ */