Contains Ayoub's Ranging and Custom interfaces for the VL53L3CX

Committer:
charlesmn
Date:
Wed Jul 21 14:47:53 2021 +0000
Revision:
1:dae4cb24beec
Parent:
0:c1910e04fc6c
strip out commented out code

Who changed what in which revision?

UserRevisionLine numberNew contents of line
charlesmn 0:c1910e04fc6c 1
charlesmn 0:c1910e04fc6c 2 /*
charlesmn 0:c1910e04fc6c 3 * This file is part of VL53L3 Platform
charlesmn 0:c1910e04fc6c 4 *
charlesmn 0:c1910e04fc6c 5 * This file provides a CPP wrapper around the functions in 53l3a2_ranging_sensor.c
charlesmn 0:c1910e04fc6c 6 * For documentation look at 53l3a2_ranging_sensor.h
charlesmn 0:c1910e04fc6c 7 *
charlesmn 0:c1910e04fc6c 8 * Copyright (C) 2021, STMicroelectronics - All Rights Reserved
charlesmn 0:c1910e04fc6c 9 *
charlesmn 0:c1910e04fc6c 10 * License terms: BSD 3-clause "New" or "Revised" License.
charlesmn 0:c1910e04fc6c 11 *
charlesmn 0:c1910e04fc6c 12 * Redistribution and use in source and binary forms, with or without
charlesmn 0:c1910e04fc6c 13 * modification, are permitted provided that the following conditions are met:
charlesmn 0:c1910e04fc6c 14 *
charlesmn 0:c1910e04fc6c 15 * 1. Redistributions of source code must retain the above copyright notice, this
charlesmn 0:c1910e04fc6c 16 * list of conditions and the following disclaimer.
charlesmn 0:c1910e04fc6c 17 *
charlesmn 0:c1910e04fc6c 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
charlesmn 0:c1910e04fc6c 19 * this list of conditions and the following disclaimer in the documentation
charlesmn 0:c1910e04fc6c 20 * and/or other materials provided with the distribution.
charlesmn 0:c1910e04fc6c 21 *
charlesmn 0:c1910e04fc6c 22 * 3. Neither the name of the copyright holder nor the names of its contributors
charlesmn 0:c1910e04fc6c 23 * may be used to endorse or promote products derived from this software
charlesmn 0:c1910e04fc6c 24 * without specific prior written permission.
charlesmn 0:c1910e04fc6c 25 *
charlesmn 0:c1910e04fc6c 26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
charlesmn 0:c1910e04fc6c 27 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
charlesmn 0:c1910e04fc6c 28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
charlesmn 0:c1910e04fc6c 29 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
charlesmn 0:c1910e04fc6c 30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
charlesmn 0:c1910e04fc6c 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
charlesmn 0:c1910e04fc6c 32 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
charlesmn 0:c1910e04fc6c 33 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
charlesmn 0:c1910e04fc6c 34 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
charlesmn 0:c1910e04fc6c 35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
charlesmn 0:c1910e04fc6c 36 *
charlesmn 0:c1910e04fc6c 37 */
charlesmn 0:c1910e04fc6c 38
charlesmn 0:c1910e04fc6c 39 #include "VL53L3A2_RangingClass.h"
charlesmn 0:c1910e04fc6c 40
charlesmn 0:c1910e04fc6c 41
charlesmn 0:c1910e04fc6c 42
charlesmn 0:c1910e04fc6c 43 int32_t VL53L3A2_SENSOR::VL53L3A2_RANGING_Init(uint32_t Instance)
charlesmn 0:c1910e04fc6c 44 {
charlesmn 0:c1910e04fc6c 45 return VL53L3A2_RANGING_SENSOR_Init(Instance);
charlesmn 0:c1910e04fc6c 46 }
charlesmn 0:c1910e04fc6c 47
charlesmn 0:c1910e04fc6c 48 int32_t VL53L3A2_SENSOR::VL53L3A2_RANGING_DeInit(uint32_t Instance)
charlesmn 0:c1910e04fc6c 49 {
charlesmn 0:c1910e04fc6c 50 return VL53L3A2_RANGING_SENSOR_DeInit(Instance);
charlesmn 0:c1910e04fc6c 51 }
charlesmn 0:c1910e04fc6c 52
charlesmn 0:c1910e04fc6c 53 int32_t VL53L3A2_SENSOR::VL53L3A2_RANGING_ReadID(uint32_t Instance, uint32_t *pId)
charlesmn 0:c1910e04fc6c 54 {
charlesmn 0:c1910e04fc6c 55 return VL53L3A2_RANGING_SENSOR_ReadID(Instance,pId);
charlesmn 0:c1910e04fc6c 56 }
charlesmn 0:c1910e04fc6c 57
charlesmn 0:c1910e04fc6c 58 int32_t VL53L3A2_SENSOR::VL53L3A2_RANGING_GetCapabilities(uint32_t Instance, RANGING_SENSOR_Capabilities_t *pCapabilities)
charlesmn 0:c1910e04fc6c 59 {
charlesmn 0:c1910e04fc6c 60 return VL53L3A2_RANGING_SENSOR_GetCapabilities(Instance, pCapabilities);
charlesmn 0:c1910e04fc6c 61 }
charlesmn 0:c1910e04fc6c 62
charlesmn 0:c1910e04fc6c 63 int32_t VL53L3A2_SENSOR::VL53L3A2_RANGING_ConfigProfile(uint32_t Instance, RANGING_SENSOR_ProfileConfig_t *pConfig)
charlesmn 0:c1910e04fc6c 64 {
charlesmn 0:c1910e04fc6c 65 return VL53L3A2_RANGING_SENSOR_ConfigProfile( Instance, pConfig);
charlesmn 0:c1910e04fc6c 66 }
charlesmn 0:c1910e04fc6c 67
charlesmn 0:c1910e04fc6c 68 int32_t VL53L3A2_SENSOR::VL53L3A2_RANGING_ConfigROI(uint32_t Instance, RANGING_SENSOR_ROIConfig_t *pConfig)
charlesmn 0:c1910e04fc6c 69 {
charlesmn 0:c1910e04fc6c 70 return VL53L3A2_RANGING_SENSOR_ConfigROI(Instance, pConfig);
charlesmn 0:c1910e04fc6c 71 }
charlesmn 0:c1910e04fc6c 72
charlesmn 0:c1910e04fc6c 73 int32_t VL53L3A2_SENSOR::VL53L3A2_RANGING_ConfigIT(uint32_t Instance, RANGING_SENSOR_ITConfig_t *pConfig)
charlesmn 0:c1910e04fc6c 74 {
charlesmn 0:c1910e04fc6c 75 return VL53L3A2_RANGING_SENSOR_ConfigIT(Instance, pConfig);
charlesmn 0:c1910e04fc6c 76 }
charlesmn 0:c1910e04fc6c 77
charlesmn 0:c1910e04fc6c 78 int32_t VL53L3A2_SENSOR::VL53L3A2_RANGING_GetDistance(uint32_t Instance, RANGING_SENSOR_Result_t *pResult)
charlesmn 0:c1910e04fc6c 79 {
charlesmn 0:c1910e04fc6c 80 return VL53L3A2_RANGING_SENSOR_GetDistance( Instance, pResult);
charlesmn 0:c1910e04fc6c 81 }
charlesmn 0:c1910e04fc6c 82
charlesmn 0:c1910e04fc6c 83
charlesmn 0:c1910e04fc6c 84 int32_t VL53L3A2_SENSOR::VL53L3A2_RANGING_Start(uint32_t Instance, uint32_t Mode)
charlesmn 0:c1910e04fc6c 85 {
charlesmn 0:c1910e04fc6c 86 return VL53L3A2_RANGING_SENSOR_Start( Instance, Mode);
charlesmn 0:c1910e04fc6c 87 }
charlesmn 0:c1910e04fc6c 88
charlesmn 0:c1910e04fc6c 89
charlesmn 0:c1910e04fc6c 90 int32_t VL53L3A2_SENSOR::VL53L3A2_RANGING_Stop(uint32_t Instance)
charlesmn 0:c1910e04fc6c 91 {
charlesmn 0:c1910e04fc6c 92 return VL53L3A2_RANGING_SENSOR_Stop( Instance);
charlesmn 0:c1910e04fc6c 93 }
charlesmn 0:c1910e04fc6c 94
charlesmn 0:c1910e04fc6c 95
charlesmn 0:c1910e04fc6c 96 int32_t VL53L3A2_SENSOR::VL53L3A2_RANGING_SetAddress(uint32_t Instance, uint32_t Address)
charlesmn 0:c1910e04fc6c 97 {
charlesmn 0:c1910e04fc6c 98 return VL53L3A2_RANGING_SENSOR_SetAddress( Instance, Address);
charlesmn 0:c1910e04fc6c 99 }
charlesmn 0:c1910e04fc6c 100
charlesmn 0:c1910e04fc6c 101 int32_t VL53L3A2_SENSOR::VL53L3A2_RANGING_GetAddress(uint32_t Instance, uint32_t *pAddress)
charlesmn 0:c1910e04fc6c 102 {
charlesmn 0:c1910e04fc6c 103 return VL53L3A2_RANGING_SENSOR_GetAddress( Instance, pAddress);
charlesmn 0:c1910e04fc6c 104 }
charlesmn 0:c1910e04fc6c 105
charlesmn 0:c1910e04fc6c 106 int32_t VL53L3A2_SENSOR::VL53L3A2_RANGING_SetPowerMode(uint32_t Instance, uint32_t PowerMode)
charlesmn 0:c1910e04fc6c 107 {
charlesmn 0:c1910e04fc6c 108 return VL53L3A2_RANGING_SENSOR_SetPowerMode( Instance, PowerMode);
charlesmn 0:c1910e04fc6c 109 }
charlesmn 0:c1910e04fc6c 110
charlesmn 0:c1910e04fc6c 111 int32_t VL53L3A2_SENSOR::VL53L3A2_RANGING_GetPowerMode(uint32_t Instance, uint32_t *pPowerMode)
charlesmn 0:c1910e04fc6c 112 {
charlesmn 0:c1910e04fc6c 113 return VL53L3A2_RANGING_SENSOR_GetPowerMode( Instance, pPowerMode);
charlesmn 0:c1910e04fc6c 114 }
charlesmn 0:c1910e04fc6c 115
charlesmn 0:c1910e04fc6c 116 int32_t VL53L3A2_SENSOR::VL53L3A2_RANGING_OffsetCalibration(uint32_t Instance, uint32_t CalDistance)
charlesmn 0:c1910e04fc6c 117 {
charlesmn 0:c1910e04fc6c 118 return VL53L3A2_RANGING_SENSOR_OffsetCalibration( Instance, CalDistance);
charlesmn 0:c1910e04fc6c 119 }
charlesmn 0:c1910e04fc6c 120
charlesmn 0:c1910e04fc6c 121 int32_t VL53L3A2_SENSOR::VL53L3A2_RANGING_XTalkCalibration(uint32_t Instance)
charlesmn 0:c1910e04fc6c 122 {
charlesmn 0:c1910e04fc6c 123 return VL53L3A2_RANGING_SENSOR_XTalkCalibration( Instance);
charlesmn 0:c1910e04fc6c 124 }