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:
parent
70f765f62f
commit
5b124d59f2
|
@ -639,9 +639,6 @@
|
||||||
# heater parameters. The parameters below describe sensor parameters.
|
# heater parameters. The parameters below describe sensor parameters.
|
||||||
#sensor_type:
|
#sensor_type:
|
||||||
# One of "MAX6675", "MAX31855", "MAX31856", or "MAX31865".
|
# 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:
|
#spi_speed:
|
||||||
# The SPI speed (in hz) to use when communicating with the chip.
|
# The SPI speed (in hz) to use when communicating with the chip.
|
||||||
# This parameter must be provided.
|
# This parameter must be provided.
|
||||||
|
|
|
@ -32,12 +32,10 @@ class SensorBase:
|
||||||
pin = pin_params['pin']
|
pin = pin_params['pin']
|
||||||
# SPI bus configuration
|
# SPI bus configuration
|
||||||
spi_oid = mcu.create_oid()
|
spi_oid = mcu.create_oid()
|
||||||
spi_mode = config.getint('spi_mode', minval=0, maxval=3)
|
|
||||||
spi_speed = config.getint('spi_speed', minval=0)
|
spi_speed = config.getint('spi_speed', minval=0)
|
||||||
mcu.add_config_cmd(
|
mcu.add_config_cmd(
|
||||||
"config_spi oid=%u bus=%u pin=%s"
|
"config_spi oid=%u bus=0 pin=%s mode=1 rate=%u shutdown_msg=" % (
|
||||||
" mode=%u rate=%u shutdown_msg=" % (
|
spi_oid, pin, spi_speed))
|
||||||
spi_oid, 0, pin, spi_mode, spi_speed))
|
|
||||||
if config_cmd is not None:
|
if config_cmd is not None:
|
||||||
config_cmd = "".join("%02x" % b for b in config_cmd)
|
config_cmd = "".join("%02x" % b for b in config_cmd)
|
||||||
mcu.add_config_cmd("spi_send oid=%u data=%s" % (
|
mcu.add_config_cmd("spi_send oid=%u data=%s" % (
|
||||||
|
|
|
@ -59,7 +59,6 @@ min_temp: 0
|
||||||
max_temp: 100
|
max_temp: 100
|
||||||
control: watermark
|
control: watermark
|
||||||
sensor_type: MAX6675
|
sensor_type: MAX6675
|
||||||
spi_mode: 0
|
|
||||||
spi_speed: 100000
|
spi_speed: 100000
|
||||||
sensor_pin: ar2
|
sensor_pin: ar2
|
||||||
|
|
||||||
|
@ -69,7 +68,6 @@ min_temp: 0
|
||||||
max_temp: 100
|
max_temp: 100
|
||||||
control: watermark
|
control: watermark
|
||||||
sensor_type: MAX31855
|
sensor_type: MAX31855
|
||||||
spi_mode: 0
|
|
||||||
spi_speed: 100000
|
spi_speed: 100000
|
||||||
sensor_pin: ar5
|
sensor_pin: ar5
|
||||||
|
|
||||||
|
@ -79,7 +77,6 @@ min_temp: 0
|
||||||
max_temp: 100
|
max_temp: 100
|
||||||
control: watermark
|
control: watermark
|
||||||
sensor_type: MAX31856
|
sensor_type: MAX31856
|
||||||
spi_mode: 0
|
|
||||||
spi_speed: 100000
|
spi_speed: 100000
|
||||||
sensor_pin: ar7
|
sensor_pin: ar7
|
||||||
|
|
||||||
|
@ -89,7 +86,6 @@ min_temp: 0
|
||||||
max_temp: 100
|
max_temp: 100
|
||||||
control: watermark
|
control: watermark
|
||||||
sensor_type: MAX31865
|
sensor_type: MAX31865
|
||||||
spi_mode: 0
|
|
||||||
spi_speed: 100000
|
spi_speed: 100000
|
||||||
sensor_pin: ar13
|
sensor_pin: ar13
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue