Defines | Enumerations | Functions

extruder/heater.h File Reference

pin definitions and I/O macros More...

#include "config.h"
#include <stdint.h>
#include "temp.h"

Go to the source code of this file.

Defines

#define enable_heater()   heater_set(0, 64)
#define disable_heater()   heater_set(0, 0)
#define DEFINE_HEATER(name, port, pin, pwm)   HEATER_ ## name,

Enumerations

enum  heater_t

Functions

void heater_init (void)
 initialise heater subsystem Set directions, initialise PWM timers, read PID factors from eeprom, etc
void heater_save_settings (void)
 Write PID factors to eeprom.
void heater_set (heater_t index, uint8_t value)
 manually set PWM output
void heater_tick (heater_t h, temp_sensor_t t, uint16_t current_temp, uint16_t target_temp)
 run heater PID algorithm
uint8_t heaters_all_off (void)
 turn off all heaters
void pid_set_p (heater_t index, int32_t p)
 set heater P factor
void pid_set_i (heater_t index, int32_t i)
 set heater I factor
void pid_set_d (heater_t index, int32_t d)
 set heater D factor
void pid_set_i_limit (heater_t index, int32_t i_limit)
 set heater I limit
void heater_print (uint16_t i)
 send heater debug info to host

Detailed Description

pin definitions and I/O macros

why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html


Function Documentation

void heater_print ( uint16_t  i )

send heater debug info to host

Parameters:
iindex of heater to send info for

Referenced by process_gcode_command().

void heater_set ( heater_t  index,
uint8_t  value 
)

manually set PWM output

Parameters:
indexthe heater we're setting the output for
valuethe PWM value to write

anything done by this function is overwritten by heater_tick above if the heater has an associated temp sensor

Referenced by dda_start(), dda_step(), heater_tick(), and process_gcode_command().

void heater_tick ( heater_t  h,
temp_sensor_t  t,
uint16_t  current_temp,
uint16_t  target_temp 
)

run heater PID algorithm

Parameters:
hwhich heater we're running the loop for
twhich temp sensor this heater is attached to
current_tempthe temperature that the associated temp sensor is reporting
target_tempthe temperature we're trying to achieve

Referenced by temp_sensor_tick().

uint8_t heaters_all_off ( void   )

turn off all heaters

for emergency stop

Referenced by clock_250ms().

void pid_set_d ( heater_t  index,
int32_t  d 
)

set heater D factor

Parameters:
indexheater to change D factor for
dscaled D factor

Referenced by process_gcode_command().

void pid_set_i ( heater_t  index,
int32_t  i 
)

set heater I factor

Parameters:
indexheater to change I factor for
iscaled I factor

Referenced by process_gcode_command().

void pid_set_i_limit ( heater_t  index,
int32_t  i_limit 
)

set heater I limit

Parameters:
indexheater to set I limit for
i_limitscaled I limit

Referenced by process_gcode_command().

void pid_set_p ( heater_t  index,
int32_t  p 
)

set heater P factor

Parameters:
indexheater to change factor for
pscaled P factor

Referenced by process_gcode_command().

 All Data Structures Files Functions Variables Defines