Revision f0dd1ac4 drivers/VL53L1X/v1/alld_VL53L1X.h
drivers/VL53L1X/v1/alld_VL53L1X.h | ||
---|---|---|
1 |
/* |
|
2 |
AMiRo-LLD is a compilation of low-level hardware drivers for the Autonomous Mini Robot (AMiRo) platform. |
|
3 |
Copyright (C) 2016..2020 Thomas Schöpping et al. |
|
4 |
|
|
5 |
This program is free software: you can redistribute it and/or modify |
|
6 |
it under the terms of the GNU Lesser General Public License as published by |
|
7 |
the Free Software Foundation, either version 3 of the License, or |
|
8 |
(at your option) any later version. |
|
9 |
|
|
10 |
This program is distributed in the hope that it will be useful, |
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
GNU Lesser General Public License for more details. |
|
14 |
|
|
15 |
You should have received a copy of the GNU Lesser General Public License |
|
16 |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
17 |
*/ |
|
18 |
|
|
1 | 19 |
/** |
2 | 20 |
* @file alld_VL53L1X.h |
3 |
* @brief Touch sensor macros and structures.
|
|
21 |
* @brief ToF sensor macros and structures.
|
|
4 | 22 |
* |
5 |
* @addtogroup lld_touch
|
|
23 |
* @addtogroup lld_vl53l1x
|
|
6 | 24 |
* @{ |
7 | 25 |
*/ |
8 | 26 |
|
... | ... | |
10 | 28 |
#define AMIROLLD_VL53L1X_H |
11 | 29 |
|
12 | 30 |
#include <amiro-lld.h> |
13 |
#include <alld_VL53L1X_types.h> |
|
14 | 31 |
#include <vl53l1_api.h> |
32 |
|
|
15 | 33 |
/******************************************************************************/ |
16 | 34 |
/* CONSTANTS */ |
17 | 35 |
/******************************************************************************/ |
18 |
// 400kHz |
|
19 |
#define VL53L1X_LLD_I2C_MAXFREQUENCY 400000 |
|
20 | 36 |
|
21 |
/* Default I2C address */ |
|
22 |
/* #define VL53L1X_LLD_I2C_ADDR_DEFAULT 0x52 */ |
|
23 |
#define VL53L1X_LLD_I2C_ADDR_DEFAULT 0x29 |
|
37 |
/** |
|
38 |
* @brief Maximum I2C frequency (in Hz). |
|
39 |
*/ |
|
40 |
#define VL53L1X_LLD_I2C_MAXFREQUENCY 1000000 |
|
24 | 41 |
|
25 |
#define VL53L1X_LLD_BOOTDURATION 1200 |
|
42 |
/** |
|
43 |
* @brief Default I2C address. |
|
44 |
*/ |
|
45 |
#define VL53L1X_LLD_I2C_ADDR_DEFAULT 0x29 |
|
26 | 46 |
|
27 | 47 |
/******************************************************************************/ |
28 | 48 |
/* SETTINGS */ |
... | ... | |
36 | 56 |
/* DATA STRUCTURES AND TYPES */ |
37 | 57 |
/******************************************************************************/ |
38 | 58 |
|
59 |
/* |
|
60 |
* Structures and types are declared in a separate file, because ST API requires |
|
61 |
* this information, too. |
|
62 |
*/ |
|
63 |
#include <vl53l1_platform_user_data.h> |
|
64 |
|
|
39 | 65 |
/** |
40 |
* @brief The state of the GPIOs. |
|
66 |
* @brief The state of the VL53L1X device. |
|
67 |
* @details Represents the state of the XSHUT signal. |
|
41 | 68 |
*/ |
42 | 69 |
typedef enum { |
43 |
GPIO_LLD_STATE_OFF = 0x00, /**< 'on' state of the LED */
|
|
44 |
GPIO_LLD_STATE_ON = 0x01, /**< 'off' state of the LED */
|
|
45 |
} gpio_lld_state_t;
|
|
70 |
VL53L1X_LLD_STATE_OFF = 0x00, /**< Device is deactivated via XSHUT signal. */
|
|
71 |
VL53L1X_LLD_STATE_ON = 0x01, /**< Device is active according to XSHUT signal. */
|
|
72 |
} vl53l1x_lld_state_t;
|
|
46 | 73 |
|
47 | 74 |
/******************************************************************************/ |
48 | 75 |
/* MACROS */ |
... | ... | |
55 | 82 |
#ifdef __cplusplus |
56 | 83 |
extern "C" { |
57 | 84 |
#endif |
58 |
apalExitStatus_t hello_world(void);
|
|
59 |
apalExitStatus_t vl53l1x_GPIO1_set(const VL53L1XDriver* const vlx, const gpio_lld_state_t state);
|
|
60 |
|
|
85 |
apalExitStatus_t vl53l1x_lld_getState(VL53L1XDriver* vl53l1x, vl53l1x_lld_state_t* state);
|
|
86 |
apalExitStatus_t vl53l1x_lld_init(VL53L1XDriver* vl53l1x);
|
|
87 |
apalExitStatus_t vl53l1x_lld_reset(VL53L1XDriver* vl53l1x); |
|
61 | 88 |
#ifdef __cplusplus |
62 | 89 |
} |
63 | 90 |
#endif |
64 | 91 |
|
65 |
|
|
66 | 92 |
/******************************************************************************/ |
67 | 93 |
/* INLINE FUNCTIONS */ |
68 | 94 |
/******************************************************************************/ |
69 | 95 |
|
70 |
|
|
71 |
|
|
72 | 96 |
#endif /* AMIROLLD_VL53L1X_H */ |
97 |
|
|
98 |
/** @} */ |
Also available in: Unified diff