FreeCntr32
 
Component FreeCntr32
Time measurement counting periodic interrupt ticks in 32-bit SW counter (suitable for longer time periods).
Component Level: High
Methods:
(Methods are user-callable functions/subroutines intended for the component functions control. Please see the Embedded Components page for more information.)
  • Enable - This method enables the component - the internal clocks are counted.

      ANSIC prototype: byte Enable(void)
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode

  • Disable - This method disables the component - the internal clocks are not counted.

      ANSIC prototype: byte Disable(void)
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode

  • Reset - This method clears the counter.

      ANSIC prototype: byte Reset(void)
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode

  • GetTicks16 - This method returns the number (as a 16-bit unsigned integer) of main oscillator (Xtal) ticks since the last reset.

      ANSIC prototype: byte GetTicks16(word *Ticks)
    • Ticks: Pointer to word - A pointer to the returned 16-bit value in Xtal ticks
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode
      ERR_OVERFLOW - Software counter overflow
      ERR_MATH - Overflow during evaluation

  • GetTicks32 - This method returns the number (as a 32-bit unsigned integer) of main oscillator (Xtal) ticks since the last reset.

      ANSIC prototype: byte GetTicks32(dword *Ticks)
    • Ticks: Pointer to dword - A pointer to the returned 32-bit value in Xtal ticks
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode
      ERR_OVERFLOW - Software counter overflow
      ERR_MATH - Overflow during evaluation

  • GetTicks64 - This method returns the number (as a 64-bit unsigned integer) of main oscillator (Xtal) ticks since the last reset.

      ANSIC prototype: byte GetTicks64(dlong *Ticks)
    • Ticks: Pointer to dlong - A pointer to the returned 64-bit value in Xtal ticks
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode
      ERR_OVERFLOW - Software counter overflow
      ERR_MATH - Overflow during evaluation

  • GetTimeUS - This method returns the time (as a 16-bit unsigned integer) in microseconds since the last resetting after the last reset.

      ANSIC prototype: byte GetTimeUS(word *Time)
    • Time: Pointer to word - A pointer to the returned 16-bit value in microseconds
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode
      ERR_OVERFLOW - Software counter overflow
      ERR_MATH - Overflow during evaluation

  • GetTimeMS - This method returns the time (as a 16-bit unsigned integer) in milliseconds since the last resetting after the last reset.

      ANSIC prototype: byte GetTimeMS(word *Time)
    • Time: Pointer to word - A pointer to the returned 16-bit value in milliseconds
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode
      ERR_OVERFLOW - Software counter overflow
      ERR_MATH - Overflow during evaluation

  • GetTimeSec - This method returns the time (as a 16-bit unsigned integer) in seconds since the last resetting after the last reset.

      ANSIC prototype: byte GetTimeSec(word *Time)
    • Time: Pointer to word - A pointer to the returned 16-bit value in seconds
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode
      ERR_OVERFLOW - Software counter overflow
      ERR_MATH - Overflow during evaluation

  • GetTimeReal - This method returns the time in seconds since the last resetting as a real (floating point) number. To use this method the compiler have to support floating point operations.

      ANSIC prototype: byte GetTimeReal(float *Time)
    • Time: Pointer to float - A pointer to the returned floating point value in seconds
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode
      ERR_OVERFLOW - Software counter overflow
      ERR_MATH - Overflow during evaluation


Note: Some methods can be implemented as macros.