Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
inc/vl53l1_platform_user_data.h@0:3d72bef69191, 2020-11-06 (annotated)
- Committer:
- charlesmn
- Date:
- Fri Nov 06 12:15:24 2020 +0000
- Revision:
- 0:3d72bef69191
Initial release. Mbed library for VL53L1CB
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| charlesmn | 0:3d72bef69191 | 1 | |
| charlesmn | 0:3d72bef69191 | 2 | /******************************************************************************* |
| charlesmn | 0:3d72bef69191 | 3 | This file is part of VL53L1 Platform |
| charlesmn | 0:3d72bef69191 | 4 | |
| charlesmn | 0:3d72bef69191 | 5 | Copyright (c) 2020, STMicroelectronics - All Rights Reserved |
| charlesmn | 0:3d72bef69191 | 6 | |
| charlesmn | 0:3d72bef69191 | 7 | License terms: BSD 3-clause "New" or "Revised" License. |
| charlesmn | 0:3d72bef69191 | 8 | |
| charlesmn | 0:3d72bef69191 | 9 | Redistribution and use in source and binary forms, with or without |
| charlesmn | 0:3d72bef69191 | 10 | modification, are permitted provided that the following conditions are met: |
| charlesmn | 0:3d72bef69191 | 11 | |
| charlesmn | 0:3d72bef69191 | 12 | 1. Redistributions of source code must retain the above copyright notice, this |
| charlesmn | 0:3d72bef69191 | 13 | list of conditions and the following disclaimer. |
| charlesmn | 0:3d72bef69191 | 14 | |
| charlesmn | 0:3d72bef69191 | 15 | 2. Redistributions in binary form must reproduce the above copyright notice, |
| charlesmn | 0:3d72bef69191 | 16 | this list of conditions and the following disclaimer in the documentation |
| charlesmn | 0:3d72bef69191 | 17 | and/or other materials provided with the distribution. |
| charlesmn | 0:3d72bef69191 | 18 | |
| charlesmn | 0:3d72bef69191 | 19 | 3. Neither the name of the copyright holder nor the names of its contributors |
| charlesmn | 0:3d72bef69191 | 20 | may be used to endorse or promote products derived from this software |
| charlesmn | 0:3d72bef69191 | 21 | without specific prior written permission. |
| charlesmn | 0:3d72bef69191 | 22 | |
| charlesmn | 0:3d72bef69191 | 23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| charlesmn | 0:3d72bef69191 | 24 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| charlesmn | 0:3d72bef69191 | 25 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| charlesmn | 0:3d72bef69191 | 26 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| charlesmn | 0:3d72bef69191 | 27 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| charlesmn | 0:3d72bef69191 | 28 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| charlesmn | 0:3d72bef69191 | 29 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| charlesmn | 0:3d72bef69191 | 30 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| charlesmn | 0:3d72bef69191 | 31 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| charlesmn | 0:3d72bef69191 | 32 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| charlesmn | 0:3d72bef69191 | 33 | |
| charlesmn | 0:3d72bef69191 | 34 | */ |
| charlesmn | 0:3d72bef69191 | 35 | |
| charlesmn | 0:3d72bef69191 | 36 | |
| charlesmn | 0:3d72bef69191 | 37 | |
| charlesmn | 0:3d72bef69191 | 38 | #ifndef _VL53L1_PLATFORM_USER_DATA_H_ |
| charlesmn | 0:3d72bef69191 | 39 | #define _VL53L1_PLATFORM_USER_DATA_H_ |
| charlesmn | 0:3d72bef69191 | 40 | |
| charlesmn | 0:3d72bef69191 | 41 | #ifndef __KERNEL__ |
| charlesmn | 0:3d72bef69191 | 42 | #include <stdlib.h> |
| charlesmn | 0:3d72bef69191 | 43 | #endif |
| charlesmn | 0:3d72bef69191 | 44 | |
| charlesmn | 0:3d72bef69191 | 45 | #include "vl53l1_def.h" |
| charlesmn | 0:3d72bef69191 | 46 | |
| charlesmn | 0:3d72bef69191 | 47 | #ifdef __cplusplus |
| charlesmn | 0:3d72bef69191 | 48 | extern "C" |
| charlesmn | 0:3d72bef69191 | 49 | { |
| charlesmn | 0:3d72bef69191 | 50 | #endif |
| charlesmn | 0:3d72bef69191 | 51 | |
| charlesmn | 0:3d72bef69191 | 52 | |
| charlesmn | 0:3d72bef69191 | 53 | |
| charlesmn | 0:3d72bef69191 | 54 | |
| charlesmn | 0:3d72bef69191 | 55 | |
| charlesmn | 0:3d72bef69191 | 56 | typedef struct { |
| charlesmn | 0:3d72bef69191 | 57 | |
| charlesmn | 0:3d72bef69191 | 58 | VL53L1_DevData_t Data; |
| charlesmn | 0:3d72bef69191 | 59 | |
| charlesmn | 0:3d72bef69191 | 60 | |
| charlesmn | 0:3d72bef69191 | 61 | uint8_t i2c_slave_address; |
| charlesmn | 0:3d72bef69191 | 62 | |
| charlesmn | 0:3d72bef69191 | 63 | uint8_t comms_type; |
| charlesmn | 0:3d72bef69191 | 64 | |
| charlesmn | 0:3d72bef69191 | 65 | uint16_t comms_speed_khz; |
| charlesmn | 0:3d72bef69191 | 66 | |
| charlesmn | 0:3d72bef69191 | 67 | |
| charlesmn | 0:3d72bef69191 | 68 | uint32_t new_data_ready_poll_duration_ms; |
| charlesmn | 0:3d72bef69191 | 69 | |
| charlesmn | 0:3d72bef69191 | 70 | } VL53L1_Dev_t; |
| charlesmn | 0:3d72bef69191 | 71 | |
| charlesmn | 0:3d72bef69191 | 72 | |
| charlesmn | 0:3d72bef69191 | 73 | |
| charlesmn | 0:3d72bef69191 | 74 | typedef VL53L1_Dev_t *VL53L1_DEV; |
| charlesmn | 0:3d72bef69191 | 75 | |
| charlesmn | 0:3d72bef69191 | 76 | |
| charlesmn | 0:3d72bef69191 | 77 | #define VL53L1DevDataGet(Dev, field) (Dev->Data.field) |
| charlesmn | 0:3d72bef69191 | 78 | |
| charlesmn | 0:3d72bef69191 | 79 | |
| charlesmn | 0:3d72bef69191 | 80 | |
| charlesmn | 0:3d72bef69191 | 81 | #define VL53L1DevDataSet(Dev, field, VL53L1_p_002) ((Dev->Data.field) = (VL53L1_p_002)) |
| charlesmn | 0:3d72bef69191 | 82 | |
| charlesmn | 0:3d72bef69191 | 83 | |
| charlesmn | 0:3d72bef69191 | 84 | |
| charlesmn | 0:3d72bef69191 | 85 | #define VL53L1DevStructGetLLDriverHandle(Dev) (&Dev->Data.LLData) |
| charlesmn | 0:3d72bef69191 | 86 | |
| charlesmn | 0:3d72bef69191 | 87 | |
| charlesmn | 0:3d72bef69191 | 88 | #define VL53L1DevStructGetLLResultsHandle(Dev) (&Dev->Data.llresults) |
| charlesmn | 0:3d72bef69191 | 89 | |
| charlesmn | 0:3d72bef69191 | 90 | |
| charlesmn | 0:3d72bef69191 | 91 | |
| charlesmn | 0:3d72bef69191 | 92 | #ifdef __cplusplus |
| charlesmn | 0:3d72bef69191 | 93 | } |
| charlesmn | 0:3d72bef69191 | 94 | #endif |
| charlesmn | 0:3d72bef69191 | 95 | |
| charlesmn | 0:3d72bef69191 | 96 | #endif |
| charlesmn | 0:3d72bef69191 | 97 | |
| charlesmn | 0:3d72bef69191 | 98 | |
| charlesmn | 0:3d72bef69191 | 99 |