spi_temperature: Provide a default value for spi_speed
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>
This commit is contained in:
parent
5b124d59f2
commit
63dffd9307
|
@ -639,9 +639,9 @@
|
||||||
# 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_speed:
|
#spi_speed: 4000000
|
||||||
# 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.
|
# The default is 4000000.
|
||||||
#sensor_pin:
|
#sensor_pin:
|
||||||
# The chip select line for the sensor chip. This parameter must be
|
# The chip select line for the sensor chip. This parameter must be
|
||||||
# provided.
|
# provided.
|
||||||
|
|
|
@ -32,7 +32,7 @@ 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_speed = config.getint('spi_speed', minval=0)
|
spi_speed = config.getint('spi_speed', 4000000, minval=1)
|
||||||
mcu.add_config_cmd(
|
mcu.add_config_cmd(
|
||||||
"config_spi oid=%u bus=0 pin=%s mode=1 rate=%u shutdown_msg=" % (
|
"config_spi oid=%u bus=0 pin=%s mode=1 rate=%u shutdown_msg=" % (
|
||||||
spi_oid, pin, spi_speed))
|
spi_oid, pin, spi_speed))
|
||||||
|
|
|
@ -59,7 +59,6 @@ min_temp: 0
|
||||||
max_temp: 100
|
max_temp: 100
|
||||||
control: watermark
|
control: watermark
|
||||||
sensor_type: MAX6675
|
sensor_type: MAX6675
|
||||||
spi_speed: 100000
|
|
||||||
sensor_pin: ar2
|
sensor_pin: ar2
|
||||||
|
|
||||||
[temperature_fan test_max31855]
|
[temperature_fan test_max31855]
|
||||||
|
@ -68,7 +67,6 @@ min_temp: 0
|
||||||
max_temp: 100
|
max_temp: 100
|
||||||
control: watermark
|
control: watermark
|
||||||
sensor_type: MAX31855
|
sensor_type: MAX31855
|
||||||
spi_speed: 100000
|
|
||||||
sensor_pin: ar5
|
sensor_pin: ar5
|
||||||
|
|
||||||
[temperature_fan test_max31856]
|
[temperature_fan test_max31856]
|
||||||
|
@ -77,7 +75,6 @@ min_temp: 0
|
||||||
max_temp: 100
|
max_temp: 100
|
||||||
control: watermark
|
control: watermark
|
||||||
sensor_type: MAX31856
|
sensor_type: MAX31856
|
||||||
spi_speed: 100000
|
|
||||||
sensor_pin: ar7
|
sensor_pin: ar7
|
||||||
|
|
||||||
[temperature_fan test_max31865]
|
[temperature_fan test_max31865]
|
||||||
|
@ -86,7 +83,6 @@ min_temp: 0
|
||||||
max_temp: 100
|
max_temp: 100
|
||||||
control: watermark
|
control: watermark
|
||||||
sensor_type: MAX31865
|
sensor_type: MAX31865
|
||||||
spi_speed: 100000
|
|
||||||
sensor_pin: ar13
|
sensor_pin: ar13
|
||||||
|
|
||||||
[thermistor my_custom_thermistor]
|
[thermistor my_custom_thermistor]
|
||||||
|
|
Loading…
Reference in New Issue