Cyg_Clock::Cyg_Clock
Name: Cyg_Clock::Cyg_Clock ( ) - create a clock
Synopsis:
Cyg_Clock::Cyg_Clock
(
  cyg_resolution resolution /* resolution */
)
Description: Creates a clock with an associated resolution.

All a clock is is a counter with an associated resolution. It's a class derived from Cyg_Counter. All you use it for is to store and save resolutions of the clock.

Since this is a derived class, study the "counter" documentation for more information on counters.

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

Cyg_Clock::~Cyg_Clock
Name: Cyg_Clock::~Cyg_Clock ( ) - destroy a clock
Synopsis:
Cyg_Clock::~Cyg_Clock
(
  void
)
Description: This destroys a clock and the counter it's associated with
Include: #include <cyg/kernel/clock.hxx>
Returns: nothing
See Also: Cyg_Clock::Cyg_Clock

Cyg_Clock::get_resolution
Name: Cyg_Clock::get_resolution ( ) - get the resolution of the clock
Synopsis:
cyg_resolution Cyg_Clock::get_resolution
(
  void
)
Description: Gets the resolution of this clock
Include: #include <cyg/kernel/clock.hxx>
#include <cyg/kernel/clock.inl>
Returns: the resolution of this clock.
See Also: Cyg_Clock::set_resolution

Cyg_Clock::set_resolution
Name: Cyg_Clock::set_resolution ( ) - set clock resolution
Synopsis:
void Cyg_Clock::set_resolution
(
  cyg_resolution resolution /* new resolution */
)
Description: This sets the resolution of the clock
Include: #include <cyg/kernel/clock.hxx>
#include <cyg/kernel/clock.inl>
Returns: nothing
See Also: Cyg_Clock::get_resolution

Cyg_Clock::get_other_to_clock_converter
Name: Cyg_Clock::get_other_to_clock_converter ( ) - setup clock conversion
Synopsis:
void Cyg_Clock::get_other_to_clock_converter
(
  cyg_uint64       ns_per_other_tick, /* ns/tick of the other clock */
  struct converter *pcc               /* conversion struct          */
)
Description: THIS DESCRIPTION MAY BE WRONG

This, as far as I can tell, sets up a conversion from one clock to another. This must be used in conjunction with Cyg_Clock::convert to be of any use. This is so you can relate one clock (or counter) to another.

This converts from the other clock to this clock.

the struct converter is: struct converter {cyg_uint64 mul1, div1, mul2, div2;}. Clock ticks = (((otherticks*mul1)/div1)*mul2/div2)

Include: #include <cyg/kernel/clock.hxx>
Returns: nothing
See Also: Cyg_Clock::get_clock_to_other_converter, Cyg_Clock::convert

Cyg_Clock::get_clock_to_other_converter
Name: Cyg_Clock::get_clock_to_other_converter ( ) - setup clock conversion
Synopsis:
void Cyg_Clock::get_clock_to_other_converter
(
  cyg_uint64       ns_per_other_tick, /* ns/tick of the other clock */
  struct converter *pcc               /* conversion struct          */
)
Description: THIS DESCRIPTION MAY BE WRONG

This, as far as I can tell, sets up a conversion from one clock to another. This must be used in conjunction with Cyg_Clock::convert to be of any use. This is so you can relate one clock (or counter) to another.

This converts from this clock to the other clock.

the struct converter is: struct converter {cyg_uint64 mul1, div1, mul2, div2;}. Clock ticks = (((otherticks*mul1)/div1)*mul2/div2)

Include: #include <cyg/kernel/clock.hxx>
Returns: nothing
See Also: Cyg_Clock::get_other_to_clock_converter, Cyg_Clock::convert

Cyg_Clock::convert
Name: Cyg_Clock::convert ( ) - convert from one clock to another
Synopsis:
static cyg_tick_count Cyg_Clock::convert
(
  cyg_tick_count   value, /* ns/tick of this clock */
  struct converter *pcc   /* conversion struct     */
)
Description: THIS DESCRIPTION MAY BE WRONG

I think this does a conversion from this clock value to another. I need help with this. It's not obvious why these are broken up into 3 seperate function calls. I don't see many people needing this functionality.

Include: #include <cyg/kernel/clock.hxx>
#include <cyg/kernel/clock.inl>
Returns: The converted clock ticks.
See Also: Cyg_Clock::get_other_to_clock_converter, Cyg_Clock::get_clock_to_other_converter