GD32W51x User Manual
915
26.3.8.
TSI operation flow
The normal operation flow of TSI is listed below:
System initialization, such as system clock configuration, TSI related GPIO configuration, etc.
Program TSI_CTL0, TSI_CHCFG, TSI_INTEN, TSI_SAMPCFG and GEx bits of TSI_GCTL
register according to demand.
Enable TSI by setting TSIEN bit in TSI_CTL0 register.
Optional for software trigger mode: program TSIS bit to start charging transfer sequence. In
hardware trigger mode, TSI is started by falling/rising edge on the trigger pin.
Wait for the CTCF or MNERR flag in TSI_INTF and clear these flags by writing TSI_INTC.
Read out the CYCN bits in TSI_GxCYCN registers.
26.3.9.
TSI flags and interrupts
Table 26-4. TSI errors and flags
Flag Nam e
Description
Cleared by
CTCF
TSI stops because all enabled samplers ’
sample pins reach
V
th
.
CCTCF bit in TSI_INTC
MNERR
TSI stops because the cycle number
reaches the maximum value.
CMNERR bit in TSI_INTC
26.3.10.
TSI GPIOs
Table 26-5. TSI pins
TSI
组
TSI
引脚
GPIO
引脚
第
0
引脚组
PIN0
PA0
PIN1
PA1
PIN2
PA2
PIN3
PA3
第
1
引脚组
PIN0
PB0
PIN1
PB1
PIN2
PB2
PIN3
PB10
第
2
引脚组
PIN0
PB11
PIN1
PB12
PIN2
PB13
PIN3
PB14