www.beck-ipc.com

@CHIP-RTOS C Library V2.00 - Hardware API


hal_set_duty_cycle_waveform

Set timer duty cycle waveform

void hal_set_duty_cycle_waveform ( unsigned char timer,
                                   short mode,
                                   unsigned short clock_divider );

Parameters

timer

Which timer:
    0 = Timer0 / 1 = Timer1

mode

0=disable duty cycle
1=enable duty cycle

clock_divider

Alternate clock divider (if mode = 1)

Return Value

-- none --.

Comments

Set the duty cycle waveform of specified timer.

Use this function to modify the timer waveform behavior.   For example a 50% duty cycle waveform can be generated by specifying here an alternate clock divider value in clock_divider that is the same value as was used for the main clock divider value set in the Timer Initialization hal_init_timer function call.

Please note that the timer frequency will change if you use this function.  If you disable the duty cycle, the timer output will no longer generate a rectangle signal.   When duty cycle mode is disabled, the TMROUT pin switches low for only one clock cycle after the maximum count is reached.

See Also

RTOS API

This library function invokes a RTOS software interrupt. Refer to this RTOS API function's documentation for more details.


This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document