WPILibC++ 2027.0.0-alpha-5
Loading...
Searching...
No Matches
Notifier Functions

Functions

HAL_NotifierHandle HAL_CreateNotifier (int32_t *status)
 Creates a notifier.
void HAL_SetNotifierName (HAL_NotifierHandle notifierHandle, const struct WPI_String *name, int32_t *status)
 Sets the name of a notifier.
void HAL_DestroyNotifier (HAL_NotifierHandle notifierHandle)
 Destroys a notifier.
void HAL_SetNotifierAlarm (HAL_NotifierHandle notifierHandle, uint64_t alarmTime, uint64_t intervalTime, HAL_Bool absolute, HAL_Bool ack, int32_t *status)
 Updates the initial and interval alarm times for a notifier.
void HAL_CancelNotifierAlarm (HAL_NotifierHandle notifierHandle, HAL_Bool ack, int32_t *status)
 Cancels all future notifier alarms for a notifier.
void HAL_AcknowledgeNotifierAlarm (HAL_NotifierHandle notifierHandle, int32_t *status)
 Indicates the notifier alarm has been serviced.
int32_t HAL_GetNotifierOverrun (HAL_NotifierHandle notifierHandle, int32_t *status)
 Gets the overrun count for a notifier.

Detailed Description

Function Documentation

◆ HAL_AcknowledgeNotifierAlarm()

void HAL_AcknowledgeNotifierAlarm ( HAL_NotifierHandle notifierHandle,
int32_t * status )

Indicates the notifier alarm has been serviced.

Makes no change to future alarms.

One of HAL_SetNotifierAlarm (with ack=true), HAL_CancelNotifierAlarm (with ack=true), or this function must be called before waiting for the next alarm.

Parameters
[in]notifierHandlethe notifier handle
[out]statusError status variable. 0 on success.

◆ HAL_CancelNotifierAlarm()

void HAL_CancelNotifierAlarm ( HAL_NotifierHandle notifierHandle,
HAL_Bool ack,
int32_t * status )

Cancels all future notifier alarms for a notifier.

Parameters
[in]notifierHandlethe notifier handle
[in]acktrue to acknowledge any prior alarm
[out]statusError status variable. 0 on success.

◆ HAL_CreateNotifier()

HAL_NotifierHandle HAL_CreateNotifier ( int32_t * status)

Creates a notifier.

A notifier is an timer that alarms at an initial and (optionally) repeated intervals. This can be used to make precise control loops.

Parameters
[out]statusError status variable. 0 on success.
Returns
the created notifier

◆ HAL_DestroyNotifier()

void HAL_DestroyNotifier ( HAL_NotifierHandle notifierHandle)

Destroys a notifier.

Destruction wakes up any waiters.

Parameters
[in]notifierHandlethe notifier handle

◆ HAL_GetNotifierOverrun()

int32_t HAL_GetNotifierOverrun ( HAL_NotifierHandle notifierHandle,
int32_t * status )

Gets the overrun count for a notifier.

An overrun occurs when a notifier's alarm is not serviced before the next scheduled alarm time.

Parameters
[in]notifierHandlethe notifier handle
[out]statusError status variable. 0 on success.
Returns
overrun count

◆ HAL_SetNotifierAlarm()

void HAL_SetNotifierAlarm ( HAL_NotifierHandle notifierHandle,
uint64_t alarmTime,
uint64_t intervalTime,
HAL_Bool absolute,
HAL_Bool ack,
int32_t * status )

Updates the initial and interval alarm times for a notifier.

The alarmTime is an absolute time (using the WPI_Now() time base) if absolute is true, or relative to the current time if absolute is false.

If intervalTime is non-zero, the notifier will alarm periodically following alarmTime at the given interval.

If an absolute alarmTime is in the past, the notifier will alarm immediately.

Parameters
[in]notifierHandlethe notifier handle
[in]alarmTimethe first alarm time (in microseconds)
[in]intervalTimethe periodic interval time (in microseconds)
[in]absolutetrue if the alarm time is absolute
[in]acktrue to acknowledge any prior alarm
[out]statusError status variable. 0 on success.

◆ HAL_SetNotifierName()

void HAL_SetNotifierName ( HAL_NotifierHandle notifierHandle,
const struct WPI_String * name,
int32_t * status )

Sets the name of a notifier.

Parameters
[in]notifierHandlethe notifier handle
[in]namename
[out]statusError status variable. 0 on success.