clkmgr 2.0
Clock Manager API library to receive events from the PTP service
Loading...
Searching...
No Matches
Typedefs | Functions
subscription_c.h File Reference

C wrapper to set clock event subscription. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct Clkmgr_Subscription Clkmgr_Subscription
 

Functions

Clkmgr_Subscriptionclkmgr_constructSubscriptionInstance (void)
 
void clkmgr_destroySubscriptionInstance (Clkmgr_Subscription *sub_c)
 
bool clkmgr_setEventMask (Clkmgr_Subscription *sub_c, enum Clkmgr_ClockType clock_type, uint32_t mask)
 
uint32_t clkmgr_getEventMask (const Clkmgr_Subscription *sub_c, enum Clkmgr_ClockType clock_type)
 
bool clkmgr_setPtpCompositeEventMask (Clkmgr_Subscription *sub_c, uint32_t mask)
 
uint32_t clkmgr_getPtpCompositeEventMask (const Clkmgr_Subscription *sub_c)
 
bool clkmgr_setClockOffsetThreshold (Clkmgr_Subscription *sub_c, enum Clkmgr_ClockType clock_type, uint32_t threshold)
 
uint32_t clkmgr_getClockOffsetThreshold (const Clkmgr_Subscription *sub_c, enum Clkmgr_ClockType clock_type)
 
bool clkmgr_enableSubscription (Clkmgr_Subscription *sub_c, enum Clkmgr_ClockType clock_type)
 
bool clkmgr_disableSubscription (Clkmgr_Subscription *sub_c, enum Clkmgr_ClockType clock_type)
 
bool clkmgr_isSubscriptionEnabled (const Clkmgr_Subscription *sub_c, enum Clkmgr_ClockType clock_type)
 

Detailed Description

C wrapper to set clock event subscription.

Author
Goh Wei Sheng <wei.sheng.goh@intel.com>

Typedef Documentation

◆ Clkmgr_Subscription

Opaque alias for clock subscription

Function Documentation

◆ clkmgr_constructSubscriptionInstance()

Clkmgr_Subscription * clkmgr_constructSubscriptionInstance ( void  )

Construct a clock subscription object

Returns
Pointer to a new Clkmgr_Subscription object

◆ clkmgr_destroySubscriptionInstance()

void clkmgr_destroySubscriptionInstance ( Clkmgr_Subscription sub_c)

Destroy a clock subscription object

◆ clkmgr_disableSubscription()

bool clkmgr_disableSubscription ( Clkmgr_Subscription sub_c,
enum Clkmgr_ClockType  clock_type 
)

Disable the subscription of the specify clock.

Parameters
[in]sub_cPointer of the Clkmgr_Subscription
[in]clock_typeType of clock to disable
Returns
True if the subscription of clock is disable successfully, false otherwise.
Note
The clock type is a bit that represents a type of clock, as defined by enum Clkmgr_ClockType

◆ clkmgr_enableSubscription()

bool clkmgr_enableSubscription ( Clkmgr_Subscription sub_c,
enum Clkmgr_ClockType  clock_type 
)

Enable the subscription of the specify clock.

Parameters
[in]sub_cPointer of the Clkmgr_Subscription
[in]clock_typeType of clock to enable
Returns
True if the subscription of clock is enable successfully, false otherwise.
Note
The clock type is a bit that represents a type of clock, as defined by enum Clkmgr_ClockType

◆ clkmgr_getClockOffsetThreshold()

uint32_t clkmgr_getClockOffsetThreshold ( const Clkmgr_Subscription sub_c,
enum Clkmgr_ClockType  clock_type 
)

Get the threshold of specify clock offset

Parameters
[in]sub_cPointer of the Clkmgr_Subscription
[in]clock_typeThe type of clock to get
Returns
Threshold of clock offset
Note
The clock type is a bit that represents a type of clock, as defined by enum Clkmgr_ClockType

◆ clkmgr_getEventMask()

uint32_t clkmgr_getEventMask ( const Clkmgr_Subscription sub_c,
enum Clkmgr_ClockType  clock_type 
)

Get the value of the event mask

Parameters
[in]sub_cPointer of the Clkmgr_Subscription
[in]clock_typeThe type of clock to get
Returns
The value of the event mask
Note
The clock type is a bit that represents a type of clock, as defined by enum Clkmgr_ClockType

◆ clkmgr_getPtpCompositeEventMask()

uint32_t clkmgr_getPtpCompositeEventMask ( const Clkmgr_Subscription sub_c)

Get the value of the PTP composite event mask.

Parameters
[in]sub_cPointer of the Clkmgr_Subscription
Returns
The composite event mask.

◆ clkmgr_isSubscriptionEnabled()

bool clkmgr_isSubscriptionEnabled ( const Clkmgr_Subscription sub_c,
enum Clkmgr_ClockType  clock_type 
)

Check if the specify clock subscription is enabled

Parameters
[in]sub_cPointer of the Clkmgr_Subscription
[in]clock_typeType of clock to check
Returns
True if the specify clock subscription is enabled, false otherwise
Note
The clock type is a bit that represents a type of clock, as defined by enum Clkmgr_ClockType

◆ clkmgr_setClockOffsetThreshold()

bool clkmgr_setClockOffsetThreshold ( Clkmgr_Subscription sub_c,
enum Clkmgr_ClockType  clock_type,
uint32_t  threshold 
)

Set the threshold of specify clock offset

Parameters
[in]sub_cPointer of the Clkmgr_Subscription
[in]clock_typeThe type of clock to set
[in]thresholdThreshold of clock offset
Returns
True if the offset threshold is set successfully, false otherwise
Note
The clock type is a bit that represents a type of clock, as defined by enum Clkmgr_ClockType
The threshold sets a symmetric range of clock offset

◆ clkmgr_setEventMask()

bool clkmgr_setEventMask ( Clkmgr_Subscription sub_c,
enum Clkmgr_ClockType  clock_type,
uint32_t  mask 
)

Set the event mask

Parameters
[in]sub_cPointer of the Clkmgr_Subscription
[in]clock_typeThe type of clock to set
[in]maskThe new event mask to set
Returns
True if the event mask is set successfully, false otherwise
Note
The clock type is a bit that represents a type of clock, as defined by enum Clkmgr_ClockType
The event mask is a bitmask where each bit represents an event, as defined by enum Clkmgr_EventIndex

◆ clkmgr_setPtpCompositeEventMask()

bool clkmgr_setPtpCompositeEventMask ( Clkmgr_Subscription sub_c,
uint32_t  mask 
)

Set the PTP composite event mask.

Parameters
[in]sub_cPointer of the Clkmgr_Subscription
[in]maskThe new composite event mask to set.
Returns
True if the composite event mask is set successfully, false otherwise.
Note
The compositie event mask is a bitmask where each bit represents an event, as defined by enum Clkmgr_EventIndex and COMPOSITE_EVENT_ALL.