DriveWorks SDK Reference
5.12.103 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-2023 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
57typedef struct dwTimeSourceObject* dwTimeSourceHandle_t;
58typedef struct dwTimeSourceObject const* dwConstTimeSourceHandle_t;
59
60typedef struct dwTimerObject* dwTimerHandle_t;
61typedef struct dwTimerObject const* dwConstTimerHandle_t;
62typedef void (*dwTimerWork)(void* ptr);
63
79dwStatus dwTimer_initializeFromSource(dwTimerHandle_t* const timer, char8_t const* const timerName,
80 dwTimeSourceHandle_t const source);
81
93
106
118
134dwStatus dwTimer_scheduleTaskOneShot(dwTimerWork const task, void* const clientData,
135 dwTime_t const startTime, dwTimerHandle_t const timer);
136
153dwStatus dwTimer_scheduleTaskRecurring(dwTimerWork const task, void* const clientData,
154 dwTime_t const startTime, dwTime_t const period, dwTimerHandle_t const timer);
155
156#ifdef __cplusplus
157}
158#endif
159
161#endif // DW_CORE_TIMER_H_
dwStatus
Status definition.
Definition: ErrorDefs.h:45
NVIDIA DriveWorks API: Core Status Methods
NVIDIA DriveWorks API: Core Types
NVIDIA DriveWorks API: Core Exports
int64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: BasicTypes.h:64
#define DW_API_PUBLIC
Definition: Exports.h:54
struct dwTimeSourceObject * dwTimeSourceHandle_t
Definition: Timer.h:57
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_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:58
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:60
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:62
struct dwTimerObject const * dwConstTimerHandle_t
Definition: Timer.h:61