GD32A50x User Manual
450
This bit-field is writable only when the channel is not active (CH3EN bit in
TIMERx_CHCTL2 register is reset).
00: Channel 3 is programmed as output.
01: Channel 3 is programmed as input, IS3 is connected to CI3FE3.
10: Channel 3 is programmed as input, IS3 is connected to CI2FE3.
11: Channel 3 is programmed as input, IS3 is connected to ITS. This mode is
working only if an internal trigger input is selected (through TRGS bits in
TIMERx_SMCFG register).
7
CH2COMCEN
Channel 2 output compare clear enable.
When this bit is set, if the ETIFP signal is detected as high level, the O2CPRE signal
will be cleared.
0: Channel 2 output compare clear disabled
1: Channel 2 output compare clear enabled
6:4
CH2COMCTL[2:0]
Channel 2 compare output control
This bit-field controls the behavior of O2CPRE which drives CH2_O. The active level
of O2CPRE is high, while the active level of CH2_O depends on CH2P bit.
000: Timing mode. The O2CPRE signal keeps stable, independent of the
comparison between the output compare register TIMERx_CH2CV and the counter
TIMERx_CNT.
001: Set the channel output on match. O2CPRE signal is forced high when the
counter is equals to the output compare register TIMERx_CH2CV.
010: Clear the channel output on match. O2CPRE signal is forced low when the
counter is equals to the output compare register TIMERx_CH2CV.
011: Toggle on match. O2CPRE toggles when the counter is equals to the output
compare register TIMERx_CH2CV.
100: Force low. O2CPRE is forced to low level.
101: Force high. O2CPRE is forced to high level.
110: PWM mode 0. When counting up, O2CPRE is active when the counter is
smaller than TIMERx_CH2CV, otherwise it is inactive. When counting down,
O2CPRE is inactive when the counter is larger than TIMERx_CH2CV, otherwise it
is active.
111: PWM mode 1. When counting up, O2CPRE is inactive when the counter is
smaller than TIMERx_CH2CV, otherwise it is active. When counting down,
O2CPRE is active when the counter is larger than TIMERx_CH2CV, otherwise it is
inactive.
If configured in PWM mode, the O2CPRE level changes only when the output
compare mode is adjusted from
“Timing” mode to “PWM” mode or the comparison
result changes.
3
CH2COMSEN
Channel 2 compare output shadow enable
When this bit is set, the shadow register of TIMERx_CH2CV register, which updates
at each update event will be enabled.
0: Channel 2 output compare shadow disabled