Statistics
| Branch: | Tag: | Revision:

amiro-lld / drivers / VL53L1X / v1 / api / platform / vl53l1_platform.h @ f0dd1ac4

History | View | Annotate | Download (5.088 KB)

1 4dba9195 galberding
2
/*
3
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
4
*
5
* This file is part of VL53L1 Core and is dual licensed,
6
* either 'STMicroelectronics
7
* Proprietary license'
8
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
9
*
10
********************************************************************************
11
*
12
* 'STMicroelectronics Proprietary license'
13
*
14
********************************************************************************
15
*
16
* License terms: STMicroelectronics Proprietary in accordance with licensing
17
* terms at www.st.com/sla0081
18
*
19
* STMicroelectronics confidential
20
* Reproduction and Communication of this document is strictly prohibited unless
21
* specifically authorized in writing by STMicroelectronics.
22
*
23
*
24
********************************************************************************
25
*
26
* Alternatively, VL53L1 Core may be distributed under the terms of
27
* 'BSD 3-clause "New" or "Revised" License', in which case the following
28
* provisions apply instead of the ones mentioned above :
29
*
30
********************************************************************************
31
*
32
* License terms: BSD 3-clause "New" or "Revised" License.
33
*
34
* Redistribution and use in source and binary forms, with or without
35
* modification, are permitted provided that the following conditions are met:
36
*
37
* 1. Redistributions of source code must retain the above copyright notice, this
38
* list of conditions and the following disclaimer.
39
*
40
* 2. Redistributions in binary form must reproduce the above copyright notice,
41
* this list of conditions and the following disclaimer in the documentation
42
* and/or other materials provided with the distribution.
43
*
44
* 3. Neither the name of the copyright holder nor the names of its contributors
45
* may be used to endorse or promote products derived from this software
46
* without specific prior written permission.
47
*
48
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
49
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
50
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
51
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
52
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
54
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
55
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
56
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
57
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
58
*
59
*
60
********************************************************************************
61
*
62
*/
63
64
#ifndef _VL53L1_PLATFORM_H_
65
#define _VL53L1_PLATFORM_H_
66
67
#include "vl53l1_ll_def.h"
68
#include "vl53l1_platform_log.h"
69
70
#define VL53L1_IPP_API
71
#include "vl53l1_platform_user_data.h"
72
73
#ifdef __cplusplus
74
extern "C"
75
{
76
#endif
77
78
VL53L1_Error VL53L1_CommsInitialise(
79
        VL53L1_Dev_t *pdev,
80
        uint8_t       comms_type,
81
        uint16_t      comms_speed_khz);
82
83
VL53L1_Error VL53L1_CommsClose(
84
        VL53L1_Dev_t *pdev);
85
86
VL53L1_Error VL53L1_WriteMulti(
87
                VL53L1_Dev_t *pdev,
88
                uint16_t      index,
89
                uint8_t      *pdata,
90
                uint32_t      count);
91
92
VL53L1_Error VL53L1_ReadMulti(
93
                VL53L1_Dev_t *pdev,
94
                uint16_t      index,
95
                uint8_t      *pdata,
96
                uint32_t      count);
97
98
VL53L1_Error VL53L1_WrByte(
99
                VL53L1_Dev_t *pdev,
100
                uint16_t      index,
101
                uint8_t       VL53L1_PRM_00005);
102
103
VL53L1_Error VL53L1_WrWord(
104
                VL53L1_Dev_t *pdev,
105
                uint16_t      index,
106
                uint16_t      VL53L1_PRM_00005);
107
108
VL53L1_Error VL53L1_WrDWord(
109
                VL53L1_Dev_t *pdev,
110
                uint16_t      index,
111
                uint32_t      VL53L1_PRM_00005);
112
113
VL53L1_Error VL53L1_RdByte(
114
                VL53L1_Dev_t *pdev,
115
                uint16_t      index,
116
                uint8_t      *pdata);
117
118
VL53L1_Error VL53L1_RdWord(
119
                VL53L1_Dev_t *pdev,
120
                uint16_t      index,
121
                uint16_t     *pdata);
122
123
VL53L1_Error VL53L1_RdDWord(
124
                VL53L1_Dev_t *pdev,
125
                uint16_t      index,
126
                uint32_t     *pdata);
127
128
VL53L1_Error VL53L1_WaitUs(
129
                VL53L1_Dev_t *pdev,
130
                int32_t       wait_us);
131
132
VL53L1_Error VL53L1_WaitMs(
133
                VL53L1_Dev_t *pdev,
134
                int32_t       wait_ms);
135
136
VL53L1_Error VL53L1_GetTimerFrequency(int32_t *ptimer_freq_hz);
137
138
VL53L1_Error VL53L1_GetTimerValue(int32_t *ptimer_count);
139
140
VL53L1_Error VL53L1_GpioSetMode(uint8_t pin, uint8_t mode);
141
142
VL53L1_Error VL53L1_GpioSetValue(uint8_t pin, uint8_t value);
143
144
VL53L1_Error VL53L1_GpioGetValue(uint8_t pin, uint8_t *pvalue);
145
146
VL53L1_Error VL53L1_GpioXshutdown(uint8_t value);
147
148
VL53L1_Error VL53L1_GpioCommsSelect(uint8_t value);
149
150
VL53L1_Error VL53L1_GpioPowerEnable(uint8_t value);
151
152
VL53L1_Error  VL53L1_GpioInterruptEnable(void (*function)(void), uint8_t edge_type);
153
154
VL53L1_Error  VL53L1_GpioInterruptDisable(void);
155
156
VL53L1_Error VL53L1_GetTickCount(
157
        uint32_t *ptime_ms);
158
159
VL53L1_Error VL53L1_WaitValueMaskEx(
160
                VL53L1_Dev_t *pdev,
161
                uint32_t      timeout_ms,
162
                uint16_t      index,
163
                uint8_t       value,
164
                uint8_t       mask,
165
                uint32_t      poll_delay_ms);
166
167
#ifdef __cplusplus
168
}
169
#endif
170
171
#endif