aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/spi_temperature.py
Commit message (Collapse)AuthorAgeFilesLines
* 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>