Statistics
| Branch: | Tag: | Revision:

amiro-lld / drivers / VL53L1X / v1 / alld_VL53L1X.h @ f0dd1ac4

History | View | Annotate | Download (3.633 KB)

1 f0dd1ac4 Thomas Schöpping
/*
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
19 4dba9195 galberding
/**
20
 * @file    alld_VL53L1X.h
21 f0dd1ac4 Thomas Schöpping
 * @brief   ToF sensor macros and structures.
22 4dba9195 galberding
 *
23 f0dd1ac4 Thomas Schöpping
 * @addtogroup lld_vl53l1x
24 4dba9195 galberding
 * @{
25
 */
26
27
#ifndef AMIROLLD_VL53L1X_H
28
#define AMIROLLD_VL53L1X_H
29
30
#include <amiro-lld.h>
31
#include <vl53l1_api.h>
32 f0dd1ac4 Thomas Schöpping
33 4dba9195 galberding
/******************************************************************************/
34
/* CONSTANTS                                                                  */
35
/******************************************************************************/
36
37 f0dd1ac4 Thomas Schöpping
/**
38
 * @brief   Maximum I2C frequency (in Hz).
39
 */
40
#define VL53L1X_LLD_I2C_MAXFREQUENCY            1000000
41 4dba9195 galberding
42 f0dd1ac4 Thomas Schöpping
/**
43
 * @brief   Default I2C address.
44
 */
45
#define VL53L1X_LLD_I2C_ADDR_DEFAULT            0x29
46 4dba9195 galberding
47
/******************************************************************************/
48
/* SETTINGS                                                                   */
49
/******************************************************************************/
50
51
/******************************************************************************/
52
/* CHECKS                                                                     */
53
/******************************************************************************/
54
55
/******************************************************************************/
56
/* DATA STRUCTURES AND TYPES                                                  */
57
/******************************************************************************/
58
59 f0dd1ac4 Thomas Schöpping
/*
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
65 4dba9195 galberding
/**
66 f0dd1ac4 Thomas Schöpping
 * @brief   The state of the VL53L1X device.
67
 * @details Represents the state of the XSHUT signal.
68 4dba9195 galberding
 */
69
typedef enum {
70 f0dd1ac4 Thomas Schöpping
  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;
73 4dba9195 galberding
74
/******************************************************************************/
75
/* MACROS                                                                     */
76
/******************************************************************************/
77
78
/******************************************************************************/
79
/* EXTERN DECLARATIONS                                                        */
80
/******************************************************************************/
81
82
#ifdef __cplusplus
83
extern "C" {
84
#endif
85 f0dd1ac4 Thomas Schöpping
  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);
88 4dba9195 galberding
#ifdef __cplusplus
89
}
90
#endif
91
92
/******************************************************************************/
93
/* INLINE FUNCTIONS                                                           */
94
/******************************************************************************/
95
96
#endif /* AMIROLLD_VL53L1X_H */
97 f0dd1ac4 Thomas Schöpping
98
/** @} */