GD32VF103 User Manual
298
center-aligned and channel is configured in output mode (CHxMS=00 in
TIMERx_CHCTL0 register). Both when the counter is counting up and counting
down, compare interrupt flag of channels can be set.
After the counter is enabled, cannot be switched from 0x00 to non 0x00.
4
DIR
Direction
0: Count up
1: Count down
This bit is read only when 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 hardware and the counter stops at next update event.
2
UPS
Update source
This bit is used to select the update event sources by software.
0: When enabled, any of the following 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 with their preloaded values when one of the following 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, while the counter
and the prescaler are reinitialized if the UG bit is set or if the slave mode controller
generates a hardware reset event.
0
CEN
Counter enable
0: Counter disable
1: Counter enable
The CEN bit must be set by software when timer works in external clock, pause
mode and encoder mode. While in event mode, the hardware can set the CEN bit
automatically.
Control register 1 (TIMERx_CTL1)
Address offset: 0x04