PDK API Guide for J721E
ClockP

Introduction

ClockP interface

Files

file  ClockP.h
 Clock module for the RTOS Porting Interface. This implements the software timer support. For hardware timer support, please check TimerP.h.
 

Data Structures

struct  ClockP_Params
 Basic ClockP Parameters. More...
 

Functions

void ClockP_Params_init (ClockP_Params *params)
 Initialize params structure to default values. More...
 
ClockP_Handle ClockP_create (ClockP_FxnCallback clockfxn, const ClockP_Params *params)
 Function to create a clock. More...
 
ClockP_Status ClockP_delete (ClockP_Handle handle)
 Function to delete a clock. More...
 
ClockP_Status ClockP_start (ClockP_Handle handle)
 Function to start a clock. More...
 
ClockP_Status ClockP_stop (ClockP_Handle handle)
 Function to stop a clock. More...
 

Typedefs

typedef void * ClockP_Handle
 Opaque client reference to an instance of a ClockP. More...
 
typedef void(* ClockP_FxnCallback) (void *args)
 Callback that is called when the clock expires. More...
 

Status codes for ClockP APIs

typedef int32_t ClockP_Status
 Status codes for ClockP APIs. More...
 
#define ClockP_OK   ((int32_t) 0)
 
#define ClockP_FAILURE   ((int32_t) (-1))
 

Timer runtime modes for ClockP APIs

typedef uint8_t ClockP_RunMode
 This enumerator defines the Timer runtime modes. More...
 
#define ClockP_RunMode_ONESHOT   ((uint8_t) 0U)
 
#define ClockP_RunMode_CONTINUOUS   ((uint8_t) 1U)
 

Timer start modes for ClockP APIs

typedef uint8_t ClockP_StartMode
 This enumerator defines the Timer start modes. More...
 
#define ClockP_StartMode_USER   ((uint8_t) 0U)
 
#define ClockP_StartMode_AUTO   ((uint8_t) 1U)
 

Macro Definition Documentation

◆ ClockP_OK

#define ClockP_OK   ((int32_t) 0)

API completed successfully

◆ ClockP_FAILURE

#define ClockP_FAILURE   ((int32_t) (-1))

API failed

◆ ClockP_RunMode_ONESHOT

#define ClockP_RunMode_ONESHOT   ((uint8_t) 0U)

Timer runs for a single period values and stops

◆ ClockP_RunMode_CONTINUOUS

#define ClockP_RunMode_CONTINUOUS   ((uint8_t) 1U)

Timer is periodic and runs continuously

◆ ClockP_StartMode_USER

#define ClockP_StartMode_USER   ((uint8_t) 0U)

Timer will be started by the user

◆ ClockP_StartMode_AUTO

#define ClockP_StartMode_AUTO   ((uint8_t) 1U)

Timer starts automatically after create or scheduler start

Typedef Documentation

◆ ClockP_Status

typedef int32_t ClockP_Status

Status codes for ClockP APIs.

◆ ClockP_RunMode

typedef uint8_t ClockP_RunMode

This enumerator defines the Timer runtime modes.

◆ ClockP_StartMode

typedef uint8_t ClockP_StartMode

This enumerator defines the Timer start modes.

◆ ClockP_Handle

typedef void* ClockP_Handle

Opaque client reference to an instance of a ClockP.

A ClockP_Handle returned from the ClockP_create represents that instance and is used in the other instance based functions

◆ ClockP_FxnCallback

typedef void(* ClockP_FxnCallback) (void *args)

Callback that is called when the clock expires.

Parameters
args[in] user specific argument pointer that was passed via ClockP_Params

Function Documentation

◆ ClockP_Params_init()

void ClockP_Params_init ( ClockP_Params params)

Initialize params structure to default values.

Parameters
paramsPointer to the instance configuration parameters.

◆ ClockP_create()

ClockP_Handle ClockP_create ( ClockP_FxnCallback  clockfxn,
const ClockP_Params params 
)

Function to create a clock.

Parameters
clockfxnFunction pointer of the clock function ClockP_FxnCallback.
paramsPointer to the instance configuration parameters.
Returns
A ClockP_Handle on success or a NULL on an error

◆ ClockP_delete()

ClockP_Status ClockP_delete ( ClockP_Handle  handle)

Function to delete a clock.

Parameters
handleA ClockP_Handle returned from ClockP_create
Returns
Status of the functions
  • ClockP_OK: Deleted the clock instance
  • ClockP_FAILURE: Failed to delete the clock instance

◆ ClockP_start()

ClockP_Status ClockP_start ( ClockP_Handle  handle)

Function to start a clock.

Parameters
handleA ClockP_Handle returned from ClockP_create
Returns
Status of the functions
  • ClockP_OK: Started the clock instance
  • ClockP_FAILURE: Failed to start the clock instance

◆ ClockP_stop()

ClockP_Status ClockP_stop ( ClockP_Handle  handle)

Function to stop a clock.

Parameters
handleA ClockP_Handle returned from ClockP_create
Returns
Status of the functions
  • ClockP_OK: Stopped the clock instance
  • ClockP_FAILURE: Failed to stop the clock instance