DCC双时钟比较
1.static inline bool DCC_isBaseValid(uint32_t base)
- this function determines whether the base address of the DCC module is valid
- parameter description: base: specifies the base address of the DCC module
- input parameter: base is DCC0 _ BASE
- return parameter: return true if the base address is valid; otherwise return false
2.static inline void DCC_enableModule(uint32_t base)
- function function: This function starts the DCC counter operation
- parameter description: base: base address of DCC module
- input parameter: base is DCC0 _ BASE
- return parameter: none
3.static inline void DCC_disableModule(uint32_t base)
- function function: This function stops the DCC counter operation
- parameter description: base: base address of DCC module
- input parameter: base is DCC0 _ BASE
- return parameter: none
4.static inline void DCC_enableErrorSignal(uint32_t base)
- function function: This function enables the interrupt of the error signal
- parameter description: base: base address of DCC module
- input parameter: base is DCC0 _ BASE
- return parameter: none
5.static inline void DCC_enableDoneSignal(uint32_t base)
- function function: This function enables the interrupt of the completion signal
- parameter description: base: base address of DCC module
- input parameter: base is DCC0 _ BASE
- return parameter: none
6.static inline void DCC_disableErrorSignal(uint32_t base)
- function function: This function disables the interrupt of the error signal
- parameter description: base: base address of DCC module
- input parameter: base is DCC0 _ BASE
- return parameter: none
7.static inline void DCC_disableDoneSignal(uint32_t base)
- function function: This function disables the interrupt of the completion signal
- parameter description: base: base address of DCC module
- input parameter: base is DCC0 _ BASE
- return parameter: none
8.static inline void DCC_enableSingleShotMode(uint32_t base, DCC_SingleShotMode mode)
- function function: This function enables the single mode and sets the operating mode
- parameter description: base: the base address of the DCC module; mode has two modes, one is to stop counting when counter0 and valid0 reach zero, and the other is to stop counting when counter1 reaches zero
- input parameter: base is DCC0 _ BASE; the mode can be DCC _ MODE _ COUNTER _ ZERO or DCC _ MODE _ COUNTER _ ONE.
- return parameter: none
9.static inline void DCC_disableSingleShotMode(uint32_t base)
- function function: This function disables the DCC single operation mode
- parameter description: base: base address of DCC module
- input parameter: base is DCC0 _ BASE
- return parameter: none
10.static inline bool DCC_getErrorStatus(uint32_t base)
- function function: This function gets the status of the error flag
- parameter description: base: base address of DCC module
- input parameter: base is DCC0 _ BASE
- return parameters: true if an error occurred, false if no error occurred
11.static inline bool DCC_getSingleShotStatus(uint32_t base)
- function function: This function obtains the status of the single completion flag.
- parameter description: base: base address of DCC module
- input parameter: base is DCC0 _ BASE
- return parameters: true if the single-shot mode is completed, false if the single-shot mode is not completed.
12.static inline void DCC_clearErrorFlag(uint32_t base)
- function function: This function clears the DCC error status flag.
- parameter description: base: base address of DCC module
- input parameter: base is DCC0 _ BASE
- return parameter: none
13.static inline void DCC_clearDoneFlag(uint32_t base)
- function function: This function clears the DCC single completion status flag.
- parameter description: base: base address of DCC module
- input parameter: base is DCC0 _ BASE
- return parameter: none
14.static inline uint32_t DCC_getCounter0Value(uint32_t base)
- function function: This function gets the current value of counter 0.
- parameter description: base: base address of DCC module
- input parameter: base is DCC0 _ BASE
- return parameter: return the current value of counter 0
15.static inline uint16_t DCC_getValidCounter0Value(uint32_t base)
- function function: This function gets the current value of the valid duration counter for counter 0
- parameter description: base: base address of DCC module
- input parameter: base is DCC0 _ BASE
- return parameter: return the current value of the valid duration counter
16.static inline uint32_t DCC_getCounter1Value(uint32_t base)
- function function: This function gets the current value of counter 1
- parameter description: base: base address of DCC module
- input parameter: base is DCC0 _ BASE
- return parameter: return the current value of counter 1
17.static inline void DCC_setCounter1ClkSource(uint32_t base, DCC_Count1ClockSource source)
- function function: This function sets the clock source of counter 1
- parameter description: base: base address of DCC module; source: clock source of selected counter 1
- input parameter: base is DCC0 _ BASE; the source can be selected as DCC _ COUNT1SRC _ PLL or DCC _ COUNT1SRC _ INTOSC1 or DCC _ Count1SRC _ INTOSC2
- return parameter: none
18.static inline void DCC_setCounter0ClkSource(uint32_t base, DCC_Count0ClockSource source)
- function function: This function sets the clock source of counter 0
- parameter description: base: base address of DCC module; source: clock source of selected counter 0
- input parameter: base is DCC0 _ BASE; the source can be selected as the DCC _ COUNT 0SRC _ XTAL or DCC _ COUNT0SRC _ INTOSC1 or DCC _ COUNT0SRS _ INTOSC2
- return parameter: none
19.static inline uint16_t DCC_getCounter1ClkSource(uint32_t base)
- function function: This function obtains which clock sources are available for counter 1
- parameter description: base: base address of DCC module
- input parameter: base is DCC0 _ BASE
- return parameter: return the clock source of counter 1 from all DCC _ Count1 ClockSource
20.static inline uint16_t DCC_getCounter0ClkSource(uint32_t base)
- function function: This function obtains which clock sources are available for counter 0
- parameter description: base: base address of DCC module
- input parameter: base is DCC0 _ BASE
- return parameter: return the clock source of counter 0 from all DCC _ Count0 ClockSource
21.static inline void DCC_setCounterSeeds(uint32_t base, uint32_t counter0, uint32_t validCounter0, uint32_t counter1)
- function function: This function sets the seed values for counter 0, valid duration counter 0, and counter 1
- parameter description: base: the base address of the DCC module; counter0: set the seed value loaded to counter 0; validCounter0: set the seed value of the valid duration counter loaded to counter 0; counter1: set the see value loaded to counter 1
- input parameter: base is DCC0 _ BASE;
counter0, validCounter0, counter1 are the results of the function evaluation
- return parameter: none
22.extern uint16_t DCC_getRevisionNumber(uint32_t base, DCC_RevisionNumber identifier)
- function: This program is used to obtain the revision number of the module, which is divided into the major revision number and the minor revision number
- parameter description: base is the address of DCC, and identifier is to select major revision or minor revision
- input parameter: base is DCC0 _ BASE; the identifier is an option in the DCC _ Revision Number.
- return parameter: return major revision number or minor revision number
23.extern bool DCC_verifyClockFrequency(uint32_t base, DCC_Count1ClockSource clock1, float32_t freq1,
DCC_Count0ClockSource clock0, float32_t freq0, float32_t tolerance, float32_t freqerr,float32_t freq_sysclk)
- this program uses the clocksource0 clock as a reference clock to verify the frequency of the clocksource1 clock. The dual clock comparator block is used for clock verification. The seed is the value that is loaded into the counter.
- parameter description: base: base address of DCC module; clock1: clock source to be verified; freq1: frequency of clock source to be verified; clock0: reference clock; freq0: frequency of reference clock; tolerance: DCC error tolerance (percentage); Freqerr: Allowed frequency tolerance (percentage); freq _ sysclk: Frequency of the system clock
- input parameter: base is DCC0 _ BASE; clock1 is clock source 1; freq1 is clock 1 frequency; clock0 is clock source 0; freq0 is clock 0 frequency; tolerance error tolerance; freqerr allowable frequency error; freq _ sysclk: frequency of system clock
- return parameter: bool to verify whether the two clocks can be accepted.
24.extern float32_t DCC_measureClockFrequency(uint32_t base, DCC_Count1ClockSource clock1,
DCC_Count0ClockSource clock0, float32_t freq0, float32_t tolerance, float32_t freqerr,float32_t freq_sysclk)
- function function: This program demonstrates a single measurement after the clock of clocksource1 is fine-tuned using clocksource0 as the reference clock. The dual clock comparator block is used for clock measurement.
- parameter description: base: base address of DCC module; clock1: clock source to be verified; clock0: reference clock; freq0: frequency of reference clock; tolerance: DCC error tolerance (percentage); freqerr: allowable frequency tolerance (percentage); Freq _ sysclk: The frequency of the system clock
- input parameter: base is DCC0 _ BASE; clock1 is clock source 1; clock0 is clock source 0; freq0 is the frequency of clock 0; tolerance error tolerance; freqerr allowable frequency error; freq _ sysclk: frequency of system clock
- return parameter: frequency of the measured clock
25.extern void DCC_continuousMonitor(uint32_t base, DCC_Count1ClockSource clock1, float32_t freq1,
DCC_Count0ClockSource clock0, float32_t freq0, float32_t tolerance, float32_t freqerr,float32_t freq_sysclk)
- function: This program demonstrates the continuous monitoring of clocksource1 clock in the system using clocksource0 as the reference clock. Any error triggers an interrupt, causing the counter decrement/reload to stop.
- parameter description: base: base address of DCC module; clock1: clock source to be verified; freq1: frequency of clock source to be verified; clock0: reference clock; freq0: frequency of reference clock; tolerance: DCC error tolerance (percentage); Freqerr: Allowed frequency tolerance (percentage); freq _ sysclk: Frequency of the system clock
- input parameter: base is DCC0 _ BASE; clock1 is clock source 1; freq1 is clock 1 frequency; clock0 is clock source 0; freq0 is clock 0 frequency; tolerance error tolerance; freqerr allowable frequency error; freq _ sysclk: frequency of system clock
- return parameter: none