NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release
NvSIPLCommon.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2018-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
13 #ifndef NVSIPLCOMMON_HPP
14 #define NVSIPLCOMMON_HPP
15 
16 #include <cstdint>
17 #include <memory>
18 #include <cmath>
19 
29 #define SIPL_TRUE (0 == 0)
30 
32 #define SIPL_FALSE (0 == 1)
33 
40 #define NVSIPL_GPIO_DEVICE_DESERIALIZER (static_cast<uint32_t>(1U) << 0U)
41 
42 #define NVSIPL_GPIO_DEVICE_SERIALIZER_0 (static_cast<uint32_t>(1U) << 8U)
43 
44 #define NVSIPL_GPIO_DEVICE_SERIALIZER_1 (static_cast<uint32_t>(1U) << 9U)
45 
46 #define NVSIPL_GPIO_DEVICE_SERIALIZER_2 (static_cast<uint32_t>(1U) << 10U)
47 
48 #define NVSIPL_GPIO_DEVICE_SERIALIZER_3 (static_cast<uint32_t>(1U) << 11U)
49 
50 #define NVSIPL_GPIO_DEVICE_SENSOR_0 (static_cast<uint32_t>(1U) << 16U)
51 
52 #define NVSIPL_GPIO_DEVICE_SENSOR_1 (static_cast<uint32_t>(1U) << 17U)
53 
54 #define NVSIPL_GPIO_DEVICE_SENSOR_2 (static_cast<uint32_t>(1U) << 18U)
55 
56 #define NVSIPL_GPIO_DEVICE_SENSOR_3 (static_cast<uint32_t>(1U) << 19U)
57 
58 #define NVSIPL_GPIO_DEVICE_INTR_ERR (static_cast<uint32_t>(1U) << 24U)
59 
60 #define NVSIPL_GPIO_DEVICE_INTR_ERR_GETSTATUS (static_cast<uint32_t>(1U) << 25U)
61 
65 #define NVSIPL_GPIO_DEVICE_SERIALIZER_SHIFT (8U)
66 
67 #define NVSIPL_GPIO_DEVICE_SENSOR_SHIFT (16U)
68 
72 namespace nvsipl
73 {
95 struct NvSiplRect {
97  uint16_t x0;
99  uint16_t y0;
101  uint16_t x1;
103  uint16_t y1;
104 };
105 
109 using NvSiplGlobalTime = uint64_t;
110 
114 struct NvSiplPoint {
116  int32_t x;
118  int32_t y;
119 };
120 
127  float_t x;
129  float_t y;
130 };
131 
136 using NvSiplBool = uint32_t;
137 
140 enum NvSiplTimeBase : std::uint8_t {
150 };
151 
153 enum SIPLStatus : std::uint8_t
154 {
155  // New status code must be added after NVSIPL_STATUS_OK and before NVSIPL_STATUS_ERROR.
156 
159 
160  // Error codes.
181 };
182 
184 enum SIPLGpioEvent : std::uint8_t
185 {
207 };
208 
217  std::unique_ptr<uint8_t []> upErrorBuffer;
218 
222  size_t bufferSize;
223 
227  size_t sizeWritten;
228 };
229 
231 enum SIPLModuleErrorReadFlag : std::uint8_t
232 {
247 };
248 
251 } // namespace nvsipl
252 
253 #endif // NVSIPLCOMMON_HPP
nvsipl::NvSiplPointFloat::y
float_t y
Holds the vertical location of the point.
Definition: NvSIPLCommon.hpp:129
nvsipl::NVSIPL_TIME_BASE_CLOCK_USER_DEFINED
@ NVSIPL_TIME_BASE_CLOCK_USER_DEFINED
Specifies that a user defined clock is used for base time calculation.
Definition: NvSIPLCommon.hpp:149
nvsipl::NvSiplRect::x1
uint16_t x1
Right X co-ordinate.
Definition: NvSIPLCommon.hpp:101
nvsipl::NVSIPL_MODULE_ERROR_READ_SERIALIZER
@ NVSIPL_MODULE_ERROR_READ_SERIALIZER
Read only serializer error information when getting error details.
Definition: NvSIPLCommon.hpp:242
nvsipl::NVSIPL_MODULE_ERROR_READ_ALL
@ NVSIPL_MODULE_ERROR_READ_ALL
Read both sensor and serializer error information when getting error details.
Definition: NvSIPLCommon.hpp:246
nvsipl::SIPLModuleErrorReadFlag
SIPLModuleErrorReadFlag
Flag indicating which module errors to read.
Definition: NvSIPLCommon.hpp:231
nvsipl::NVSIPL_STATUS_NOT_SUPPORTED
@ NVSIPL_STATUS_NOT_SUPPORTED
Indicates an unsupported operation or argument was encountered.
Definition: NvSIPLCommon.hpp:164
nvsipl::NVSIPL_STATUS_INVALID_STATE
@ NVSIPL_STATUS_INVALID_STATE
Indicates a module is in an invalid state.
Definition: NvSIPLCommon.hpp:172
nvsipl::NvSiplRect::y1
uint16_t y1
Bottom Y co-ordinate.
Definition: NvSIPLCommon.hpp:103
nvsipl::NVSIPL_GPIO_EVENT_ERROR_CAMGPIO
@ NVSIPL_GPIO_EVENT_ERROR_CAMGPIO
An error occurred in CAMGPIO code, potentially resulting in permanent loss of functionality.
Definition: NvSIPLCommon.hpp:196
nvsipl::SIPLErrorDetails::sizeWritten
size_t sizeWritten
Holds size of error written to the buffer, filled by driver.
Definition: NvSIPLCommon.hpp:227
nvsipl::NVSIPL_STATUS_OK
@ NVSIPL_STATUS_OK
Indicates the operation completed successfully without errors.
Definition: NvSIPLCommon.hpp:158
nvsipl::SIPLErrorDetails
Error details for a particular device.
Definition: NvSIPLCommon.hpp:212
nvsipl::NvSiplRect::x0
uint16_t x0
Left X co-ordinate.
Definition: NvSIPLCommon.hpp:97
nvsipl::NVSIPL_STATUS_RESOURCE_ERROR
@ NVSIPL_STATUS_RESOURCE_ERROR
Indicates a resource error was encountered.
Definition: NvSIPLCommon.hpp:168
nvsipl::NVSIPL_STATUS_OUT_OF_MEMORY
@ NVSIPL_STATUS_OUT_OF_MEMORY
Indicates an out of memory or other system resource error was encountered.
Definition: NvSIPLCommon.hpp:166
nvsipl::NvSiplPoint::x
int32_t x
Holds the horizontal location of the point.
Definition: NvSIPLCommon.hpp:116
nvsipl::SIPLStatus
SIPLStatus
Defines the status codes returned by functions in SIPL modules.
Definition: NvSIPLCommon.hpp:153
nvsipl::NvSiplPoint
Defines the location of a point on a two-dimensional object.
Definition: NvSIPLCommon.hpp:114
nvsipl::NVSIPL_STATUS_ERROR
@ NVSIPL_STATUS_ERROR
Indicates an unspecified error that is used when no other error code applies.
Definition: NvSIPLCommon.hpp:180
nvsipl::NvSiplGlobalTime
uint64_t NvSiplGlobalTime
Media global time, measured in microseconds.
Definition: NvSIPLCommon.hpp:109
nvsipl::NVSIPL_GPIO_EVENT_NOTHING
@ NVSIPL_GPIO_EVENT_NOTHING
There is no pending event.
Definition: NvSIPLCommon.hpp:187
nvsipl::NVSIPL_STATUS_EOF
@ NVSIPL_STATUS_EOF
Indicates that end of file has been reached.
Definition: NvSIPLCommon.hpp:174
nvsipl::NVSIPL_GPIO_EVENT_ERROR_UNKNOWN
@ NVSIPL_GPIO_EVENT_ERROR_UNKNOWN
A generic error occurred, potentially resulting in permanent loss of functionality.
Definition: NvSIPLCommon.hpp:206
nvsipl::NVSIPL_STATUS_NOT_INITIALIZED
@ NVSIPL_STATUS_NOT_INITIALIZED
Indicates a module was not initialized.
Definition: NvSIPLCommon.hpp:176
nvsipl::NVSIPL_STATUS_TIMED_OUT
@ NVSIPL_STATUS_TIMED_OUT
Indicates an operation timed out.
Definition: NvSIPLCommon.hpp:170
nvsipl::NvSiplRect
Holds a rectangular region of a surface.
Definition: NvSIPLCommon.hpp:95
nvsipl::SIPLErrorDetails::bufferSize
size_t bufferSize
Holds the maximum size of error data which can be contained in the buffer.
Definition: NvSIPLCommon.hpp:222
nvsipl::NVSIPL_GPIO_EVENT_INTR
@ NVSIPL_GPIO_EVENT_INTR
An interrupt has occured.
Definition: NvSIPLCommon.hpp:189
nvsipl::SIPLErrorDetails::upErrorBuffer
std::unique_ptr< uint8_t[]> upErrorBuffer
Buffer which will be filled by driver with error information.
Definition: NvSIPLCommon.hpp:217
nvsipl::NVSIPL_TIME_BASE_CLOCK_MONOTONIC
@ NVSIPL_TIME_BASE_CLOCK_MONOTONIC
Specifies that kernel monotonic clock is used for base time calculation.
Definition: NvSIPLCommon.hpp:146
nvsipl::NVSIPL_TIME_BASE_CLOCK_PTP
@ NVSIPL_TIME_BASE_CLOCK_PTP
Specifies that PTP clock is used for base time calculation.
Definition: NvSIPLCommon.hpp:143
nvsipl::SIPLGpioEvent
SIPLGpioEvent
CDAC GPIO event codes.
Definition: NvSIPLCommon.hpp:184
nvsipl::NvSiplRect::y0
uint16_t y0
Top Y co-ordinate.
Definition: NvSIPLCommon.hpp:99
nvsipl::NVSIPL_GPIO_EVENT_ERROR_BACKEND
@ NVSIPL_GPIO_EVENT_ERROR_BACKEND
An error occurred in backend code, potentially resulting in permanent loss of functionality.
Definition: NvSIPLCommon.hpp:201
nvsipl::NvSiplPointFloat
Defines the float-precision location of a point on a two-dimensional object.
Definition: NvSIPLCommon.hpp:125
nvsipl::NvSiplPointFloat::x
float_t x
Holds the horizontal location of the point.
Definition: NvSIPLCommon.hpp:127
nvsipl::NvSiplBool
uint32_t NvSiplBool
A boolean value, holding SIPL_TRUE or SIPL_FALSE.
Definition: NvSIPLCommon.hpp:136
nvsipl::NvSiplPoint::y
int32_t y
Holds the vertical location of the point.
Definition: NvSIPLCommon.hpp:118
nvsipl::NvSiplTimeBase
NvSiplTimeBase
Defines clock base for NvSiplTime.
Definition: NvSIPLCommon.hpp:140
nvsipl
Contains the classes and variables for implementation of SIPL.
Definition: NvSIPLCamera.hpp:44
nvsipl::NVSIPL_GPIO_EVENT_INTR_TIMEOUT
@ NVSIPL_GPIO_EVENT_INTR_TIMEOUT
An interrupt timeout period has elapsed.
Definition: NvSIPLCommon.hpp:191
nvsipl::NVSIPL_STATUS_FAULT_STATE
@ NVSIPL_STATUS_FAULT_STATE
Indicates module is in non-recoverable fault state.
Definition: NvSIPLCommon.hpp:178
nvsipl::NVSIPL_STATUS_BAD_ARGUMENT
@ NVSIPL_STATUS_BAD_ARGUMENT
Indicates one or more invalid arguments was encountered.
Definition: NvSIPLCommon.hpp:162
nvsipl::NVSIPL_MODULE_ERROR_READ_SENSOR
@ NVSIPL_MODULE_ERROR_READ_SENSOR
Read only sensor error information when getting module error details.
Definition: NvSIPLCommon.hpp:237