|
|
|
/**
|
|
|
|
* Heater PWM control & regulation + temp sensing loop
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef BLUEPILLTROUBA_APP_HEATER_H
|
|
|
|
#define BLUEPILLTROUBA_APP_HEATER_H
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include "cmsis_os2.h"
|
|
|
|
|
|
|
|
#define MAX_TEMP 400
|
|
|
|
|
|
|
|
extern osThreadId_t heaterTskHandle;
|
|
|
|
|
|
|
|
void app_task_heater(void *argument);
|
|
|
|
|
|
|
|
/// Set heater regulator tuning.
|
|
|
|
/// Mutex is locked internally.
|
|
|
|
void app_heater_set_tuning(float p, float i, float d);
|
|
|
|
|
|
|
|
/// Set heater on/off.
|
|
|
|
/// Mutex is locked internally.
|
|
|
|
void app_heater_enable(bool enable);
|
|
|
|
|
|
|
|
/// Set heater setpoint
|
|
|
|
/// Mutex is locked internally.
|
|
|
|
void app_heater_set_target(float target);
|
|
|
|
|
|
|
|
/// Shutdown the heater; This function does not use mutex and just disables the PWM via register access.
|
|
|
|
void app_heater_emergency_shutdown();
|
|
|
|
|
|
|
|
#endif //BLUEPILLTROUBA_APP_HEATER_H
|