Car/Peripheral/Inc/hcsr04.h

16 lines
388 B
C
Raw Permalink Normal View History

2024-07-11 18:14:13 +08:00
#ifndef __HCSR04_H
#define __HCSR04_H
#include "main.h"
2024-07-13 15:22:46 +08:00
extern uint32_t sonor_distance; // 测量出的距离单位mm
2024-07-15 20:10:12 +08:00
extern uint8_t sonor_state; // 测距状态变量0未测量1正在测量2已测量
2024-07-13 15:22:46 +08:00
void HC_SR04_Init(void);
uint32_t sonar_mm(void);
// 测距完毕回调执行完自定义任务后将sonor_state置0
2024-07-15 20:10:12 +08:00
void Sonar_CP_Callback(void);
2024-07-11 18:14:13 +08:00
#endif