1 | /* SPDX-License-Identifier: BSD-2-Clause */ |
---|
2 | |
---|
3 | /** |
---|
4 | * @file |
---|
5 | * |
---|
6 | * @ingroup RTEMSImplClassicTimer |
---|
7 | * |
---|
8 | * @brief This header file provides data structures used by the implementation |
---|
9 | * and the @ref RTEMSImplApplConfig to define ::_Timer_Information. |
---|
10 | */ |
---|
11 | |
---|
12 | /* |
---|
13 | * COPYRIGHT (c) 1989-2011. |
---|
14 | * On-Line Applications Research Corporation (OAR). |
---|
15 | * |
---|
16 | * Copyright (C) 2009, 2016 embedded brains GmbH & Co. KG |
---|
17 | * |
---|
18 | * Redistribution and use in source and binary forms, with or without |
---|
19 | * modification, are permitted provided that the following conditions |
---|
20 | * are met: |
---|
21 | * 1. Redistributions of source code must retain the above copyright |
---|
22 | * notice, this list of conditions and the following disclaimer. |
---|
23 | * 2. Redistributions in binary form must reproduce the above copyright |
---|
24 | * notice, this list of conditions and the following disclaimer in the |
---|
25 | * documentation and/or other materials provided with the distribution. |
---|
26 | * |
---|
27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
28 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
29 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
30 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
---|
31 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
32 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
33 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
34 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
35 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
36 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
---|
37 | * POSSIBILITY OF SUCH DAMAGE. |
---|
38 | */ |
---|
39 | |
---|
40 | #ifndef _RTEMS_RTEMS_TIMERDATA_H |
---|
41 | #define _RTEMS_RTEMS_TIMERDATA_H |
---|
42 | |
---|
43 | #include <rtems/rtems/timer.h> |
---|
44 | #include <rtems/score/objectdata.h> |
---|
45 | #include <rtems/score/watchdog.h> |
---|
46 | |
---|
47 | #ifdef __cplusplus |
---|
48 | extern "C" { |
---|
49 | #endif |
---|
50 | |
---|
51 | /** |
---|
52 | * @addtogroup RTEMSImplClassicTimer |
---|
53 | * |
---|
54 | * @{ |
---|
55 | */ |
---|
56 | |
---|
57 | /** |
---|
58 | * The following records define the control block used to manage |
---|
59 | * each timer. |
---|
60 | */ |
---|
61 | typedef struct { |
---|
62 | /** This field is the object management portion of a Timer instance. */ |
---|
63 | Objects_Control Object; |
---|
64 | /** This field is the Watchdog instance which will be the scheduled. */ |
---|
65 | Watchdog_Control Ticker; |
---|
66 | /** This field indicates what type of timer this currently is. */ |
---|
67 | Timer_Classes the_class; |
---|
68 | /** This field is the timer service routine. */ |
---|
69 | rtems_timer_service_routine_entry routine; |
---|
70 | /** This field is the timer service routine user data. */ |
---|
71 | void *user_data; |
---|
72 | /** This field is the timer interval in ticks or seconds. */ |
---|
73 | Watchdog_Interval initial; |
---|
74 | /** This field is the timer start time point in ticks. */ |
---|
75 | Watchdog_Interval start_time; |
---|
76 | /** This field is the timer stop time point in ticks. */ |
---|
77 | Watchdog_Interval stop_time; |
---|
78 | } Timer_Control; |
---|
79 | |
---|
80 | /** |
---|
81 | * @brief The Classic Timer objects information. |
---|
82 | */ |
---|
83 | extern Objects_Information _Timer_Information; |
---|
84 | |
---|
85 | /** |
---|
86 | * @brief Macro to define the objects information for the Classic Timer |
---|
87 | * objects. |
---|
88 | * |
---|
89 | * This macro should only be used by <rtems/confdefs.h>. |
---|
90 | * |
---|
91 | * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag |
---|
92 | * may be set). |
---|
93 | */ |
---|
94 | #define TIMER_INFORMATION_DEFINE( max ) \ |
---|
95 | OBJECTS_INFORMATION_DEFINE( \ |
---|
96 | _Timer, \ |
---|
97 | OBJECTS_CLASSIC_API, \ |
---|
98 | OBJECTS_RTEMS_TIMERS, \ |
---|
99 | Timer_Control, \ |
---|
100 | max, \ |
---|
101 | OBJECTS_NO_STRING_NAME, \ |
---|
102 | NULL \ |
---|
103 | ) |
---|
104 | |
---|
105 | /** @} */ |
---|
106 | |
---|
107 | #ifdef __cplusplus |
---|
108 | } |
---|
109 | #endif |
---|
110 | |
---|
111 | #endif |
---|
112 | /* end of include file */ |
---|