Paparazzi UAS
v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
vl53l1_platform.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2020 Tom van Dijk <tomvand@users.noreply.github.com>
3
* Adapted from STSW-IMG009 vl53l1_platform.h
4
*
5
* This file is part of paparazzi.
6
*
7
* paparazzi is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2, or (at your option)
10
* any later version.
11
*
12
* paparazzi is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with paparazzi; see the file COPYING. If not, write to
19
* the Free Software Foundation, 59 Temple Place - Suite 330,
20
* Boston, MA 02111-1307, USA.
21
*
22
*/
28
#ifndef _VL53L1_PLATFORM_H_
29
#define _VL53L1_PLATFORM_H_
30
31
#include "
vl53l1_types.h
"
32
33
#include "
mcu_periph/i2c.h
"
34
35
#ifdef __cplusplus
36
extern
"C"
37
{
38
#endif
39
40
#define VL53L1_DEFAULT_ADDRESS 0x52
41
42
enum
VL53L1_ReadStatus
{
43
VL53L1_READ_IDLE
,
44
VL53L1_READ_DATA_READY
,
45
VL53L1_READ_STATUS
,
46
VL53L1_READ_DISTANCE
,
47
VL53L1_CLEAR_INT
48
};
49
50
typedef
struct
{
51
struct
i2c_periph
*
i2c_p
;
52
struct
i2c_transaction
i2c_trans;
53
struct
NonBlocking
{
54
/* I2C Read/write state machine */
55
uint8_t
i2c_state
;
56
/* State machine for nonblocking functions */
57
uint8_t
state
;
58
uint8_t
IntPol
;
59
} nonblocking;
60
enum
VL53L1_ReadStatus
read_status;
61
}
VL53L1_Dev_t
;
62
63
typedef
VL53L1_Dev_t
*
VL53L1_DEV
;
64
68
int8_t
VL53L1_WriteMulti
(
69
VL53L1_DEV
dev
,
70
uint16_t
index,
71
uint8_t
*pdata,
72
uint32_t
count);
76
int8_t
VL53L1_ReadMulti
(
77
VL53L1_DEV
dev
,
78
uint16_t
index,
79
uint8_t
*pdata,
80
uint32_t
count);
84
int8_t
VL53L1_WrByte
(
85
VL53L1_DEV
dev
,
86
uint16_t
index,
87
uint8_t
data);
91
int8_t
VL53L1_WrWord
(
92
VL53L1_DEV
dev
,
93
uint16_t
index,
94
uint16_t
data);
98
int8_t
VL53L1_WrDWord
(
99
VL53L1_DEV
dev
,
100
uint16_t
index,
101
uint32_t
data);
105
int8_t
VL53L1_RdByte
(
106
VL53L1_DEV
dev
,
107
uint16_t
index,
108
uint8_t
*pdata);
112
int8_t
VL53L1_RdWord
(
113
VL53L1_DEV
dev
,
114
uint16_t
index,
115
uint16_t
*pdata);
119
int8_t
VL53L1_RdDWord
(
120
VL53L1_DEV
dev
,
121
uint16_t
index,
122
uint32_t
*pdata);
123
124
125
#ifdef __cplusplus
126
}
127
#endif
128
129
#endif
VL53L1_READ_STATUS
Definition:
vl53l1_platform.h:45
uint16_t
unsigned short uint16_t
Definition:
types.h:16
VL53L1_RdDWord
int8_t VL53L1_RdDWord(VL53L1_DEV dev, uint16_t index, uint32_t *pdata)
VL53L1_RdDWord() definition.
Definition:
vl53l1_platform.c:102
VL53L1_WrWord
int8_t VL53L1_WrWord(VL53L1_DEV dev, uint16_t index, uint16_t data)
VL53L1_WrWord() definition.
Definition:
vl53l1_platform.c:69
VL53L1_Dev_t::NonBlocking::i2c_state
uint8_t i2c_state
Definition:
vl53l1_platform.h:55
VL53L1_WrByte
int8_t VL53L1_WrByte(VL53L1_DEV dev, uint16_t index, uint8_t data)
VL53L1_WrByte() definition.
Definition:
vl53l1_platform.c:64
VL53L1_WriteMulti
int8_t VL53L1_WriteMulti(VL53L1_DEV dev, uint16_t index, uint8_t *pdata, uint32_t count)
VL53L1_WriteMulti() definition.
Definition:
vl53l1_platform.c:43
VL53L1_WrDWord
int8_t VL53L1_WrDWord(VL53L1_DEV dev, uint16_t index, uint32_t data)
VL53L1_WrDWord() definition.
Definition:
vl53l1_platform.c:78
VL53L1_READ_DISTANCE
Definition:
vl53l1_platform.h:46
VL53L1_Dev_t::NonBlocking
Definition:
vl53l1_platform.h:53
VL53L1_Dev_t::NonBlocking::state
uint8_t state
Definition:
vl53l1_platform.h:57
VL53L1_READ_IDLE
Definition:
vl53l1_platform.h:43
uint32_t
unsigned long uint32_t
Definition:
types.h:18
VL53L1_RdByte
int8_t VL53L1_RdByte(VL53L1_DEV dev, uint16_t index, uint8_t *pdata)
VL53L1_RdByte() definition.
Definition:
vl53l1_platform.c:89
i2c_transaction
I2C transaction structure.
Definition:
i2c.h:93
VL53L1_ReadStatus
VL53L1_ReadStatus
Definition:
vl53l1_platform.h:42
VL53L1_Dev_t
Definition:
vl53l1_platform.h:50
vl53l1_types.h
VL53L1 types definition.
dev
static const struct usb_device_descriptor dev
Definition:
usb_ser_hw.c:73
VL53L1_Dev_t::i2c_p
struct i2c_periph * i2c_p
Definition:
vl53l1_platform.h:51
i2c_periph
Definition:
i2c.h:144
uint8_t
unsigned char uint8_t
Definition:
types.h:14
VL53L1_Dev_t::NonBlocking::IntPol
uint8_t IntPol
Definition:
vl53l1_platform.h:58
VL53L1_READ_DATA_READY
Definition:
vl53l1_platform.h:44
VL53L1_CLEAR_INT
Definition:
vl53l1_platform.h:47
VL53L1_DEV
VL53L1_Dev_t * VL53L1_DEV
Definition:
vl53l1_platform.h:63
int8_t
signed char int8_t
Definition:
types.h:15
VL53L1_ReadMulti
int8_t VL53L1_ReadMulti(VL53L1_DEV dev, uint16_t index, uint8_t *pdata, uint32_t count)
VL53L1_ReadMulti() definition.
Definition:
vl53l1_platform.c:53
VL53L1_RdWord
int8_t VL53L1_RdWord(VL53L1_DEV dev, uint16_t index, uint16_t *pdata)
VL53L1_RdWord() definition.
Definition:
vl53l1_platform.c:94
i2c.h
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
sw
airborne
peripherals
vl53l1_platform.h
Generated on Wed Feb 10 2021 04:34:18 for Paparazzi UAS by
1.8.8