Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
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 
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 */
56  /* State machine for nonblocking functions */
59  } nonblocking;
60  enum VL53L1_ReadStatus read_status;
61 } VL53L1_Dev_t;
62 
64 
70  uint16_t index,
71  uint8_t *pdata,
72  uint32_t count);
78  uint16_t index,
79  uint8_t *pdata,
80  uint32_t count);
86  uint16_t index,
87  uint8_t data);
93  uint16_t index,
94  uint16_t data);
100  uint16_t index,
101  uint32_t data);
106  VL53L1_DEV dev,
107  uint16_t index,
108  uint8_t *pdata);
113  VL53L1_DEV dev,
114  uint16_t index,
115  uint16_t *pdata);
120  VL53L1_DEV dev,
121  uint16_t index,
122  uint32_t *pdata);
123 
124 
125 #ifdef __cplusplus
126 }
127 #endif
128 
129 #endif
I2C transaction structure.
Definition: i2c.h:93
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
static const struct usb_device_descriptor dev
Definition: usb_ser_hw.c:74
int8_t VL53L1_WrWord(VL53L1_DEV dev, uint16_t index, uint16_t data)
VL53L1_WrWord() definition.
int8_t VL53L1_WriteMulti(VL53L1_DEV dev, uint16_t index, uint8_t *pdata, uint32_t count)
VL53L1_WriteMulti() definition.
int8_t VL53L1_WrByte(VL53L1_DEV dev, uint16_t index, uint8_t data)
VL53L1_WrByte() definition.
struct i2c_periph * i2c_p
VL53L1_ReadStatus
@ VL53L1_READ_DATA_READY
@ VL53L1_READ_STATUS
@ VL53L1_READ_DISTANCE
@ VL53L1_CLEAR_INT
@ VL53L1_READ_IDLE
int8_t VL53L1_RdByte(VL53L1_DEV dev, uint16_t index, uint8_t *pdata)
VL53L1_RdByte() definition.
int8_t VL53L1_WrDWord(VL53L1_DEV dev, uint16_t index, uint32_t data)
VL53L1_WrDWord() definition.
int8_t VL53L1_ReadMulti(VL53L1_DEV dev, uint16_t index, uint8_t *pdata, uint32_t count)
VL53L1_ReadMulti() definition.
int8_t VL53L1_RdWord(VL53L1_DEV dev, uint16_t index, uint16_t *pdata)
VL53L1_RdWord() definition.
int8_t VL53L1_RdDWord(VL53L1_DEV dev, uint16_t index, uint32_t *pdata)
VL53L1_RdDWord() definition.
VL53L1_Dev_t * VL53L1_DEV
VL53L1 types definition.
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
Definition: vl53l1_types.h:88
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
Definition: vl53l1_types.h:78
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98
signed char int8_t
Typedef defining 8 bit char type.
Definition: vl53l1_types.h:103