Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 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 
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 
69  VL53L1_DEV dev,
70  uint16_t index,
71  uint8_t *pdata,
72  uint32_t count);
77  VL53L1_DEV dev,
78  uint16_t index,
79  uint8_t *pdata,
80  uint32_t count);
85  VL53L1_DEV dev,
86  uint16_t index,
87  uint8_t data);
92  VL53L1_DEV dev,
93  uint16_t index,
94  uint16_t data);
99  VL53L1_DEV dev,
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
unsigned short uint16_t
Definition: types.h:16
int8_t VL53L1_RdDWord(VL53L1_DEV dev, uint16_t index, uint32_t *pdata)
VL53L1_RdDWord() definition.
int8_t VL53L1_WrWord(VL53L1_DEV dev, uint16_t index, uint16_t data)
VL53L1_WrWord() definition.
int8_t VL53L1_WrByte(VL53L1_DEV dev, uint16_t index, uint8_t data)
VL53L1_WrByte() definition.
int8_t VL53L1_WriteMulti(VL53L1_DEV dev, uint16_t index, uint8_t *pdata, uint32_t count)
VL53L1_WriteMulti() definition.
int8_t VL53L1_WrDWord(VL53L1_DEV dev, uint16_t index, uint32_t data)
VL53L1_WrDWord() definition.
unsigned long uint32_t
Definition: types.h:18
int8_t VL53L1_RdByte(VL53L1_DEV dev, uint16_t index, uint8_t *pdata)
VL53L1_RdByte() definition.
I2C transaction structure.
Definition: i2c.h:93
VL53L1_ReadStatus
VL53L1 types definition.
static const struct usb_device_descriptor dev
Definition: usb_ser_hw.c:73
struct i2c_periph * i2c_p
unsigned char uint8_t
Definition: types.h:14
VL53L1_Dev_t * VL53L1_DEV
signed char int8_t
Definition: types.h:15
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.
Architecture independent I2C (Inter-Integrated Circuit Bus) API.