GD32W51x User Manual
1005
HPDF_CH0CTL register, the coefficient of prescaler is CKOUTDIV[7:0] + 1.
2.
Configure the serial interface type and input clock phase: configure the serial interface
type as SPI code or Manchester code, and determine the clock input sampling edge
by
the SITYP[1:0] bit field in HPDF_CHxCTL register.
3.
Configure input clock source: select the clock source of serial interface as serial input
clock or serial output clock by configuring SPICKSS[1:0] in HPDF_CHxCTL register.
4.
Configure data offset correction and shift right bits: DTRS[4:0] defines the bits of the final
data shift right in HPDF_CHxCFG register. After data shift, perform offset calibration
defined by CALOFF [23:0] bit field.
5.
Enable short circuit detection and clock loss detection function: enable short circuit
detection and clock loss detection function by setting MMEN and CKLEN to 1.
6.
Set the threshold monitor filter and malfunction monitor: the filter parameters of the
threshold monitor, the malfunction signal allocation of the malfunction monitor and the
counter threshold are all configured by the HPDF_CHxCFG1 register.
30.3.5.
Parallel data input
HPDF module can select parallel data as the data input source of the channel. The CMSD[1:0]
bit field in HPDF_CHxCTL is configured to determine whether the channel data input source
is from serial data or parallel data. Each channel provides a 32-bit parallel data input register
(HPDF_CHxPDI), which can write two 16 bit parallel data by CPU/DMA. The register has two
16-bit data in signed format.
CPU / DMA write parallel data
There are two ways to write parallel data: CPU direct write and DMA write. When using DMA
to write parallel data, DMA should be configured as memory to memory mode, and its target
address is the address of HPDF_CHxPDI.
Note:
DMA writing parallel data is different from DMA reading final conversion data from
HPDF module. The latter needs to be configured in peripheral to memory mode.
Parallel data packed mode
The data stored in HPDF_CHxPDI register will be processed by channel filter. There are three
modes of parallel data stored in the HPDF_CHxPDI register.In different data packed modes,
the number of filter samples allowed to load depends on the value of DPM [1:0] bit field in the
HPDF_CHxCTL register. The different data encapsulation modes are as follows:
1.
Standard mode (DPM[1:0] = 2
’
b00):
In this mode, the upper 16 bits in the HPDF_CHxPDI register
are write protected, and
the 16-bit data written by CPU/DMA is stored in the low 16 bit DATAIN0[15:0] bit field.
CPU/DMA is configured as a 16-bit access mode. When writing 16-bit data once, the