|
|
|
Bean
PPG
|
Programmable pulse generation
Methods are user callable functions/subroutines that are means of controlling the bean functions.
|
Methods:
-
Enable
- Enables the bean - it starts the signal generation. 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 signal generation and events calling. When the timer is disabled, it is possible to call "ClrValue" and "SetValue" methods.
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). Each mode is identified by a single 8-bit unsigned number which expresses one period/frequency of the generated signal. This method reduce the time needed for setting 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.
ANSIC prototype: byte SetPeriodMode(byte Mode)
- Mode:byte - Mode to switch to (0 to N)
- 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, the requested timing mode is not defined
-
SetPeriodTicks16
- This method sets the new period of the output signal. The period is expressed in CPU ticks as a 16-bit unsigned integer number.
This method is only available when the runtime setting type 'from interval' is selected in the Timing dialog box of 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 output signal. The period is expressed in CPU ticks as a 32-bit unsigned integer number.
This method is only available when the runtime setting type 'from interval' is selected in the Timing dialog box of 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 output signal. The period is expressed in microseconds as a 16-bit unsigned integer number.
This method is only available when the runtime setting type 'from interval' is selected in the Timing dialog box of 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 output signal. The period is expressed in milliseconds as a 16-bit unsigned integer number.
This method is only available when the runtime setting type 'from interval' is selected in the Timing dialog box of the Runtime setting area.
ANSIC prototype: byte SetPeriodMS(word Time)
- Time:word - Period to set [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_MATH - Overflow during evaluation ERR_RANGE - Parameter out of range
-
SetPeriodSec
- This method sets the new period of the output signal. The period is expressed in seconds as a 16-bit unsigned integer number.
This method is only available when the runtime setting type 'from interval' is selected in the Timing dialog box of 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 output signal. 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 only available when the runtime setting type 'from interval' is selected in the Timing dialog box of 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 output signal. The frequency is expressed in Hz as a 16-bit unsigned integer number.
This method is only available when the runtime setting type 'from interval' is selected in the Timing dialog box of 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 output signal. The frequency is expressed in kHz as a 16-bit unsigned integer number.
This method is only available when the runtime setting type 'from interval' is selected in the Timing dialog box of 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 output signal. The frequency is expressed in MHz as a 16-bit unsigned integer number.
This method is only available when the runtime setting type 'from interval' is selected in the Timing dialog box of 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
-
SetRatio8
- This method sets a new duty-cycle ratio. The ratio is expressed as an 8-bit unsigned integer number. 0 - FF value is proportional to ratio 0 - 100%.
Note: Calculated duty depends on the timer possibilities and on the selected period.
ANSIC prototype: byte SetRatio8(byte Ratio)
- Ratio:byte - Ratio to set. 0 - 255 value is proportional to ratio 0 - 100%
- Return value:byte - Error code, possible codes:
ERR_OK - OK ERR_SPEED - This device does not work in the active speed mode
-
SetRatio16
- This method sets a new duty-cycle ratio. Ratio is expressed as a 16-bit unsigned integer number. 0 - FFFF value is proportional to ratio 0 - 100%.
Note: Calculated duty depends on the timer possibilities and on the selected period.
ANSIC prototype: byte SetRatio16(word Ratio)
- Ratio:word - Ratio to set. 0 - 65535 value is proportional to ratio 0 - 100%
- Return value:byte - Error code, possible codes:
ERR_OK - OK ERR_SPEED - This device does not work in the active speed mode
-
SetDutyTicks16
- This method sets the new duty value of the output signal. The duty is expressed in Xtal ticks as a 16-bit unsigned integer number.
ANSIC prototype: byte SetDutyTicks16(word Ticks)
- Ticks:word - Duty 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
-
SetDutyTicks32
- This method sets the new duty value of the output signal. The duty is expressed in Xtal ticks as a 32-bit unsigned integer number.
ANSIC prototype: byte SetDutyTicks32(dword Ticks)
- Ticks:dword - Duty 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
-
SetDutyUS
- This method sets the new duty value of the output signal. The duty is expressed in microseconds as a 16-bit unsigned integer number.
ANSIC prototype: byte SetDutyUS(word Time)
- Time:word - Duty 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
-
SetDutyMS
- This method sets the new duty value of the output signal. The duty is expressed in milliseconds as a 16-bit unsigned integer number.
ANSIC prototype: byte SetDutyMS(word Time)
- Time:word - Duty to set [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_MATH - Overflow during evaluation ERR_RANGE - Parameter out of range
-
SetDutySec
- This method sets the new duty value of the output signal. The duty is expressed in seconds as a 16-bit unsigned integer number.
ANSIC prototype: byte SetDutySec(word Time)
- Time:word - Duty 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
-
SetDutyReal
- This method sets the new duty value of the output signal. The duty is expressed in seconds as a real number. To use this method the compiler have to support floating point operations.
ANSIC prototype: byte SetDutyReal(float Time)
- Time:float - Duty 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
-
SetValue
- This method sets (sets to "1" = "High") timer flip-flop output signal level. It allow user to directly set the output pin value (=flip-flop state), and can set the signal polarity. This method only works when the timer is disabled (Disable) otherwise it returns the error code. "ClrValue" and "SetValue" methods are used for setting the initial state.
ANSIC prototype: byte SetValue(void)
- Return value:byte - Error code, possible codes:
ERR_OK - OK ERR_SPEED - This device does not work in the active speed mode ERR_ENABLED - Bean is enabled. Bean must be disabled (see "Disable method")
-
ClrValue
- This method clears (sets to "0" = "Low") timer flip-flop output signal level. It allow user to directly set the output pin value (=flip-flop state), and can set the signal polarity. This method only works when the timer is disabled (Disable) otherwise it returns the error code. "ClrValue" and "SetValue" methods are used for setting the initial state.
ANSIC prototype: byte ClrValue(void)
- Return value:byte - Error code, possible codes:
ERR_OK - OK ERR_SPEED - This device does not work in the active speed mode ERR_ENABLED - Bean is enabled. Bean must be disabled (see "Disable method")
- Methods for Freescale HCS12 and HCS12X derivatives only.
-
GetShutdownStatus
- Returns the actual emergency shutdown status information if the input pin is asserted or de-asserted by Input active level.
Method is available only when Emergency interrupt service/event is enabled.
ANSIC prototype: bool GetShutdownStatus(void)
- Return value:bool -
FALSE - input pin is de-asserted (status inactive) TRUE - input pin is asserted (status active)
-
RestartPWM
- Restarts PWM after the Emergency shutdown interrupt. The PWM can only be restarted if the PWM channel input is de-asserted. PWM channels start running after corresponding counter passes next "counter == 0" phase.
Method is available only when Emergency interrupt service/event is enabled.
ANSIC prototype: void RestartPWM(void)
Note: Some methods can be implemented as macros.
|
|
|
Processor ExpertTM and Embedded BeansTM are registered trademarks of UNIS, Ltd.
©1997-2005, UNIS, Ltd.
|
|
|