Visible to Intel only — GUID: mwh1416946976396
Ixiasoft
Visible to Intel only — GUID: mwh1416946976396
Ixiasoft
15.1.12. alt_alarm_start()
Prototype
int alt_alarm_start
( alt_alarm* alarm,
alt_u32 nticks,
alt_u32 (*callback) (void* context),
void* context )
Commonly Called By
C/C++ programsDevice drivers
Thread-safe
Yes.Available from ISR
Yes.Include
<sys/alt_alarm.h>Description
The alt_alarm_start() function schedules an alarm callback.For more information, refer to “Using Timer Devices” in the "Developing Programs Using the Hardware Abstraction Layer" chapter.
The HAL waits nticks system clock ticks before calling the callback() function. When the HAL calls callback(), it passes it the input argument context. The HAL does not use the context parameter. It only passes it as a parameter to the callback() function.
The alarm argument is a pointer to a structure that represents this alarm. You must create it, and it must have a lifetime that is at least as long as that of the alarm. However, you are not responsible for initializing the contents of the structure pointed to by alarm. This action is done by the call to alt_alarm_start().
One alarm is created for each call to alt_alarm_start(). Multiple alarms can run simultaneously.