GD32W51x User Manual
524
TIMERx_CHCTL0 register). Only w hen the counter is counting dow n, compar e
interrupt flag of channels can be set.
10: Center-aligned and counting up assert mode. The counter counts under center -
aligned and channel is configured in output mode (CHxMS=00 in TIMERx_CH C T L0
register). Only w hen the counter is counting up, compare interrupt flag of channels
can be set.
11: Center-aligned and counting up/dow n assert mode. The counter counts under
center-aligned and channel is configured in output mode (CHxMS=00 in
TIMERx_CHCTL0 register). Both w hen the counter is counting up and counting
dow n, compare interrupt flag of channels can be set.
After the counter is enabled, cannot be sw itched from 0x00 to non 0x00.
4
DIR
Direction
0: Count up
1: Count dow n
This bit is read only w hen the timer is configured in Center-aligned mode or Encoder
mode.
3
SPM
Single pulse mode.
0: Counter continues after update event.
1: The CEN is cleared by hardw are and the counter stops at next update event.
2
UPS
Update source
This bit is used to select the update event sources by softw are.
0: When enabled, any of the follow ing events generate an update interrupt or DMA
request:
The UPG bit is set
The counter generates an overflow or underflow event
The slave mode controller generates an update event.
1: When enabled, only counter overflow /underflow generates an update interrupt or
DMA request.
1
UPDIS
Update disable.
This bit is used to enable or disable the update event generation.
0: update event enable. The update event is generate and the buffered registers are
loaded w ith their preloaded values w hen one of the follow ing events occurs:
The UPG bit is set
The counter generates an overflow or underflow event
The slave mode controller generates an update event.
1: update event disable. The buffered registers keep their value, w hile the counter
and the prescaler are reinitialized if the UG bit is set or if the slave mode controller
generates a hardw are reset event.
0
CEN
Counter enable
0: Counter disable
1: Counter enable