PSDK QNX API Guide
ClockP

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...
 

Variables

void * ClockP_Params::pErrBlk
 
uint8_t ClockP_Params::startMode
 
uint32_t ClockP_Params::period
 
uint8_t ClockP_Params::runMode
 
void * ClockP_Params::arg
 

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...
 
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...
 
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...
 
#define ClockP_StartMode_USER   ((uint8_t) 0U)
 
#define ClockP_StartMode_AUTO   ((uint8_t) 1U)
 

Detailed Description

ClockP interface

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

Variable Documentation

◆ pErrBlk

void* ClockP_Params::pErrBlk

Pointer to the error block for clock create

◆ startMode

uint8_t ClockP_Params::startMode

Timer Start Mode ClockP_StartMode

◆ period

uint32_t ClockP_Params::period

The clock period in units of clock ticks

◆ runMode

uint8_t ClockP_Params::runMode

Timer Run Mode ClockP_RunMode

◆ arg

void* ClockP_Params::arg

User argument that is available inside the callback