PDK API Guide for J721E
ClockP.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
54 #ifndef ti_osal_ClockP__include
55 #define ti_osal_ClockP__include
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
61 #include <stdint.h>
62 #include <stdbool.h>
63 #include <stddef.h>
64 
68 typedef enum ClockP_Status_e
69 {
71  ClockP_OK = 0,
73  ClockP_FAILURE = (-(int32_t)1)
75 
85 typedef uint8_t ClockP_RunMode;
87 #define ClockP_RunMode_ONESHOT ((uint8_t) 0U)
88 
89 #define ClockP_RunMode_CONTINUOUS ((uint8_t) 1U)
90 /* @} */
91 
101 typedef uint8_t ClockP_StartMode;
103  #define ClockP_StartMode_USER ((uint8_t) 0U)
104 
105 #define ClockP_StartMode_AUTO ((uint8_t) 1U)
106 /* @} */
107 
114 typedef void *ClockP_Handle;
115 
122 typedef struct ClockP_Params_s
123 {
124  void *pErrBlk;
125  uint8_t startMode;
126  uint32_t period;
127  uint8_t runMode;
128  void *arg;
129 } ClockP_Params;
130 
136 extern void ClockP_Params_init(ClockP_Params *params);
137 
143 typedef void (*ClockP_FxnCallback)(void *args);
144 
155  const ClockP_Params *params);
156 
167 
178 
189 
190 #ifdef __cplusplus
191 }
192 #endif
193 
194 #endif /* ti_osal_ClockP__include */
195 /* @} */
uint32_t period
Definition: ClockP.h:126
ClockP_Status
Status codes for ClockP APIs.
Definition: ClockP.h:68
uint8_t ClockP_StartMode
This enumerator defines the Timer start modes.
Definition: ClockP.h:101
uint8_t runMode
Definition: ClockP.h:127
ClockP_Handle ClockP_create(ClockP_FxnCallback clockfxn, const ClockP_Params *params)
Function to create a clock.
void ClockP_Params_init(ClockP_Params *params)
Initialize params structure to default values.
Basic ClockP Parameters.
Definition: ClockP.h:122
void * ClockP_Handle
Opaque client reference to an instance of a ClockP.
Definition: ClockP.h:114
void * pErrBlk
Definition: ClockP.h:124
void * arg
Definition: ClockP.h:128
void(* ClockP_FxnCallback)(void *args)
Callback that is called when the clock expires.
Definition: ClockP.h:143
ClockP_Status ClockP_start(ClockP_Handle handle)
Function to start a clock.
uint8_t ClockP_RunMode
This enumerator defines the Timer runtime modes.
Definition: ClockP.h:85
ClockP_Status ClockP_delete(ClockP_Handle handle)
Function to delete a clock.
uint8_t startMode
Definition: ClockP.h:125
Definition: ClockP.h:73
ClockP_Status ClockP_stop(ClockP_Handle handle)
Function to stop a clock.
Definition: ClockP.h:71