/* Reflow Oven Controller
*
* Copyright (C) 2020  Mario Hüttel <mario.huettel@gmx.net>
*
* This file is part of the Reflow Oven Controller Project.
*
* The reflow oven controller is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* The Reflow Oven Control Firmware is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the reflow oven controller project.
* If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef __OVEN_DRIVER_H__
#define __OVEN_DRIVER_H__

#include <stdint.h>
#include <stdbool.h>
#include <reflow-controller/pid-controller.h>

struct oven_pid_status {
	bool active;
	bool aborted;
	float target_temp;
	float current_temp;
	uint64_t timestamp_last_run;
};

void oven_driver_init(void);

void oven_driver_set_power(uint8_t power);

void oven_driver_disable(void);

void oven_pid_init(struct pid_controller *controller_to_copy);

void oven_pid_handle(float target_temp, float current_temp);

void oven_pid_stop();

void oven_pid_report_error(void);

const struct oven_pid_status *oven_pid_get_status(void);

#endif /* __OVEN_DRIVER_H__ */
