sentry_gimbal_hzz/bsp/dwt/bsp_dwt.h

89 lines
2.1 KiB
C
Raw Normal View History

2022-10-20 17:13:02 +08:00
/**
******************************************************************************
* @file bsp_dwt.h
* @author Wang Hongxi
* @version V1.1.0
* @date 2022/3/8
* @brief
******************************************************************************
* @attention
*
******************************************************************************
*/
#ifndef _BSP_DWT_H
#define _BSP_DWT_H
#include "main.h"
#include "stdint.h"
typedef struct
{
uint32_t s;
uint16_t ms;
uint16_t us;
} DWT_Time_t;
/**
* @brief DWT,CPU频率,MHz
*
* @param CPU_Freq_mHz c板为168MHz,A板为180MHz
*/
2022-10-20 17:13:02 +08:00
void DWT_Init(uint32_t CPU_Freq_mHz);
/**
* @brief ,/s
*
* @param cnt_last
* @return float ,/s
*/
2022-10-20 17:13:02 +08:00
float DWT_GetDeltaT(uint32_t *cnt_last);
/**
* @brief ,/s,
*
* @param cnt_last
* @return double ,/s
*/
2022-10-20 17:13:02 +08:00
double DWT_GetDeltaT64(uint32_t *cnt_last);
/**
* @brief ,/s,
*
* @return float
*/
2022-10-20 17:13:02 +08:00
float DWT_GetTimeline_s(void);
/**
* @brief ,/ms,
*
* @return float
*/
2022-10-20 17:13:02 +08:00
float DWT_GetTimeline_ms(void);
/**
* @brief ,/us,
*
* @return uint64_t
*/
2022-10-20 17:13:02 +08:00
uint64_t DWT_GetTimeline_us(void);
/**
* @brief DWT延时函数,/s
* @attention ,使
* @note __disable_irq()__enable_irq()使HAL_Delay(),使
*
* @param Delay ,/s
*/
2022-10-20 17:13:02 +08:00
void DWT_Delay(float Delay);
/**
* @brief DWT更新时间轴函数,timeline函数调用
* @attention timeline函数,,CYCCNT溢出后定时和时间轴不准确
*/
2022-10-20 17:13:02 +08:00
void DWT_SysTimeUpdate(void);
#endif /* BSP_DWT_H_ */