Teacup_Firmware/config/config-syntax.txt

141 lines
4.7 KiB
Plaintext

Syntax rules for configuration files in order to be used with the graphical
configuration utility.
Variable Names - both board and printer files
---------------------------------------------
Every #define variable used in the configuration must appear in the file.
If the variable is being given a value, it must appear normally i.e.
#define NAME value
or
#define NAME
If a variable is NOT to be defined, then it must be included in a single line
comment:
//#define NAME
It is immaterial if the name as a comment has a value. This line just marks
place where the variable will be inserted if it is defined. Although there
may be arbitrary spaces before and after the "//", no other intervening
characters may be placed on this line.
The above is based on the variable NAME, not on value. For example, for
acceleration there are three different and mutually exclusive variable names:
//#define ACCELERATION_REPRAP
#define ACCELERATION_RAMPING
//#define ACCELERATION_TEMPORAL
All of these names MUST appear in the header file (with at most one of them
un-commented out).
Help Text - both board and printer files
----------------------------------------
The help text that is displayed on the GUI comes directly from the
configuration file itself. In order to be parsed correctly, help text must
be formatted as follows:
The start of a help text block is as follows:
/** \def NAME1 NAME2 NAME2 NAME4 ...
All subsequent lines are copied exactly as entered into the help text until
the end delimiter is reached. The end delimiter is a line that starts with '*/'.
The names are the actual #define variable names and are used to associate the
help text with a specific field. Note that it is possible to specify multiple
names on the start line. This allows identical help text for similar or related
fields.
Processor Preamble - Board file
-------------------------------
The various CPU_TYPE lines define the options that the user can select from
for CPU type. These must be legal values acceptable to avr-gcc for the -MMCU
parameter. The CPU line is the currently chosen value from these options.
Example:
//#define CPU_TYPE atmega1280
//#define CPU_TYPE atmega2560
#define CPU atmega2560
There can be multiple F_CPU_OPT lines specifying the various CPU clock values.
The final F_CPU line shows the currently chose value from the options.
Example:
//#define F_CPU_OPT 16000000UL
#define F_CPU 16000000UL
Temperature Sensor Considerations - Board file
----------------------------------------------
The board configuration file has a section that includes the definition of
temperature sensors. Because the number of temperature sensors may grow or
shrink, or might even be 0, the utility needs to know where to place these
definitions. For this reason, delimiters are used to mark the beginning
and end of this section:
//DEFINE_TEMP_SENSORS_START
DEFINE_TEMP_SENSOR(extruder, TT_THERMISTOR, AIO13, THERMISTOR_EXTRUDER)
DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO14, THERMISTOR_BED)
//DEFINE_TEMP_SENSORS_END
If the START/END delimiters are not found in the file, then the temperature
sensor definitions will not be generated and the original contents of the
file will be retained.
In addition to this, it is possible to limit the number of pins that are
available to the user to use for thermistors. To do this, enter as many
lines of the following form as are needed. Note that these lines are
commented out. If no such lines are defined, then ALL pin names will be
allowed.
//#define THERMISTOR_PIN AIO13
//#define THERMISTOR_PIN AIO14
//#define THERMISTOR_PIN AIO15
Heater Considerations - Board file
----------------------------------
The board configuration file has a section that includes the definition of
heaters. Because the number of heaters may grow or shrink, or might even be 0,
the utility needs to know where to place these definitions. For this reason,
delimiters are used to mark the beginning and end of this section:
//DEFINE_HEATERS_START
DEFINE_HEATER(extruder, DIO10, 1)
DEFINE_HEATER(bed, DIO8, 1)
#define HEATER_EXTRUDER HEATER_extruder
#define HEATER_BED HEATER_bed
//DEFINE_HEATERS_END
Note that these delimiters also enclose the defines for the heater names. This
is different than in the sensor case where these definitions are not necessary.
If the START/END delimiters are not found in the file, then the temperature
sensor definitions will not be generated and the original contents of the
file will be retained.
In addition to this, it is possible to limit the number of pins that are
available to the user to use for heaters. To do this, enter as many lines of
the following form as are needed. Note that these lines are commented out.
If no such lines are defined, then ALL pin names will be allowed.
//#define HEATER_PIN DIO10
//#define HEATER_PIN DIO8
//#define HEATER_PIN DIO5