Manage temperature sensors. More...
#include "temp.h"
#include <stdlib.h>
#include <avr/eeprom.h>
#include <avr/pgmspace.h>
#include "arduino.h"
#include "delay.h"
#include "debug.h"
#include "sersendf.h"
#include "heater.h"
#include "config.h"
#include "analog.h"
#include "ThermistorTable.h"
Data Structures | |
struct | temp_sensor_definition_t |
holds metadata for each temperature sensor More... | |
Defines | |
#define | DEFINE_TEMP_SENSOR(name, type, pin) { (type), (pin), (HEATER_ ## name) }, |
help build list of sensors from entries in config.h | |
Enumerations | |
enum | temp_flags_enum { PRESENT, TCOPEN, PRESENT, TCOPEN } |
Functions | |
void | temp_init () |
set up temp sensors. Currently only the 'intercom' sensor needs initialisation. | |
void | temp_sensor_tick () |
called every 10ms from clock.c - check all temp sensors that are ready for checking | |
uint8_t | temp_achieved () |
report whether all temp sensors are reading their target temperatures used for M109 and friends | |
void | temp_set (temp_sensor_t index, uint16_t temperature) |
specify a target temperature | |
uint16_t | temp_get (temp_sensor_t index) |
return most recent reading for a sensor | |
void | temp_print (temp_sensor_t index) |
send temperatures to host | |
Variables | |
struct { | |
temp_flags_enum temp_flags | |
flags | |
uint16_t last_read_temp | |
last received reading | |
uint16_t target_temp | |
manipulate attached heater to attempt to achieve this value | |
uint8_t temp_residency | |
how long have we been close to target temperature? | |
uint16_t next_read_time | |
how long until we can read this sensor again? | |
} | temp_sensors_runtime [NUM_TEMP_SENSORS] |
Manage temperature sensors.
uint16_t temp_get | ( | temp_sensor_t | index ) |
return most recent reading for a sensor
index | sensor to read |
void temp_print | ( | temp_sensor_t | index ) |
send temperatures to host
index | sensor value to send |
Referenced by process_gcode_command().
void temp_set | ( | temp_sensor_t | index, |
uint16_t | temperature | ||
) |
specify a target temperature
index | sensor to set a target for |
temperature | target temperature to aim for |
Referenced by process_gcode_command().