Time-of-Flight-SDK
depth_sensor_interface.h
1 /*
2  * BSD 3-Clause License
3  *
4  * Copyright (c) 2019, Analog Devices, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright notice, this
11  * list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright notice,
14  * this list of conditions and the following disclaimer in the documentation
15  * and/or other materials provided with the distribution.
16  *
17  * 3. Neither the name of the copyright holder nor the names of its
18  * contributors may be used to endorse or promote products derived from
19  * this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 #ifndef DEPTH_SENSOR_INTERFACE_H
33 #define DEPTH_SENSOR_INTERFACE_H
34 
35 #include <aditof/frame_definitions.h>
36 #include <aditof/sensor_definitions.h>
37 #include <aditof/status_definitions.h>
38 
39 #include <cstddef>
40 #include <vector>
41 
42 namespace aditof {
43 
50  public:
54  virtual ~DepthSensorInterface() = default;
55 
60  virtual aditof::Status open() = 0;
61 
66  virtual aditof::Status start() = 0;
67 
72  virtual aditof::Status stop() = 0;
73 
79  virtual aditof::Status
80  getAvailableFrameTypes(std::vector<aditof::FrameDetails> &types) = 0;
81 
87  virtual aditof::Status
88  setFrameType(const aditof::FrameDetails &details) = 0;
89 
96  virtual aditof::Status program(const uint8_t *firmware, size_t size) = 0;
97 
106  virtual aditof::Status
107  getFrame(uint16_t *buffer, aditof::BufferInfo *bufferInfo = nullptr) = 0;
108 
118  virtual aditof::Status readAfeRegisters(const uint16_t *address,
119  uint16_t *data, size_t length) = 0;
120 
129  virtual aditof::Status writeAfeRegisters(const uint16_t *address,
130  const uint16_t *data,
131  size_t length) = 0;
132 
140  virtual aditof::Status getDetails(aditof::SensorDetails &details) const = 0;
141 
149  virtual aditof::Status getHandle(void **handle) = 0;
150 
156  virtual aditof::Status getName(std::string &sensorName) const = 0;
157 };
158 
159 } // namespace aditof
160 
161 #endif // DEPTH_SENSOR_INTERFACE_H
virtual aditof::Status getName(std::string &sensorName) const =0
Get the name of the available image sensor.
Namespace aditof.
Definition: frame.h:43
virtual aditof::Status setFrameType(const aditof::FrameDetails &details)=0
Set the sensor frame type to the given type.
virtual ~DepthSensorInterface()=default
Destructor.
virtual aditof::Status stop()=0
Stop the sensor data stream.
virtual aditof::Status getFrame(uint16_t *buffer, aditof::BufferInfo *bufferInfo=nullptr)=0
Request a frame from the sensor.
virtual aditof::Status start()=0
Start the streaming of data from the sensor.
virtual aditof::Status getHandle(void **handle)=0
Gets a handle to be used by other devices such as Storage, Temperature, etc. This handle will allow t...
Provides extra details for the frame buffer.
Provides details about the device.
Provides access to the low level functionality of the camera sensor. This includes sensor configurati...
virtual aditof::Status readAfeRegisters(const uint16_t *address, uint16_t *data, size_t length)=0
Read multiple registers from AFE.
virtual aditof::Status getDetails(aditof::SensorDetails &details) const =0
Get a structure that contains information about the instance of the sensor.
virtual aditof::Status program(const uint8_t *firmware, size_t size)=0
Program the sensor with the given firmware.
Status
Status of any operation that the TOF sdk performs.
virtual aditof::Status getAvailableFrameTypes(std::vector< aditof::FrameDetails > &types)=0
Return all frame types that are supported by the sensor.
Describes the properties of a frame.
virtual aditof::Status writeAfeRegisters(const uint16_t *address, const uint16_t *data, size_t length)=0
Write to multiple AFE registers.
virtual aditof::Status open()=0
Open the communication channels with the hardware.