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 (void *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...
 

Enumerations

enum  ClockP_Status { ClockP_OK = 0, ClockP_FAILURE = (-(int32_t)1) }
 Status codes for ClockP APIs. More...
 
enum  ClockP_RunMode { ClockP_RunMode_ONESHOT, ClockP_RunMode_CONTINUOUS }
 Timer runtime modes for ClockP APIs. More...
 
enum  ClockP_StartMode { ClockP_StartMode_USER, ClockP_StartMode_AUTO }
 Timer start modes for ClockP APIs. More...
 

Typedef Documentation

◆ 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

Enumeration Type Documentation

◆ ClockP_Status

Status codes for ClockP APIs.

Enumerator
ClockP_OK 

API completed successfully

ClockP_FAILURE 

API failed

◆ ClockP_RunMode

Timer runtime modes for ClockP APIs.

Enumerator
ClockP_RunMode_ONESHOT 

timer runs for a single period values and stops

ClockP_RunMode_CONTINUOUS 

timer is periodic and runs continuously

◆ ClockP_StartMode

Timer start modes for ClockP APIs.

Enumerator
ClockP_StartMode_USER 

timer will be started by the user

ClockP_StartMode_AUTO 

timer starts automatically after create or scheduler start

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 ( void *  clockfxn,
const ClockP_Params params 
)

Function to create a clock.

Parameters
clockfxnFunction pointer of the clock function.
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