Statistics
| Branch: | Tag: | Revision:

amiro-lld / drivers / VL53L1X / v1 / api / platform / vl53l1_platform_user_defines.h @ 3ed0cc4d

History | View | Annotate | Download (4.688 KB)

1 4dba9195 galberding
/*
2
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
3
*
4
* This file is part of VL53L1 Core and is dual licensed,
5
* either 'STMicroelectronics
6
* Proprietary license'
7
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
8
*
9
********************************************************************************
10
*
11
* 'STMicroelectronics Proprietary license'
12
*
13
********************************************************************************
14
*
15
* License terms: STMicroelectronics Proprietary in accordance with licensing
16
* terms at www.st.com/sla0081
17
*
18
* STMicroelectronics confidential
19
* Reproduction and Communication of this document is strictly prohibited unless
20
* specifically authorized in writing by STMicroelectronics.
21
*
22
*
23
********************************************************************************
24
*
25
* Alternatively, VL53L1 Core may be distributed under the terms of
26
* 'BSD 3-clause "New" or "Revised" License', in which case the following
27
* provisions apply instead of the ones mentioned above :
28
*
29
********************************************************************************
30
*
31
* License terms: BSD 3-clause "New" or "Revised" License.
32
*
33
* Redistribution and use in source and binary forms, with or without
34
* modification, are permitted provided that the following conditions are met:
35
*
36
* 1. Redistributions of source code must retain the above copyright notice, this
37
* list of conditions and the following disclaimer.
38
*
39
* 2. Redistributions in binary form must reproduce the above copyright notice,
40
* this list of conditions and the following disclaimer in the documentation
41
* and/or other materials provided with the distribution.
42
*
43
* 3. Neither the name of the copyright holder nor the names of its contributors
44
* may be used to endorse or promote products derived from this software
45
* without specific prior written permission.
46
*
47
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
48
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
49
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
50
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
51
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
52
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
53
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
54
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
55
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
56
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
57
*
58
*
59
********************************************************************************
60
*
61 3ed0cc4d Thomas Schöpping
* Modified for use within AMiRo-LLD.
62
*
63
* AMiRo-LLD is a compilation of low-level hardware drivers for the Autonomous
64
* Mini Robot (AMiRo) platform.
65
* Copyright (C) 2016..2019  Thomas Schöpping et al.
66
*
67
********************************************************************************
68
*
69 4dba9195 galberding
*/
70
71
72
#ifndef _VL53L1_PLATFORM_USER_DEFINES_H_
73
#define _VL53L1_PLATFORM_USER_DEFINES_H_
74
75 3ed0cc4d Thomas Schöpping
#include <amiro-lld.h>
76
77 4dba9195 galberding
#ifdef __cplusplus
78
extern "C"
79
{
80
#endif
81
82
/**
83
 * @file   vl53l1_platform_user_defines.h
84
 *
85
 * @brief  All end user OS/platform/application definitions
86
 */
87
88 3ed0cc4d Thomas Schöpping
/**
89
 * @brief   Flag to set I2C signal level to 2.8V instead of 1.8V.
90
 */
91
#if (defined(VL53L1X_LLD_I2C_2V8) && (VL53L1X_LLD_I2C_2V8 == true)) || defined(__DOXYGEN__)
92
# define USE_I2C_2V8
93
#endif
94 4dba9195 galberding
95
/**
96
 * @def do_division_u
97
 * @brief customer supplied division operation - 64-bit unsigned
98
 *
99
 * @param dividend      unsigned 64-bit numerator
100
 * @param divisor       unsigned 64-bit denominator
101
 */
102
#define do_division_u(dividend, divisor) (dividend / divisor)
103
104
105
/**
106
 * @def do_division_s
107
 * @brief customer supplied division operation - 64-bit signed
108
 *
109
 * @param dividend      signed 64-bit numerator
110
 * @param divisor       signed 64-bit denominator
111
 */
112
#define do_division_s(dividend, divisor) (dividend / divisor)
113
114
115
/**
116
 * @def WARN_OVERRIDE_STATUS
117
 * @brief customer supplied macro to optionally output info when a specific
118
          error has been overridden with success within the EwokPlus driver
119
 *
120
 * @param __X__      the macro which enabled the suppression
121
 */
122
#define WARN_OVERRIDE_STATUS(__X__)\
123
        trace_print (VL53L1_TRACE_LEVEL_WARNING, #__X__);
124
125
126
#ifdef _MSC_VER
127
#define DISABLE_WARNINGS() { \
128
        __pragma (warning (push)); \
129
        __pragma (warning (disable:4127)); \
130
        }
131
#define ENABLE_WARNINGS() { \
132
        __pragma (warning (pop)); \
133
        }
134
#else
135
        #define DISABLE_WARNINGS()
136
        #define ENABLE_WARNINGS()
137
#endif
138
139
140
#ifdef __cplusplus
141
}
142
#endif
143
144 3ed0cc4d Thomas Schöpping
#endif /* _VL53L1_PLATFORM_USER_DEFINES_H_ */