INSAT Mini Project
Dependencies: ST_INTERFACES X_NUCLEO_COMMON
Fork of X_NUCLEO_6180XA1 by
Components/VL6180X/vl6180x_api.h@8:f943a1fca15f, 2015-09-29 (annotated)
- Committer:
- licio.mapelli@st.com
- Date:
- Tue Sep 29 14:50:15 2015 +0200
- Revision:
- 8:f943a1fca15f
- Parent:
- 7:2dc81120c917
- Child:
- 10:4954b09b72d8
fixed i2c functions and code cleanup
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gallonm | 1:1de1ea2994d9 | 1 | /******************************************************************************* |
gallonm | 1:1de1ea2994d9 | 2 | Copyright © 2014, STMicroelectronics International N.V. |
gallonm | 1:1de1ea2994d9 | 3 | All rights reserved. |
gallonm | 1:1de1ea2994d9 | 4 | |
gallonm | 1:1de1ea2994d9 | 5 | Redistribution and use in source and binary forms, with or without |
gallonm | 1:1de1ea2994d9 | 6 | modification, are permitted provided that the following conditions are met: |
gallonm | 1:1de1ea2994d9 | 7 | * Redistributions of source code must retain the above copyright |
gallonm | 1:1de1ea2994d9 | 8 | notice, this list of conditions and the following disclaimer. |
gallonm | 1:1de1ea2994d9 | 9 | * Redistributions in binary form must reproduce the above copyright |
gallonm | 1:1de1ea2994d9 | 10 | notice, this list of conditions and the following disclaimer in the |
gallonm | 1:1de1ea2994d9 | 11 | documentation and/or other materials provided with the distribution. |
gallonm | 1:1de1ea2994d9 | 12 | * Neither the name of STMicroelectronics nor the |
gallonm | 1:1de1ea2994d9 | 13 | names of its contributors may be used to endorse or promote products |
gallonm | 1:1de1ea2994d9 | 14 | derived from this software without specific prior written permission. |
gallonm | 1:1de1ea2994d9 | 15 | |
gallonm | 1:1de1ea2994d9 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
gallonm | 1:1de1ea2994d9 | 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
gallonm | 1:1de1ea2994d9 | 18 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND |
gallonm | 1:1de1ea2994d9 | 19 | NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED. |
gallonm | 1:1de1ea2994d9 | 20 | IN NO EVENT SHALL STMICROELECTRONICS INTERNATIONAL N.V. BE LIABLE FOR ANY |
gallonm | 1:1de1ea2994d9 | 21 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
gallonm | 1:1de1ea2994d9 | 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
gallonm | 1:1de1ea2994d9 | 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
gallonm | 1:1de1ea2994d9 | 24 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
gallonm | 1:1de1ea2994d9 | 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
gallonm | 1:1de1ea2994d9 | 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
gallonm | 1:1de1ea2994d9 | 27 | ********************************************************************************/ |
gallonm | 1:1de1ea2994d9 | 28 | /* |
gallonm | 1:1de1ea2994d9 | 29 | * @file VL6180x_api.h |
gallonm | 1:1de1ea2994d9 | 30 | * $Date: 2015-03-24 14:15:14 +0100 (Tue, 24 Mar 2015) $ |
gallonm | 1:1de1ea2994d9 | 31 | * $Revision: 2213 $ |
gallonm | 1:1de1ea2994d9 | 32 | */ |
gallonm | 1:1de1ea2994d9 | 33 | |
gallonm | 1:1de1ea2994d9 | 34 | |
gallonm | 1:1de1ea2994d9 | 35 | |
gallonm | 1:1de1ea2994d9 | 36 | #ifndef VL6180x_API_H_ |
gallonm | 1:1de1ea2994d9 | 37 | #define VL6180x_API_H_ |
gallonm | 1:1de1ea2994d9 | 38 | |
gallonm | 1:1de1ea2994d9 | 39 | #include "vl6180x_def.h" |
gallonm | 1:1de1ea2994d9 | 40 | #include "vl6180x_platform.h" |
gallonm | 1:1de1ea2994d9 | 41 | |
gallonm | 1:1de1ea2994d9 | 42 | #ifdef __cplusplus |
gallonm | 1:1de1ea2994d9 | 43 | extern "C" { |
gallonm | 1:1de1ea2994d9 | 44 | #endif |
gallonm | 1:1de1ea2994d9 | 45 | |
gallonm | 1:1de1ea2994d9 | 46 | /** @defgroup api_ll API Low Level Functions |
gallonm | 1:1de1ea2994d9 | 47 | * @brief API Low level functions |
gallonm | 1:1de1ea2994d9 | 48 | */ |
gallonm | 1:1de1ea2994d9 | 49 | |
gallonm | 1:1de1ea2994d9 | 50 | /** @defgroup api_hl API High Level Functions |
gallonm | 1:1de1ea2994d9 | 51 | * @brief API High level functions |
gallonm | 1:1de1ea2994d9 | 52 | */ |
gallonm | 1:1de1ea2994d9 | 53 | |
gallonm | 1:1de1ea2994d9 | 54 | |
gallonm | 1:1de1ea2994d9 | 55 | #ifndef VL6180x_RANGE_STATUS_ERRSTRING |
gallonm | 1:1de1ea2994d9 | 56 | #warning "VL6180x_RANGE_STATUS_ERRSTRING not defined ?" |
gallonm | 1:1de1ea2994d9 | 57 | /* TODO you may remove or comment these #warning and keep the default below to keep compatibility |
gallonm | 1:1de1ea2994d9 | 58 | or update your vl6180x_platform.h file */ |
gallonm | 1:1de1ea2994d9 | 59 | /** |
gallonm | 1:1de1ea2994d9 | 60 | * force VL6180x_RANGE_STATUS_ERRSTRING to not supported when not part of any cfg file |
gallonm | 1:1de1ea2994d9 | 61 | */ |
gallonm | 1:1de1ea2994d9 | 62 | #define VL6180x_RANGE_STATUS_ERRSTRING 0 |
gallonm | 1:1de1ea2994d9 | 63 | #endif |
gallonm | 1:1de1ea2994d9 | 64 | |
gallonm | 1:1de1ea2994d9 | 65 | #ifndef VL6180X_SAFE_POLLING_ENTER |
gallonm | 1:1de1ea2994d9 | 66 | #warning "VL6180X_SAFE_POLLING_ENTER not defined, likely old vl6180x_cfg.h file ?" |
gallonm | 1:1de1ea2994d9 | 67 | /* TODO you may remove or comment these #warning and keep the default below to keep compatibility |
gallonm | 1:1de1ea2994d9 | 68 | or update your vl6180x_platform.h file */ |
gallonm | 1:1de1ea2994d9 | 69 | /** |
gallonm | 1:1de1ea2994d9 | 70 | * force VL6180X_SAFE_POLLING_ENTER to off when not in cfg file |
gallonm | 1:1de1ea2994d9 | 71 | */ |
gallonm | 1:1de1ea2994d9 | 72 | #define VL6180X_SAFE_POLLING_ENTER 0 /* off by default as in api 2.0 */ |
gallonm | 1:1de1ea2994d9 | 73 | #endif |
gallonm | 1:1de1ea2994d9 | 74 | |
gallonm | 1:1de1ea2994d9 | 75 | #ifndef VL6180X_LOG_ENABLE |
gallonm | 1:1de1ea2994d9 | 76 | /** |
gallonm | 1:1de1ea2994d9 | 77 | * Force VL6180X_LOG_ENABLE to none as default |
gallonm | 1:1de1ea2994d9 | 78 | */ |
gallonm | 1:1de1ea2994d9 | 79 | #define VL6180X_LOG_ENABLE 0 |
gallonm | 1:1de1ea2994d9 | 80 | #endif |
gallonm | 1:1de1ea2994d9 | 81 | |
gallonm | 1:1de1ea2994d9 | 82 | #if VL6180x_RANGE_STATUS_ERRSTRING |
gallonm | 1:1de1ea2994d9 | 83 | /**@def VL6180x_HAVE_RANGE_STATUS_ERRSTRING |
gallonm | 1:1de1ea2994d9 | 84 | * @brief is defined when @a #VL6180x_RANGE_STATUS_ERRSTRING is enable |
gallonm | 1:1de1ea2994d9 | 85 | */ |
gallonm | 1:1de1ea2994d9 | 86 | #define VL6180x_HAVE_RANGE_STATUS_ERRSTRING |
gallonm | 1:1de1ea2994d9 | 87 | #endif |
gallonm | 1:1de1ea2994d9 | 88 | |
gallonm | 1:1de1ea2994d9 | 89 | |
gallonm | 1:1de1ea2994d9 | 90 | /** @brief Get API version as "hex integer" 0xMMnnss |
gallonm | 1:1de1ea2994d9 | 91 | */ |
gallonm | 1:1de1ea2994d9 | 92 | #define VL6180x_ApiRevInt ((VL6180x_API_REV_MAJOR<<24)+(VL6180x_API_REV_MINOR<<16)+VL6180x_API_REV_SUB) |
gallonm | 1:1de1ea2994d9 | 93 | |
gallonm | 1:1de1ea2994d9 | 94 | /** Get API version as string for exe "2.1.12" " |
gallonm | 1:1de1ea2994d9 | 95 | */ |
gallonm | 1:1de1ea2994d9 | 96 | #define VL6180x_ApiRevStr VL6180X_STR(VL6180x_API_REV_MAJOR) "." VL6180X_STR(VL6180x_API_REV_MINOR) "." VL6180X_STR(VL6180x_API_REV_SUB) |
gallonm | 1:1de1ea2994d9 | 97 | |
gallonm | 1:1de1ea2994d9 | 98 | /** @defgroup api_init Init functions |
gallonm | 1:1de1ea2994d9 | 99 | * @brief API init functions |
gallonm | 1:1de1ea2994d9 | 100 | * @ingroup api_hl |
gallonm | 1:1de1ea2994d9 | 101 | * @{ |
gallonm | 1:1de1ea2994d9 | 102 | */ |
gallonm | 1:1de1ea2994d9 | 103 | |
gallonm | 1:1de1ea2994d9 | 104 | |
gallonm | 1:1de1ea2994d9 | 105 | #ifdef __cplusplus |
gallonm | 1:1de1ea2994d9 | 106 | } |
gallonm | 1:1de1ea2994d9 | 107 | #endif |
gallonm | 1:1de1ea2994d9 | 108 | |
gallonm | 1:1de1ea2994d9 | 109 | #endif /* VL6180x_API_H_ */ |