-
Enable
- Enables the bean - it starts the timer. Events may be generated ("DisableEvent"/"EnableEvent").
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
- Disables the bean - it stops the timer. No events will be generated.
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
- Enables 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
- Disables 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
-
SetPeriodMode
- Switches the bean to a specified mode (changes the period/frequency using the mode values). This method reduces the time needed for setting of a new period value. This method can be used only when a list of possible period settings is specified at design time (see
Timing dialog box - Runtime setting - from a list of values). Each of these settings constitutes a mode and Processor Expert assigns them a mode identifier. The prescaler and compare values corresponding to each mode are calculated at design time. Modes can be switched at runtime just by referring to a mode identifier. No run-time calculations are performed, all the calculations are performed at design time.
The modes and mode identifiers may be found in the include file *.h.
ANSIC prototype: byte SetPeriodMode(byte Mode)
- Mode:byte - Specifies a Mode to switch to
- Return value:byte - Error code, possible codes:
ERR_OK - OK
ERR_SPEED - This device does not work in the active speed mode
ERR_VALUE - Value out of range, requested timing mode is not defined
-
SetPeriodTicks16
- This method sets the new period of the generated events. The period is expressed in CPU ticks as a 16-bit unsigned integer number.
This method is available only if the runtime setting type 'from interval' is selected in the Timing dialog box in the Runtime setting area.
ANSIC prototype: byte SetPeriodTicks16(word Ticks)
- Ticks:word - Period to set [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_MATH - Overflow during evaluation
ERR_RANGE - Parameter out of range
-
SetPeriodTicks32
- This method sets the new period of the generated events. The period is expressed in CPU ticks as a 32-bit unsigned integer number.
This method is available only if the runtime setting type 'from interval' is selected in the Timing dialog box in the Runtime setting area.
ANSIC prototype: byte SetPeriodTicks32(dword Ticks)
- Ticks:dword - Period to set [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_MATH - Overflow during evaluation
ERR_RANGE - Parameter out of range
-
SetPeriodUS
- This method sets the new period of the generated events. The period is expressed in microseconds as a 16-bit unsigned integer number.
This method is available only if the runtime setting type 'from interval' is selected in the Timing dialog box in the Runtime setting area.
ANSIC prototype: byte SetPeriodUS(word Time)
- Time:word - Period to set [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_MATH - Overflow during evaluation
ERR_RANGE - Parameter out of range
-
SetPeriodMS
- This method sets the new period of the generated events. The period is expressed in miliseconds as a 16-bit unsigned integer number.
This method is available only if the runtime setting type 'from interval' is selected in the Timing dialog box in the Runtime setting area.
ANSIC prototype: byte SetPeriodMS(word Time)
- Time:word - Period to set [in miliseconds]
- Return value:byte - Error code, possible codes:
ERR_OK - OK
ERR_SPEED - This device does not work in the active speed mode
ERR_MATH - Overflow during evaluation
ERR_RANGE - Parameter out of range
-
SetPeriodSec
- This method sets the new period of the generated events. The period is expressed in seconds as a 16-bit unsigned integer number.
This method is available only if the runtime setting type 'from interval' is selected in the Timing dialog box in the Runtime setting area.
ANSIC prototype: byte SetPeriodSec(word Time)
- Time:word - Period to set [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_MATH - Overflow during evaluation
ERR_RANGE - Parameter out of range
-
SetPeriodReal
- This method sets the new period of the generated events. The period is expressed in seconds as a real number. To use this method the compiler have to support floating point operations.
This method is available only if the runtime setting type 'from interval' is selected in the Timing dialog box in the Runtime setting area.
ANSIC prototype: byte SetPeriodReal(float Time)
- Time:float - Period to set [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_MATH - Overflow during evaluation
ERR_RANGE - Parameter out of range
-
SetFreqHz
- This method sets the new frequency of the generated events. The frequency is expressed in Hz as a 16-bit unsigned integer number.
This method is available only if the runtime setting type 'from interval' is selected in the Timing dialog box in the Runtime setting area.
ANSIC prototype: byte SetFreqHz(word Freq)
- Freq:word - Frequency to set [in Hz]
- Return value:byte - Error code, possible codes:
ERR_OK - OK
ERR_SPEED - This device does not work in the active speed mode
ERR_MATH - Overflow during evaluation
ERR_RANGE - Parameter out of range
-
SetFreqkHz
- This method sets the new frequency of the generated events. The frequency is expressed in kHz as a 16-bit unsigned integer number.
This method is available only if the runtime setting type 'from interval' is selected in the Timing dialog box in the Runtime setting area.
ANSIC prototype: byte SetFreqkHz(word Freq)
- Freq:word - Frequency to set [in kHz]
- Return value:byte - Error code, possible codes:
ERR_OK - OK
ERR_SPEED - This device does not work in the active speed mode
ERR_MATH - Overflow during evaluation
ERR_RANGE - Parameter out of range
-
SetFreqMHz
- This method sets the new frequency of the generated events. The frequency is expressed in MHz as a 16-bit unsigned integer number.
This method is available only if the runtime setting type 'from interval' is selected in the Timing dialog box in the Runtime setting area.
ANSIC prototype: byte SetFreqMHz(word Freq)
- Freq:word - Frequency to set [in MHz]
- Return value:byte - Error code, possible codes:
ERR_OK - OK
ERR_SPEED - This device does not work in the active speed mode
ERR_MATH - Overflow during evaluation
ERR_RANGE - Parameter out of range
Note: Some methods can be implemented as macros.