HRCAP外设
1.HRCAP_isBaseValid(uint32_t base)
function description: Check if the given base address is valid.
parameter description:
- enter the parameters:
- base
: The base address ( uint32_t
type) to check.
- output parameters:
- return value**:
- true
(Equal to HRCAP6_BASE
or HRCAP7_BASE
if base address is valid)
- false
(if the base address is invalid)
2. HRCAP_enableHighResolution(uint32_t base)
function description: Enable high-resolution timing.
parameter description:
- enter the parameters:
- base
: Base address ( uint32_t
type).
- output parameters: No return value.
3. HRCAP_enableHighResolutionClock(uint32_t base)
function description: Enable high-resolution clock.
parameter description:
- enter the parameters:
- base
: Base address ( uint32_t
type).
- output parameters: No return value.
4. HRCAP_disableHighResolutionClock(uint32_t base)
function description: Disables the high-resolution clock.
parameter description:
- enter the parameters:
- base
: Base address ( uint32_t
type).
- output parameters: No return value.
5. HRCAP_startCalibration(uint32_t base)
function description: Start the calibration process.
parameter description:
- enter the parameters:
- base
: Base address ( uint32_t
type).
- output parameters: No return value.
6. HRCAP_setCalibrationMode(uint32_t base)
function description: Sets the calibration mode.
parameter description:
- enter the parameters:
- base
: Base address ( uint32_t
type).
- output parameters: No return value.
7. HRCAP_enableCalibrationInterrupt(uint32_t base, uint16_t intFlags)
function description: Enable calibration interrupt.
parameter description:
- enter the parameters:
- base
: Base address ( uint32_t
type).
- intFlags
: Interrupt flag ( uint16_t
type).
- output parameters: No return value.
8. HRCAP_disableCalibrationInterrupt(uint32_t base, uint16_t intFlags)
function description: Disables the calibration interrupt.
parameter description:
- enter the parameters:
- base
: Base address ( uint32_t
type).
- intFlags
: Interrupt flag ( uint16_t
type).
- output parameters: No return value.
9. HRCAP_getCalibrationFlags(uint32_t base)
function description: Get the current calibration flag.
parameter description:
- enter the parameters:
- base
: Base address ( uint32_t
type).
- output parameters:
- return value: Returns the calibration flag ( uint16_t
type).
10. HRCAP_clearCalibrationFlags(uint32_t base, uint16_t flags)
function description: Clears the specified calibration flag.
parameter description:
- enter the parameters:
- base
: Base address ( uint32_t
type).
- flags
: Flag ( uint16_t
type) to be cleared.
- output parameters: No return value.
11. HRCAP_isCalibrationBusy(uint32_t base)
function description: Check if the calibration is in progress.
parameter description:
- enter the parameters:
- base
: Base address ( uint32_t
type).
- output parameters:
- return value:
- true
(Calibration in progress)
- false
(Calibration not performed)
12. HRCAP_forceCalibrationFlags(uint32_t base, uint16_t flag)
function description: Force the calibration flag to be set.
parameter description:
- enter the parameters:
- base
: Base address ( uint32_t
type).
- flag
: Flag ( uint16_t
type) to set.
- output parameters: No return value.
13. HRCAP_setCalibrationPeriod(uint32_t base, uint32_t sysclkHz)
function description: Set the calibration cycle.
parameter description:
- enter the parameters:
- base
: Base address ( uint32_t
type).
- sysclkHz
: System clock frequency ( uint32_t
type).
- output parameters: No return value.
14. HRCAP_configCalibrationPeriod(uint32_t base, uint32_t sysclkHz, float periodInMs)
function description: Configure the calibration cycle.
parameter description:
- enter the parameters:
- base
: Base address ( uint32_t
type).
- sysclkHz
: System clock frequency ( uint32_t
type).
- periodInMs
: Period (ms, float
type).
- output parameters: No return value.
15. HRCAP_getCalibrationClockPeriod(uint32_t base, HRCAP_CalibrationClockSource clockSource)
function description: Get the calibration clock period.
parameter description:
- enter the parameters:
- base
: Base address ( uint32_t
type).
- clockSource
: Clock source ( HRCAP_CalibrationClockSource
type) during calibration.
- output parameters:
- return value: Returns the calibration clock period ( uint32_t
type).
16. HRCAP_getScaleFactor(uint32_t base)
function description: Calculates and returns the scaling factor.
parameter description:
- enter the parameters:
- base
: Base address ( uint32_t
type).
- output parameters:
- return value: Returns the scaling factor ( float32_t
type).
17. HRCAP_convertEventTimeStampNanoseconds(uint32_t timeStamp, float32_t scaleFactor)
function description: Convert the original timestamp value to nanoseconds.
parameter description:
- enter the parameters:
- timeStamp
: Original timestamp ( uint32_t
type).
- scaleFactor
: Scale factor ( float32_t
type).
- output parameters:
- return value: Returns the time (nanoseconds, float32_t
type) after conversion.