FreeCntr
 
 
 Bean FreeCntr
 
Free running counter

Methods are user callable functions/subroutines that are means of controlling the bean functions.

Methods:

  • Enable - Enable the bean - 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 - Disable the bean - the internal clocks are stopped.

      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

  • EnableEvent - Enable the events.

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

  • DisableEvent - Disable the events.

      ANSIC prototype: byte DisableEvent(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 resets the counter (sets to zero for up-counting HW or to appropriate value for down-counting HW).
    This method is available only if the counter register can be written.

      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

  • GetCounterValue - This method returns a content of counter.

      ANSIC prototype: byte GetCounterValue(word *Value)
    • Value: Pointer to word - Pointer to returned value.
    • Return value:byte - Error code, possible codes:
      ERR_OK - OK
      ERR_SPEED - This device does not work in the active speed mode

  • SetCompare - This method sets the appropriate compare (reload) register. Method is available only when compare or reload register is selected in the "Timer" property.

      ANSIC prototype: void SetCompare(word Value)
    • Value:word - This value is stored to compare register.

  • GetStatus - Get appropriate interrupt flag and clear it (only if flag is set). Method is available only when the 'Interrupt service/events' property is disabled - "Disable".

      ANSIC prototype: bool GetStatus(void)
    • Return value:bool - Status flag


Note: Some methods can be implemented as macros.



Processor ExpertTM and Embedded BeansTM are registered trademarks of UNIS, Ltd.
©1997-2005, UNIS, Ltd.