DriveWorks SDK Reference
5.8.83 Release
For Test and Development only

Timer.h
Go to the documentation of this file.
1
2//
3// Notice
4// ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
5// NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
6// THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
7// MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8//
9// NVIDIA CORPORATION & AFFILIATES assumes no responsibility for the consequences of use of such
10// information or for any infringement of patents or other rights of third parties that may
11// result from its use. No license is granted by implication or otherwise under any patent
12// or patent rights of NVIDIA CORPORATION & AFFILIATES. No third party distribution is allowed unless
13// expressly authorized by NVIDIA. Details are subject to change without notice.
14// This code supersedes and replaces all information previously supplied.
15// NVIDIA CORPORATION & AFFILIATES products are not authorized for use as critical
16// components in life support devices or systems without express written approval of
17// NVIDIA CORPORATION & AFFILIATES.
18//
19// SPDX-FileCopyrightText: Copyright (c) 2017-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
20// SPDX-License-Identifier: LicenseRef-NvidiaProprietary
21//
22// NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
23// property and proprietary rights in and to this material, related
24// documentation and any modifications thereto. Any use, reproduction,
25// disclosure or distribution of this material and related documentation
26// without an express license agreement from NVIDIA CORPORATION or
27// its affiliates is strictly prohibited.
28//
30
46#ifndef DW_CORE_TIMER_H_
47#define DW_CORE_TIMER_H_
48
50#include <dw/core/base/Types.h>
51#include <dw/core/base/Status.h>
52
53#ifdef __cplusplus
54extern "C" {
55#endif
56
57// Forward declaration of dwContextHandle_t to not have circular dependency
58// @note: The API using the dwContextHandle_t is deprecated and will be removed with next major release
59// coverity[misra_c_2012_rule_1_1_violation]
60typedef struct dwContextObject* dwContextHandle_t;
61
62typedef struct dwTimeSourceObject* dwTimeSourceHandle_t;
63typedef struct dwTimeSourceObject const* dwConstTimeSourceHandle_t;
64
65typedef struct dwTimerObject* dwTimerHandle_t;
66typedef struct dwTimerObject const* dwConstTimerHandle_t;
67typedef void (*dwTimerWork)(void* ptr);
68
83DW_DEPRECATED("This method is replaced by dwTimer_initializeFromSource() which require a dwTimeSourceHandle_t which can be retrieved from dwContext")
84dwStatus dwTimer_initialize(dwTimerHandle_t* const timer, char8_t const* const timerName,
85 dwContextHandle_t const context);
86
102dwStatus dwTimer_initializeFromSource(dwTimerHandle_t* const timer, char8_t const* const timerName,
103 dwTimeSourceHandle_t const source);
104
116
129
141
157dwStatus dwTimer_scheduleTaskOneShot(dwTimerWork const task, void* const clientData,
158 dwTime_t const startTime, dwTimerHandle_t const timer);
159
176dwStatus dwTimer_scheduleTaskRecurring(dwTimerWork const task, void* const clientData,
177 dwTime_t const startTime, dwTime_t const period, dwTimerHandle_t const timer);
178
179#ifdef __cplusplus
180}
181#endif
182
184#endif // DW_CORE_TIMER_H_
NVIDIA DriveWorks API: Core Status Methods
NVIDIA DriveWorks API: Core Types
NVIDIA DriveWorks API: Core Exports
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:82
#define DW_DEPRECATED(msg)
Definition: Exports.h:66
#define DW_API_PUBLIC
Definition: Exports.h:54
dwStatus
Status definition.
Definition: Status.h:171
int64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: Types.h:82
struct dwTimeSourceObject * dwTimeSourceHandle_t
Definition: Timer.h:62
DW_API_PUBLIC dwStatus dwTimer_cancelAsync(dwTimerHandle_t const timer)
Asynchronously cancels all scheduled work associated with this timer.
DW_API_PUBLIC dwStatus dwTimer_release(dwTimerHandle_t const timer)
Release the timer instance.
DW_API_PUBLIC dwStatus dwTimer_initialize(dwTimerHandle_t *const timer, char8_t const *const timerName, dwContextHandle_t const context)
Creates and initializes a DW Timer.
DW_API_PUBLIC dwStatus dwTimer_scheduleTaskOneShot(dwTimerWork const task, void *const clientData, dwTime_t const startTime, dwTimerHandle_t const timer)
Scheduled a task to be run at a future time (non-recurring)
struct dwTimeSourceObject const * dwConstTimeSourceHandle_t
Definition: Timer.h:63
DW_API_PUBLIC dwStatus dwTimer_cancelSync(dwTimerHandle_t const timer)
Synchronously cancels all scheduled work associated with this timer.
struct dwTimerObject * dwTimerHandle_t
Definition: Timer.h:65
DW_API_PUBLIC dwStatus dwTimer_initializeFromSource(dwTimerHandle_t *const timer, char8_t const *const timerName, dwTimeSourceHandle_t const source)
Creates and initializes a DW Timer.
DW_API_PUBLIC dwStatus dwTimer_scheduleTaskRecurring(dwTimerWork const task, void *const clientData, dwTime_t const startTime, dwTime_t const period, dwTimerHandle_t const timer)
Scheduled a task to be run at a future time (recurring)
void(* dwTimerWork)(void *ptr)
Definition: Timer.h:67
struct dwContextObject * dwContextHandle_t
Definition: Timer.h:60
struct dwTimerObject const * dwConstTimerHandle_t
Definition: Timer.h:66