PoC_Team
/
ADMW1001_example_firmware
Host API Example for the ADMW1001
Embed:
(wiki syntax)
Show/hide line numbers
utils.h
Go to the documentation of this file.
00001 /* 00002 Copyright 2019 (c) Analog Devices, Inc. 00003 00004 All rights reserved. 00005 00006 Redistribution and use in source and binary forms, with or without 00007 modification, are permitted provided that the following conditions are met: 00008 - Redistributions of source code must retain the above copyright 00009 notice, this list of conditions and the following disclaimer. 00010 - Redistributions in binary form must reproduce the above copyright 00011 notice, this list of conditions and the following disclaimer in 00012 the documentation and/or other materials provided with the 00013 distribution. 00014 - Neither the name of Analog Devices, Inc. nor the names of its 00015 contributors may be used to endorse or promote products derived 00016 from this software without specific prior written permission. 00017 - The use of this software may or may not infringe the patent rights 00018 of one or more patent holders. This license does not release you 00019 from the requirement that you obtain separate licenses from these 00020 patent holders to use this software. 00021 - Use of the software either in source or binary form, must be run 00022 on or directly connected to an Analog Devices Inc. component. 00023 00024 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR 00025 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, 00026 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 00027 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, 00028 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00029 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR 00030 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00031 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00032 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00033 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00034 */ 00035 00036 /*! 00037 ****************************************************************************** 00038 * @file: utils.h 00039 * @brief: Interface Utilities for ADMW1001 00040 *----------------------------------------------------------------------------- 00041 */ 00042 #ifndef __UTILS_H__ 00043 #define __UTILS_H__ 00044 00045 #include "admw_api.h" 00046 #include "admw1001/admw1001_api.h" 00047 00048 #ifdef __cplusplus 00049 extern "C" { 00050 #endif 00051 00052 /* Utility function to print the status read from the ADMW1001 device */ 00053 void utils_printStatus( 00054 ADMW_STATUS *pStatus); 00055 00056 /* Utility function to print data samples read from the ADMW1001 device */ 00057 void utils_printSamples( 00058 ADMW_DATA_SAMPLE *pSampleBuffer, 00059 uint32_t nNumSamples, 00060 ADMW_MEASUREMENT_MODE eMeasurementMode); 00061 00062 /* Utility function to register callbacks for ADMW1001 device notification signals */ 00063 ADMW_RESULT utils_registerCallbacks( 00064 ADMW_DEVICE_HANDLE hDevice, 00065 volatile bool *pbDataReady, 00066 volatile bool *pbError, 00067 volatile bool *pbAlert); 00068 00069 /* Utility function to de-register callbacks for ADMW1001 device notification signals */ 00070 ADMW_RESULT utils_deregisterCallbacks( 00071 ADMW_DEVICE_HANDLE hDevice); 00072 00073 /* Utility function to run measurements on ADMW1001 device, according to its current 00074 * configuration, and display data samples and device status following each cycle */ 00075 ADMW_RESULT utils_runMeasurement( 00076 ADMW_DEVICE_HANDLE hDevice, 00077 ADMW_MEASUREMENT_MODE eMeasurementMode); 00078 00079 /* Utility function to retrieve and print the factory calibration coefficients table from the ADMW1001 device */ 00080 ADMW_RESULT utils_printCalTable( 00081 ADMW_DEVICE_HANDLE hDevice); 00082 00083 #ifdef __cplusplus 00084 } 00085 #endif 00086 00087 #endif /* __UTILS_H__ */ 00088
Generated on Wed Jul 13 2022 03:04:54 by 1.7.2