Changeset eae4541d in rtems for cpukit/sapi


Ignore:
Timestamp:
Dec 21, 2016, 8:26:43 AM (2 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
0374ccd
Parents:
81af80e5
git-author:
Sebastian Huber <sebastian.huber@…> (12/21/16 08:26:43)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/21/16 08:27:19)
Message:

Clarify simple timecounter documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/sapi/include/rtems/timecounter.h

    r81af80e5 reae4541d  
    120120 *
    121121 * A simple timecounter can be used if the hardware provides no free running
    122  * counter or only the module used for the clock tick is available.  The period
    123  * of the simple timecounter equals the clock tick interval.  The interval is
     122 * counter.  A periodic hardware counter must be provided.  The counter period
     123 * must be synchronous to the clock tick.  The counter ticks per clock tick is
    124124 * scaled up to the next power of two.
    125125 *
    126126 * @param[in] tc Zero initialized simple timecounter.
    127  * @param[in] frequency_in_hz The timecounter frequency in Hz.
    128  * @param[in] timecounter_ticks_per_clock_tick The timecounter ticks per clock tick.
     127 * @param[in] counter_frequency_in_hz The hardware counter frequency in Hz.
     128 * @param[in] counter_ticks_per_clock_tick The hardware counter ticks per clock
     129 *   tick.
    129130 * @param[in] get_timecount The method to get the current time count.
    130131 *
     
    158159 * }
    159160 *
    160  * void install( void )
    161  * {
    162  *   uint32_t frequency = 123456;
    163  *   uint64_t us_per_tick = rtems_configuration_get_microseconds_per_tick();
    164  *   uint32_t timecounter_ticks_per_clock_tick =
    165  *     ( frequency * us_per_tick ) / 1000000;
     161 * void some_tc_init( void )
     162 * {
     163 *   uint64_t us_per_tick;
     164 *   uint32_t counter_frequency_in_hz;
     165 *   uint32_t counter_ticks_per_clock_tick;
     166 *
     167 *   us_per_tick = rtems_configuration_get_microseconds_per_tick();
     168 *   counter_frequency_in_hz = some_tc_get_frequency();
     169 *   counter_ticks_per_clock_tick =
     170 *     (uint32_t) ( counter_frequency_in_hz * us_per_tick ) / 1000000;
     171 *
     172 *   some_tc_init_hardware( counter_ticks_per_clock_tick );
     173 *   some_tc_init_clock_tick_interrupt( some_tc_tick );
    166174 *
    167175 *   rtems_timecounter_simple_install(
    168176 *     &some_tc,
    169  *     frequency,
    170  *     timecounter_ticks_per_clock_tick,
     177 *     counter_frequency_in_hz,
     178 *     counter_ticks_per_clock_tick,
    171179 *     some_tc_get_timecount
    172180 *   );
     
    181189void rtems_timecounter_simple_install(
    182190  rtems_timecounter_simple *tc,
    183   uint32_t                  frequency_in_hz,
    184   uint32_t                  timecounter_ticks_per_clock_tick,
     191  uint32_t                  counter_frequency_in_hz,
     192  uint32_t                  counter_ticks_per_clock_tick,
    185193  timecounter_get_t        *get_timecount
    186194);
Note: See TracChangeset for help on using the changeset viewer.