aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/spi_temperature.py
Commit message (Collapse)AuthorAgeFilesLines
* klippy: Rename try_load_module() to load_object()Kevin O'Connor2020-05-081-1/+1
| | | | | | | | Rename try_load_module() so that it uses consistent naming for "printer objects". Change the function to raise an error by default if the specified module does not exist. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* heaters: Make heater.py an "extras" moduleKevin O'Connor2020-04-251-2/+2
| | | | | | | The heater logic is an independent module that does not need to be treated as part of the "core" klipper code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialhdl: Rename register_callback() to register_response()Kevin O'Connor2019-06-211-1/+2
| | | | | | Rename the method and use that name in the mcu class as well. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spi_temperature: MAX6675 and MAX31855 should use spi mode 0Kevin O'Connor2019-05-221-4/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* thermocouple: Define thermocouple types using enumerationsKevin O'Connor2019-03-171-11/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spi_temperature: Wrap code to 80 columnsKevin O'Connor2019-02-271-7/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* heater: Rename add_sensor() to add_sensor_factory()Kevin O'Connor2019-02-251-1/+1
| | | | | Signed-off-by: Douglas Hammond <wizhippo@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spi_temperature: Fix order of initKevin O'Connor2019-02-041-3/+4
| | | | | | | | Commit c3efcd9c moved the config_spi setup to a build_config callback. It's also necessary to move the config_thermocouple to a build_config callback as well. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spi_temperature: Use bus.py helper code for spiKevin O'Connor2018-11-211-16/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Rename add_config_object() to register_config_callback()Kevin O'Connor2018-09-031-2/+2
| | | | | | | | | Change the name of the config registration method and pass an explicit reference to the callback to the new method. This makes the relationship between mcu registration and build_config() more clear in the calling code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Explicitly pass can_invert and can_pullup to lookup_pin()Kevin O'Connor2018-07-261-2/+1
| | | | | | | | | | | | Don't pass pin_type to lookup_pin() - instead, if a pin can be inverted or can have a pullup, then the caller must explicitly specify that when calling lookup_pin(). This simplifies the code for the cases where it is not valid to invert or pullup. Explicitly pass the pin_type to setup_pin() and have ppins.setup_pin() apply default pullup and invert flags. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spi_temperature: The query_thermocouple command is an init commandKevin O'Connor2018-07-241-1/+1
| | | | | | | Make sure to use is_init=True when sending query_thermocouple - otherwise, the config CRC is likely to mismatch on every connection. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spi_temperature: Provide a default value for spi_speedKevin O'Connor2018-07-241-1/+1
| | | | | | | All of the Maxim chips support a 4Mhz spi transfer rate, so use that as a default spi speed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spi_temperature: Remove spi_mode parameterKevin O'Connor2018-07-241-4/+2
| | | | | | All of the Maxim chips can use SPI mode 1, so no need to configure it. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spi_temperature: Don't raise error on a fault - invoke a shutdownKevin O'Connor2018-07-241-24/+23
| | | | | | | | Raising an error from the background message reception thread isn't well defined. Instead, on a temperature fault, invoke a printer shutdown. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spi_temperature: Eliminate get_configs() callbackKevin O'Connor2018-07-241-39/+33
| | | | | | | | | Those chips that require an spi init sequence can generate the message directly in the chip specific class. Also, don't send an spi init message for chips that are read-only. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spi_temperature: Eliminate self.chip_type variableKevin O'Connor2018-07-241-17/+12
| | | | | | The chip type is now always unique in each class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spi_temperature: Eliminate check_faults() callbackKevin O'Connor2018-07-241-15/+6
| | | | | | The faults can be checked from the calc_temp() method. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spi_temperature: Break up thermocouple code into individual classesKevin O'Connor2018-07-241-74/+115
| | | | | | | Break the Thermocouple() class into MAX31856(), MAX31855(), and MAX6675() classes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spi_temperature: Use setup_minmax() to set the temperature rangeKevin O'Connor2018-07-241-8/+5
| | | | | | | Use setup_minmax() instead of directly reading the min/max temperature from the config. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spi_temperature: Remove non-spi flags from SensorBaseKevin O'Connor2018-07-241-50/+30
| | | | | | | The SensorBase class is used exclusively for SPI transfers, so no need to track non-spi settings. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* thermocouple: Add support for MAX6675 chipRicardo Amezquita2018-07-241-6/+15
| | | | | | | The MAX6675 chip has a different read sequence than the MAX31855 chip. Signed-off-by: Ricardo Amézquita <ramezquitao@cihologramas.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* thermocouple: Add initial support for common SPI temperature sensing chipsKevin O'Connor2018-07-241-0/+350
Signed-off-by: Petri Honkala <cruwaller@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>