Cyg_Alarm::Cyg_Alarm
Name: Cyg_Alarm::Cyg_Alarm ( ) - create an alarm
Synopsis:
Cyg_Alarm::Cyg_Alarm
(
  Cyg_Counter  *counter, /* Attached to this counter */
  cyg_alarm_fn *alarm,   /* Call-back function       */
  CYG_ADDRWORD data      /* Call-back data           */
)
Description: This creates a new alarm and attaches it to the specified counter. When the alarm expires the call-back function "alarm" will be called. The callback function takes one argument "data".

The callback is of the form: void cyg_alarm_fn(Cyg_Alarm *alarm, CYG_ADDRWORD data).

Include: #include <cyg/kernel/clock.hxx>
Returns: nothing
See Also: Cyg_Alarm::~Cyg_Alarm

Cyg_Alarm::~Cyg_Alarm
Name: Cyg_Alarm::~Cyg_Alarm ( ) - destroy an alarm
Synopsis:
Cyg_Alarm::~Cyg_Alarm
(
  void
)
Description: This disables and destroys an alarm.
Include: #include <cyg/kernel/clock.hxx>
Returns: nothing
See Also: Cyg_Alarm::Cyg_Alarm

Cyg_Alarm::initialize
Name: Cyg_Alarm::initialize ( ) - initialize an alarm
Synopsis:
void Cyg_Alarm::initialize
(
  cyg_tick_count trigger,   /* Absolute trigger time       */
  cyg_tick_count interval=0 /* Relative retrigger interval */
)
Description: This initializes an alarm. The trigger time is an absolute value of the associated counter. If the interval is set to 0, the alarm will not retrigger. If the interval is non 0, this alarm will reset automatically to fire again at trigger+interval, then trigger+(2*interval), etc.

The alarm will be enabled automatically after this call

Include: #include <cyg/kernel/clock.hxx>
Returns: nothing
See Also: Cyg_Alarm::enable, Cyg_Alarm::disable, Cyg_Alarm::get_times

Cyg_Alarm::enable
Name: Cyg_Alarm::enable ( ) - enable an alarm
Synopsis:
void Cyg_Alarm::enable
(
  void
)
Description: This enables an alarm. This is most often used when a periodic alarm has been disabled.

A periodic alarm that has been disabled and later re-enabled will fire at the same intervals it did previously. For example, a periodic alarm that fired every 10 seconds at time T0, T10, T20, T30... etc that was disabled for 15 seconds at time T31 and then renabled would then start firing again at T50, T60, T70 etc.

If this behavior is not desired, use Cyg_Alarm::initialize to reset the intervals.

Include: #include <cyg/kernel/clock.hxx>
Returns: nothing
See Also: Cyg_Alarm::initialize, Cyg_Alarm::disable, Cyg_Alarm::get_times

Cyg_Alarm::disable
Name: Cyg_Alarm::disable ( ) - disable an alarm
Synopsis:
void Cyg_Alarm::disable
(
  void
)
Description: Disables an alarm. Most often used to stop a periodic alarm. This can also be used to cancel an alarm, although using the destructor to do that might be more logical.

Cyg_Alarm::initialize or Cyg_Alarm::enable can be used to re-enable the alarm once it's been disabled.

Include: #include <cyg/kernel/clock.hxx>
#include <cyg/kernel/clock.inl>
Returns: nothing
See Also: Cyg_Alarm::initialize, Cyg_Alarm::enable

Cyg_Alarm::get_times
Name: Cyg_Alarm::get_times ( ) - get trigger and interval values
Synopsis:
void Cyg_Alarm::get_times
(
  cyg_tick_count *trigger, /* pointer to the next trigger time */
  cyg_tick_count *interval /* pointer to the current interval  */
)
Description: Get through pointers the next trigger time and the periodic retrigger interval. The function itself returns nothing.

It is legal to pass NULL as the "trigger" and "interval" pointers if those values are not needed.

Include: #include <cyg/kernel/clock.hxx>
Returns: nothing
See Also: Cyg_Alarm::initialize