forked from Traumflug/Teacup_Firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
heater.h
36 lines (27 loc) · 825 Bytes
/
heater.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef _HEATER_H
#define _HEATER_H
#include "config.h"
#include <stdint.h>
#include "temp.h"
#define enable_heater() heater_set(0, 64)
#define disable_heater() heater_set(0, 0)
#undef DEFINE_HEATER
#define DEFINE_HEATER(name, pin) HEATER_ ## name,
typedef enum
{
#include "config.h"
NUM_HEATERS,
HEATER_noheater
} heater_t;
#undef DEFINE_HEATER
void heater_init(void);
void heater_save_settings(void);
void heater_set(heater_t index, uint8_t value);
void heater_tick(heater_t h, temp_sensor_t t, uint16_t current_temp, uint16_t target_temp);
uint8_t heaters_all_off(void);
void pid_set_p(heater_t index, int32_t p);
void pid_set_i(heater_t index, int32_t i);
void pid_set_d(heater_t index, int32_t d);
void pid_set_i_limit(heater_t index, int32_t i_limit);
void heater_print(uint16_t i);
#endif /* _HEATER_H */