Contains Ayoub's Ranging and Custom interfaces for the VL53L3CX
VL53L3A2_RangingClass.h@1:dae4cb24beec, 2021-07-21 (annotated)
- 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?
User | Revision | Line number | New contents of line |
---|---|---|---|
charlesmn | 0:c1910e04fc6c | 1 | /** |
charlesmn | 0:c1910e04fc6c | 2 | ****************************************************************************** |
charlesmn | 0:c1910e04fc6c | 3 | * @file VL53L3A2_RangingClass.h |
charlesmn | 0:c1910e04fc6c | 4 | * @author CGM |
charlesmn | 0:c1910e04fc6c | 5 | * @version V0.0.1 |
charlesmn | 0:c1910e04fc6c | 6 | * @date 5/7/2021 |
charlesmn | 0:c1910e04fc6c | 7 | * @brief Header file for class VL53L3A2_SENSOR |
charlesmn | 0:c1910e04fc6c | 8 | ****************************************************************************** |
charlesmn | 0:c1910e04fc6c | 9 | * @attention |
charlesmn | 0:c1910e04fc6c | 10 | * |
charlesmn | 0:c1910e04fc6c | 11 | * <h2><center>© COPYRIGHT(c) 2021 STMicroelectronics</center></h2> |
charlesmn | 0:c1910e04fc6c | 12 | * |
charlesmn | 0:c1910e04fc6c | 13 | * Redistribution and use in source and binary forms, with or without modification, |
charlesmn | 0:c1910e04fc6c | 14 | * are permitted provided that the following conditions are met: |
charlesmn | 0:c1910e04fc6c | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
charlesmn | 0:c1910e04fc6c | 16 | * this list of conditions and the following disclaimer. |
charlesmn | 0:c1910e04fc6c | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
charlesmn | 0:c1910e04fc6c | 18 | * this list of conditions and the following disclaimer in the documentation |
charlesmn | 0:c1910e04fc6c | 19 | * and/or other materials provided with the distribution. |
charlesmn | 0:c1910e04fc6c | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
charlesmn | 0:c1910e04fc6c | 21 | * may be used to endorse or promote products derived from this software |
charlesmn | 0:c1910e04fc6c | 22 | * without specific prior written permission. |
charlesmn | 0:c1910e04fc6c | 23 | * |
charlesmn | 0:c1910e04fc6c | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
charlesmn | 0:c1910e04fc6c | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
charlesmn | 0:c1910e04fc6c | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
charlesmn | 0:c1910e04fc6c | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
charlesmn | 0:c1910e04fc6c | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
charlesmn | 0:c1910e04fc6c | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
charlesmn | 0:c1910e04fc6c | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
charlesmn | 0:c1910e04fc6c | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
charlesmn | 0:c1910e04fc6c | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
charlesmn | 0:c1910e04fc6c | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
charlesmn | 0:c1910e04fc6c | 34 | * |
charlesmn | 0:c1910e04fc6c | 35 | ****************************************************************************** |
charlesmn | 0:c1910e04fc6c | 36 | */ |
charlesmn | 0:c1910e04fc6c | 37 | |
charlesmn | 0:c1910e04fc6c | 38 | #ifndef __VL53L3A2_SENSOR_CLASS_H |
charlesmn | 0:c1910e04fc6c | 39 | #define __VL53L3A2_SENSOR_CLASS_H |
charlesmn | 0:c1910e04fc6c | 40 | |
charlesmn | 0:c1910e04fc6c | 41 | |
charlesmn | 0:c1910e04fc6c | 42 | /* Includes ------------------------------------------------------------------*/ |
charlesmn | 0:c1910e04fc6c | 43 | #include "mbed.h" |
charlesmn | 0:c1910e04fc6c | 44 | #include "PinNames.h" |
charlesmn | 0:c1910e04fc6c | 45 | |
charlesmn | 0:c1910e04fc6c | 46 | |
charlesmn | 0:c1910e04fc6c | 47 | /* Includes ------------------------------------------------------------------*/ |
charlesmn | 0:c1910e04fc6c | 48 | #include "53l3a2_conf.h" |
charlesmn | 0:c1910e04fc6c | 49 | #include "stdint.h" |
charlesmn | 0:c1910e04fc6c | 50 | #include "53l3a2_ranging_sensor.h" |
charlesmn | 0:c1910e04fc6c | 51 | |
charlesmn | 0:c1910e04fc6c | 52 | /* Classes--------------------------------------------------------------------*/ |
charlesmn | 0:c1910e04fc6c | 53 | |
charlesmn | 0:c1910e04fc6c | 54 | /* Classes -------------------------------------------------------------------*/ |
charlesmn | 0:c1910e04fc6c | 55 | /** Class representing the VL53L3A2 SENSOR |
charlesmn | 0:c1910e04fc6c | 56 | */ |
charlesmn | 0:c1910e04fc6c | 57 | class VL53L3A2_SENSOR |
charlesmn | 0:c1910e04fc6c | 58 | { |
charlesmn | 0:c1910e04fc6c | 59 | public: |
charlesmn | 0:c1910e04fc6c | 60 | /** Constructor 1 |
charlesmn | 0:c1910e04fc6c | 61 | */ |
charlesmn | 0:c1910e04fc6c | 62 | VL53L3A2_SENSOR() |
charlesmn | 0:c1910e04fc6c | 63 | { |
charlesmn | 0:c1910e04fc6c | 64 | |
charlesmn | 0:c1910e04fc6c | 65 | |
charlesmn | 0:c1910e04fc6c | 66 | } |
charlesmn | 0:c1910e04fc6c | 67 | |
charlesmn | 0:c1910e04fc6c | 68 | |
charlesmn | 0:c1910e04fc6c | 69 | |
charlesmn | 0:c1910e04fc6c | 70 | /** Destructor |
charlesmn | 0:c1910e04fc6c | 71 | */ |
charlesmn | 0:c1910e04fc6c | 72 | ~VL53L3A2_SENSOR() |
charlesmn | 0:c1910e04fc6c | 73 | { |
charlesmn | 0:c1910e04fc6c | 74 | printf("XNucleo53L3A2 destructor \n"); |
charlesmn | 0:c1910e04fc6c | 75 | |
charlesmn | 0:c1910e04fc6c | 76 | } |
charlesmn | 0:c1910e04fc6c | 77 | |
charlesmn | 0:c1910e04fc6c | 78 | int32_t VL53L3A2_RANGING_Init(uint32_t Instance); |
charlesmn | 0:c1910e04fc6c | 79 | int32_t VL53L3A2_RANGING_DeInit(uint32_t Instance); |
charlesmn | 0:c1910e04fc6c | 80 | int32_t VL53L3A2_RANGING_ReadID(uint32_t Instance, uint32_t *pId); |
charlesmn | 0:c1910e04fc6c | 81 | int32_t VL53L3A2_RANGING_GetCapabilities(uint32_t Instance, RANGING_SENSOR_Capabilities_t *pCapabilities); |
charlesmn | 0:c1910e04fc6c | 82 | int32_t VL53L3A2_RANGING_ConfigProfile(uint32_t Instance, RANGING_SENSOR_ProfileConfig_t *pConfig); |
charlesmn | 0:c1910e04fc6c | 83 | int32_t VL53L3A2_RANGING_ConfigROI(uint32_t Instance, RANGING_SENSOR_ROIConfig_t *pConfig); |
charlesmn | 0:c1910e04fc6c | 84 | int32_t VL53L3A2_RANGING_ConfigIT(uint32_t Instance, RANGING_SENSOR_ITConfig_t *pConfig); |
charlesmn | 0:c1910e04fc6c | 85 | int32_t VL53L3A2_RANGING_GetDistance(uint32_t Instance, RANGING_SENSOR_Result_t *pResult); |
charlesmn | 0:c1910e04fc6c | 86 | int32_t VL53L3A2_RANGING_Start(uint32_t Instance, uint32_t Mode); |
charlesmn | 0:c1910e04fc6c | 87 | int32_t VL53L3A2_RANGING_Stop(uint32_t Instance); |
charlesmn | 0:c1910e04fc6c | 88 | int32_t VL53L3A2_RANGING_SetAddress(uint32_t Instance, uint32_t Address); |
charlesmn | 0:c1910e04fc6c | 89 | int32_t VL53L3A2_RANGING_GetAddress(uint32_t Instance, uint32_t *pAddress); |
charlesmn | 0:c1910e04fc6c | 90 | int32_t VL53L3A2_RANGING_SetPowerMode(uint32_t Instance, uint32_t PowerMode); |
charlesmn | 0:c1910e04fc6c | 91 | int32_t VL53L3A2_RANGING_GetPowerMode(uint32_t Instance, uint32_t *pPowerMode); |
charlesmn | 0:c1910e04fc6c | 92 | |
charlesmn | 0:c1910e04fc6c | 93 | int32_t VL53L3A2_RANGING_OffsetCalibration(uint32_t Instance, uint32_t CalDistance); |
charlesmn | 0:c1910e04fc6c | 94 | int32_t VL53L3A2_RANGING_XTalkCalibration(uint32_t Instance); |
charlesmn | 0:c1910e04fc6c | 95 | |
charlesmn | 0:c1910e04fc6c | 96 | }; |
charlesmn | 0:c1910e04fc6c | 97 | |
charlesmn | 0:c1910e04fc6c | 98 | |
charlesmn | 0:c1910e04fc6c | 99 | #endif /* __VL53L3A2_SENSOR_CLASS_H */ |