~tristan957/tllt-cp

ref: b641e5e72ab5748349f2a38fcac55ee01b2e34b3 tllt-cp/driver/tllt-toaster.h -rw-r--r-- 910 bytes
b641e5e7 — Tristan Partin Implement manual control of heating elements 1 year, 6 months ago
                                                                                
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
#pragma once

#include <glib-object.h>

#include "components/tllt-heating-element.h"
#include "sensors/tllt-thermistor.h"

G_BEGIN_DECLS

struct _TlltToaster
{
	GObject parent_instance;

	TlltHeatingElement *top_heating_element;
	TlltHeatingElement *bottom_heating_element;
	TlltThermistor *thermistor;
};

#define TLLT_TYPE_TOASTER (tllt_toaster_get_type())
G_DECLARE_FINAL_TYPE(TlltToaster, tllt_toaster, TLLT, TOASTER, GObject)

typedef void (*TlltToasterUpdateFunc)(unsigned int time, double progress, gpointer user_data);

TlltToaster *tllt_toaster_new_from_config_file(const char *file_path, GError **err);
void tllt_toaster_start(TlltToaster *self, const unsigned int time, const int temperature,
						gboolean top, gboolean bot, const TlltToasterUpdateFunc update,
						gpointer user_data);
void tllt_toaster_stop(TlltToaster *self);
gboolean tllt_toaster_is_running(TlltToaster *self);

G_END_DECLS