fan: Add tachometer support

This adds new config options for fans:  'tachometer_pin' to specify the
GPIO pin, and 'tachometer_ppr' (default 2) to specify the number of
signal pulses per revolution.  The rpm is also exposed by get_status for
command templates and the API server.  For fast fans (at least 10000
RPM), the polling interval can be shortened using the
'tachometer_poll_interval' option.

There is a new mcu object for a generic edge counter, which repeatedly
polls a GPIO pin and periodically reports the count to the host.

Signed-off-by: Adrian Keet <arkeet@gmail.com>
This commit is contained in:
Adrian Keet
2021-02-06 15:11:29 -08:00
committed by KevinOConnor
parent f8b0ea53dc
commit 16d85d1a78
5 changed files with 238 additions and 2 deletions

View File

@@ -7,4 +7,4 @@ src-$(CONFIG_HAVE_GPIO_SPI) += spicmds.c thermocouple.c
src-$(CONFIG_HAVE_GPIO_I2C) += i2ccmds.c
src-$(CONFIG_HAVE_GPIO_HARD_PWM) += pwmcmds.c
src-$(CONFIG_HAVE_GPIO_BITBANGING) += lcd_st7920.c lcd_hd44780.c buttons.c \
tmcuart.c spi_software.c neopixel.c sensor_adxl345.c
tmcuart.c spi_software.c neopixel.c sensor_adxl345.c pulse_counter.c