mikrokontrollersystemer-pro.../prosjekt.X/fan_speeeed.h

53 lines
965 B
C
Raw Normal View History

2024-03-13 12:39:35 +00:00
/*
* File: fanseeeed.h
2024-04-27 16:45:04 +00:00
* Author: inami, Helle Augland Grasmo
2024-03-13 12:39:35 +00:00
*
* Created on 13. mars 2024, 13:38
*/
2024-03-19 11:59:56 +00:00
2024-03-13 12:39:35 +00:00
#ifndef FANSEEEED_H
#define FANSEEEED_H
#ifdef __cplusplus
extern "C" {
#endif
2024-03-20 11:33:03 +00:00
#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>
2024-04-27 16:45:04 +00:00
2024-04-09 12:53:32 +00:00
2024-04-27 15:31:00 +00:00
// INITALICE TIMER COUNTER
2024-04-24 12:24:40 +00:00
void init_TCA0();
2024-04-27 15:31:00 +00:00
2024-04-27 16:45:04 +00:00
// UPDATE TIMER PERIOD
2024-04-09 12:53:32 +00:00
void TCA0_update_period_ms ();
2024-04-27 15:31:00 +00:00
// TAKES INN A TIME AND A THE COUNTED FAN DIPS
// RETURNS THE RPM OF THE FAN
2024-04-27 16:45:04 +00:00
uint16_t RPM_calculation(uint16_t edge_counter, uint16_t time_ms);
2024-04-27 15:31:00 +00:00
// INITIALISING FAN PORTS
2024-04-27 16:45:04 +00:00
void init_fan_gpio();
2024-04-27 15:31:00 +00:00
// INIT AC0 TO COMPARE PD6 AND PD7
2024-04-27 16:45:04 +00:00
void init_AC0();
2024-04-27 15:31:00 +00:00
// INIT AC1 TO COMPARE PD4 AND PD7
2024-04-27 16:45:04 +00:00
void init_AC1();
2024-04-24 12:24:40 +00:00
2024-03-13 12:39:35 +00:00
#ifdef __cplusplus
}
#endif
#endif /* FANSEEEED_H */