update LIDARLite_v3HP just to be functionnal. IUT GEII NICE
LIDARLite_v3HP.h@2:d6e45ac03963, 2022-02-09 (annotated)
- Committer:
- vermaelen
- Date:
- Wed Feb 09 15:13:07 2022 +0000
- Revision:
- 2:d6e45ac03963
- Parent:
- 0:417c1bd45a3c
plein de changement, ca marche
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hubercam | 0:417c1bd45a3c | 1 | /*------------------------------------------------------------------------------ |
hubercam | 0:417c1bd45a3c | 2 | |
hubercam | 0:417c1bd45a3c | 3 | LIDARLite_v3HP Arduino Library |
hubercam | 0:417c1bd45a3c | 4 | LIDARLite_v3HP_v3HP.h |
hubercam | 0:417c1bd45a3c | 5 | |
hubercam | 0:417c1bd45a3c | 6 | This library provides quick access to all the basic functions of LIDAR-Lite |
hubercam | 0:417c1bd45a3c | 7 | via the Arduino interface. Additionally, it can provide a user of any |
hubercam | 0:417c1bd45a3c | 8 | platform with a template for their own application code. |
hubercam | 0:417c1bd45a3c | 9 | |
hubercam | 0:417c1bd45a3c | 10 | Copyright (c) 2018 Garmin Ltd. or its subsidiaries. |
hubercam | 0:417c1bd45a3c | 11 | |
hubercam | 0:417c1bd45a3c | 12 | Licensed under the Apache License, Version 2.0 (the "License"); |
hubercam | 0:417c1bd45a3c | 13 | you may not use this file except in compliance with the License. |
hubercam | 0:417c1bd45a3c | 14 | You may obtain a copy of the License at |
hubercam | 0:417c1bd45a3c | 15 | |
hubercam | 0:417c1bd45a3c | 16 | http://www.apache.org/licenses/LICENSE-2.0 |
hubercam | 0:417c1bd45a3c | 17 | |
hubercam | 0:417c1bd45a3c | 18 | Unless required by applicable law or agreed to in writing, software |
hubercam | 0:417c1bd45a3c | 19 | distributed under the License is distributed on an "AS IS" BASIS, |
hubercam | 0:417c1bd45a3c | 20 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
hubercam | 0:417c1bd45a3c | 21 | See the License for the specific language governing permissions and |
hubercam | 0:417c1bd45a3c | 22 | limitations under the License. |
hubercam | 0:417c1bd45a3c | 23 | |
hubercam | 0:417c1bd45a3c | 24 | ------------------------------------------------------------------------------*/ |
hubercam | 0:417c1bd45a3c | 25 | #ifndef LIDARLite_v3HP_h |
hubercam | 0:417c1bd45a3c | 26 | #define LIDARLite_v3HP_h |
hubercam | 0:417c1bd45a3c | 27 | |
hubercam | 0:417c1bd45a3c | 28 | #define LIDARLITE_ADDR_DEFAULT 0x62 |
hubercam | 0:417c1bd45a3c | 29 | |
hubercam | 0:417c1bd45a3c | 30 | #include <cstdint> |
hubercam | 0:417c1bd45a3c | 31 | #include "mbed.h" |
hubercam | 0:417c1bd45a3c | 32 | |
hubercam | 0:417c1bd45a3c | 33 | class LIDARLite_v3HP |
hubercam | 0:417c1bd45a3c | 34 | { |
hubercam | 0:417c1bd45a3c | 35 | |
hubercam | 0:417c1bd45a3c | 36 | public: |
hubercam | 0:417c1bd45a3c | 37 | |
hubercam | 0:417c1bd45a3c | 38 | uint8_t addr_; |
hubercam | 0:417c1bd45a3c | 39 | I2C *i2c_; |
hubercam | 0:417c1bd45a3c | 40 | |
hubercam | 0:417c1bd45a3c | 41 | LIDARLite_v3HP(I2C *i2c); |
hubercam | 0:417c1bd45a3c | 42 | LIDARLite_v3HP(I2C *i2c, uint8_t &addr); |
hubercam | 0:417c1bd45a3c | 43 | |
hubercam | 0:417c1bd45a3c | 44 | //virtual ~LIDARLite_v3HP(); |
hubercam | 0:417c1bd45a3c | 45 | |
hubercam | 0:417c1bd45a3c | 46 | void configure (const uint8_t &configuration = 0, const uint8_t &lidarliteAddress = LIDARLITE_ADDR_DEFAULT); |
hubercam | 0:417c1bd45a3c | 47 | void setI2Caddr (const uint8_t &newAddress, uint8_t &disableDefault, const uint8_t &lidarliteAddress = LIDARLITE_ADDR_DEFAULT); |
hubercam | 0:417c1bd45a3c | 48 | uint16_t readDistance(const uint8_t &lidarliteAddress = LIDARLITE_ADDR_DEFAULT); |
hubercam | 0:417c1bd45a3c | 49 | void waitForBusy (const uint8_t &lidarliteAddress = LIDARLITE_ADDR_DEFAULT); |
hubercam | 0:417c1bd45a3c | 50 | uint8_t getBusyFlag (const uint8_t &lidarliteAddress = LIDARLITE_ADDR_DEFAULT); |
hubercam | 0:417c1bd45a3c | 51 | void takeRange (const uint8_t &lidarliteAddress = LIDARLITE_ADDR_DEFAULT); |
hubercam | 0:417c1bd45a3c | 52 | void resetReferenceFilter (const uint8_t &lidarliteAddress = LIDARLITE_ADDR_DEFAULT); |
hubercam | 0:417c1bd45a3c | 53 | |
hubercam | 0:417c1bd45a3c | 54 | void write (const uint8_t ®Addr, uint8_t * dataBytes,const uint16_t &numBytes, const uint8_t &lidarliteAddress = LIDARLITE_ADDR_DEFAULT); |
hubercam | 0:417c1bd45a3c | 55 | void read (const uint8_t ®Addr, uint8_t * dataBytes,const uint16_t &numBytes, const uint8_t &lidarliteAddress = LIDARLITE_ADDR_DEFAULT); |
hubercam | 0:417c1bd45a3c | 56 | |
hubercam | 0:417c1bd45a3c | 57 | void correlationRecordToSerial (const uint16_t &numberOfReadings = 1024,const uint8_t &lidarliteAddress = LIDARLITE_ADDR_DEFAULT); |
hubercam | 0:417c1bd45a3c | 58 | |
hubercam | 0:417c1bd45a3c | 59 | private: |
hubercam | 0:417c1bd45a3c | 60 | |
hubercam | 0:417c1bd45a3c | 61 | }; |
hubercam | 0:417c1bd45a3c | 62 | |
hubercam | 0:417c1bd45a3c | 63 | #endif |