spi_temperature: Remove spi_mode parameter

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>
This commit is contained in:
Kevin O'Connor 2018-07-24 15:45:51 -04:00
parent 70f765f62f
commit 5b124d59f2
3 changed files with 2 additions and 11 deletions

View File

@ -639,9 +639,6 @@
# heater parameters. The parameters below describe sensor parameters.
#sensor_type:
# One of "MAX6675", "MAX31855", "MAX31856", or "MAX31865".
#spi_mode:
# The SPI mode to use when communicating with the chip. This
# parameter must be provided.
#spi_speed:
# The SPI speed (in hz) to use when communicating with the chip.
# This parameter must be provided.

View File

@ -32,12 +32,10 @@ class SensorBase:
pin = pin_params['pin']
# SPI bus configuration
spi_oid = mcu.create_oid()
spi_mode = config.getint('spi_mode', minval=0, maxval=3)
spi_speed = config.getint('spi_speed', minval=0)
mcu.add_config_cmd(
"config_spi oid=%u bus=%u pin=%s"
" mode=%u rate=%u shutdown_msg=" % (
spi_oid, 0, pin, spi_mode, spi_speed))
"config_spi oid=%u bus=0 pin=%s mode=1 rate=%u shutdown_msg=" % (
spi_oid, pin, spi_speed))
if config_cmd is not None:
config_cmd = "".join("%02x" % b for b in config_cmd)
mcu.add_config_cmd("spi_send oid=%u data=%s" % (

View File

@ -59,7 +59,6 @@ min_temp: 0
max_temp: 100
control: watermark
sensor_type: MAX6675
spi_mode: 0
spi_speed: 100000
sensor_pin: ar2
@ -69,7 +68,6 @@ min_temp: 0
max_temp: 100
control: watermark
sensor_type: MAX31855
spi_mode: 0
spi_speed: 100000
sensor_pin: ar5
@ -79,7 +77,6 @@ min_temp: 0
max_temp: 100
control: watermark
sensor_type: MAX31856
spi_mode: 0
spi_speed: 100000
sensor_pin: ar7
@ -89,7 +86,6 @@ min_temp: 0
max_temp: 100
control: watermark
sensor_type: MAX31865
spi_mode: 0
spi_speed: 100000
sensor_pin: ar13