[Previous] [Contents] [Index] [Next]

RtTimerCreate()

Create a realtime timer

Synopsis:

#include <photon/realtime/RtTimer.h>

RtTimer_t *RtTimerCreate( clockid_t clock_id,
                          int prio,
                          RtTimerCbF_t *cb,
                          void *data );

Library:

ph

Description:

This function creates a realtime timer.

The clock_id argument is the clock source; see the documentation for timer_create() in the QNX 6 Library Reference for the possible values.

The prio argument is the priority of the Photon pulse that will be used when the timer expires. The cb argument is the function that you want called when the timer expires. The RtTimerCbF_t type is:

typedef int RtTimerCbF_t( RtTimer_t *timer,
                          void *data );

The data argument is a pointer to a block of data that's passed to the cb function as its second argument.

The timer is disabled when created; it isn't enabled until you call RtTimerSetTime().

Returns:

A pointer to a RtTimer_t structure to be passed to the other routines dealing with realtime timers, or NULL if an error occurred.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

RtTimerDelete(), RtTimerGetTime(), RtTimerSetTime()

"Timers" in the Working with Code chapter of the Photon Programmer's Guide

timer_create() in the QNX 6 Library Reference


[Previous] [Contents] [Index] [Next]