coffee/barista/heater.h
2025-11-02 19:24:02 +01:00

31 lines
553 B
C

/* Copyright (c) 2025 Rodrigo Arias Mallo <rodarima@gmail.com>
* SPDX-License-Identifier: GPL-3.0-or-later */
#ifndef BARISTA_HEATER_H
#define BARISTA_HEATER_H
#ifdef __cplusplus
extern "C" {
#endif
enum heater_state {
HEATER_OFF = 0,
HEATER_ON,
};
struct heater {
enum heater_state st;
int turn_on;
unsigned long next_t; /* in ms */
};
void heater_on(struct heater *h, unsigned long t_ms);
void heater_off(struct heater *h);
int heater_state(struct heater *h, unsigned long t_ms);
#ifdef __cplusplus
}
#endif
#endif /* BARISTA_HEATER_H */