/** * @file lime/LimeSuite.h * * @brief LMS API library * * Copyright (C) 2016 Lime Microsystems * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef LMS7_API_H #define LMS7_API_H #include #include #include "LMS7002M_parameters.h" #ifdef __cplusplus extern "C" { #else /* stdbool.h is not applicable for C++ programs, as the language inherently * provides the bool type. * * Users of Visual Studio 2012 and earlier will need to supply a stdbool.h * implementation, as it is not included with the toolchain. Visual Studio 2013 * onward supplies this header. */ #include #endif #if defined _WIN32 || defined __CYGWIN__ # define CALL_CONV __cdecl # ifdef __GNUC__ # define API_EXPORT __attribute__ ((dllexport)) # else # define API_EXPORT __declspec(dllexport) # endif #elif defined _DOXYGEN_ONLY_ /** Marks an API routine to be made visible to the dynamic loader. * This is OS and/or compiler-specific. */ # define API_EXPORT /** Specifies calling convention, if necessary. * This is OS and/or compiler-specific. */ # define CALL_CONV #else # define API_EXPORT __attribute__ ((visibility ("default"))) # define CALL_CONV #endif ///Floating point data type typedef double float_type; ///convenience constant for good return code static const int LMS_SUCCESS = 0; /** * @defgroup FN_INIT Initialization/deinitialization * * The functions in this section provide the ability to query available devices, * initialize them, and deinitialize them. * @{ */ ///LMS Device handle typedef void lms_device_t; ///Convenience type for fixed length LMS Device information string typedef char lms_info_str_t[256]; /** * Obtain a list of LMS devices attached to the system * * @param[out] dev_list List of available devices * * @return number of devices in the list on success, (-1) on failure */ API_EXPORT int CALL_CONV LMS_GetDeviceList(lms_info_str_t *dev_list); /** * Opens device specified by the provided ::lms_info_str_t string * This function should be used to open a device based upon the results of * LMS_GetDeviceList() * * @pre device should be initialized to NULL * * @param[out] device Updated with device handle on success * @param[in] info Device information string. If NULL, the first * available device will be opened. * @param[in] args additional arguments. Can be NULL. * * @return 0 on success, (-1) on failure */ API_EXPORT int CALL_CONV LMS_Open(lms_device_t **device, const lms_info_str_t info, void* args); /** * Close device * * @post device is deallocated and may no longer be used. * * @param device Device handle previously obtained by LMS_Open(). * * @return 0 on success, (-1) on failure */ API_EXPORT int CALL_CONV LMS_Close(lms_device_t *device); /** @} (End FN_INIT) */ /** * @defgroup FN_HIGH_LVL High-level control functions * * The functions in this section provide the ability to easily configure the * device for operation. They modify multiple internal device settings. * * @{ */ static const bool LMS_CH_TX = true; ///