DAT290 / kod / Motion_alarm / HC_SR04 / hcsr04.h
hcsr04.h
Raw
#ifndef HCSR04_H_
#define HCSR04_H_

#include 	<stm32f4xx_gpio.h>
#include 	<stm32f4xx_rcc.h>
#include 	<stm32f4xx_tim.h>
#include	<TIM.h>
#include 	<misc.h>
#include	<USART_dump.h>


uint32_t DIFF;
float DISTANCE;
char DISTANCECHAR[10];
uint32_t T1;
uint32_t T2;
uint16_t calibration;


#define HCSR04_UNITS 1
// numbers of sensors to be used in the projekt 


/*----- Prototypes For All Functions -----*/

void Gpio_init(uint8_t Pin);
void ICTM_Init();
void NVIC_CFG_Init();
void delay(uint16_t ms);
void TIM_ResetCounter(TIM_TypeDef* TIMx);
void ftoa (float f, char* str);
void ICTM_Capture();
void HCSR04_Init();
void HCSR04_Read(void);

#endif