mikrokontrollersystemer-pro.../prosjekt.X/fan_speeeed.h
2024-04-27 18:45:04 +02:00

53 lines
965 B
C

/*
* File: fanseeeed.h
* Author: inami, Helle Augland Grasmo
*
* Created on 13. mars 2024, 13:38
*/
#ifndef FANSEEEED_H
#define FANSEEEED_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <float.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#include <avr/interrupt.h>
#include <avr/io.h>
// INITALICE TIMER COUNTER
void init_TCA0();
// UPDATE TIMER PERIOD
void TCA0_update_period_ms ();
// TAKES INN A TIME AND A THE COUNTED FAN DIPS
// RETURNS THE RPM OF THE FAN
uint16_t RPM_calculation(uint16_t edge_counter, uint16_t time_ms);
// INITIALISING FAN PORTS
void init_fan_gpio();
// INIT AC0 TO COMPARE PD6 AND PD7
void init_AC0();
// INIT AC1 TO COMPARE PD4 AND PD7
void init_AC1();
#ifdef __cplusplus
}
#endif
#endif /* FANSEEEED_H */