[riot-notifications] [RIOT-OS/RIOT] net/adcxx1c : Expose configurations to Kconfig (#15873)

Leandro Lanzieri notifications at github.com
Thu Jan 28 10:51:07 CET 2021


@leandrolanzieri commented on this pull request.



> +choice
+    bool "Automatic conversion mode (multiplier)"
+    default ADCXX1C_PARAM_CYCLE_DISABLE
+    help
+        The automatic conversion mode configures the ADC to continually perform
+        conversions without receiving "read" instructions from the controller
+        over the I2C interface. If enabled, the sample rate for the conversion
+        is set by the cycle time bits which offers upto 7 modes of operation,
+        i.e. multipliers from x32 to x2048 to the base conversion time
+        (Tconvert).
+
+config ADCXX1C_PARAM_CYCLE_DISABLE
+    bool "Disabled"
+
+config ADCXX1C_PARAM_CYCLE_32
+    bool "x32"
+
+config ADCXX1C_PARAM_CYCLE_64
+    bool "x64"
+
+config ADCXX1C_PARAM_CYCLE_128
+    bool "x128"
+
+config ADCXX1C_PARAM_CYCLE_256
+    bool "x256"
+
+config ADCXX1C_PARAM_CYCLE_512
+    bool "x512"
+
+config ADCXX1C_PARAM_CYCLE_1024
+    bool "x1024"
+
+config ADCXX1C_PARAM_CYCLE_2048
+    bool "x2048"
+
+endchoice
+
+config ADCXX1C_PARAM_LOW_LIMIT
+    int "Low limit for alert"
+    range 0 255 if USEMODULE_ADC081C
+    range 0 1024 if USEMODULE_ADC101C
+    range 0 4096 if USEMODULE_ADC121C
+    default 0
+    help
+        Configure the lower limit threshold used to determine the alert
+        condition.
+
+config ADCXX1C_PARAM_HIGH_LIMIT
+    int "High limit for alert"
+    range 0 255 if USEMODULE_ADC081C
+    range 0 1024 if USEMODULE_ADC101C
+    range 0 4096 if USEMODULE_ADC121C
+    default 0
+    help
+        Configure the higher limit threshold used to determine the alert
+        condition.
+
+config ADCXX1C_PARAM_HYSTERESIS
+    int "Hysteris for alert"
+    range 0 255 if USEMODULE_ADC081C
+    range 0 1024 if USEMODULE_ADC101C
+    range 0 4096 if USEMODULE_ADC121C
+    default 0
+    help
+        Configure the higher limit threshold used to determine the alert
+        condition. After a Vhigh or Vlow alert occurs,the conversion result must
+        move within the Vhigh or Vlow limit by more than this value to clear
+        the alert condition.

All these configurations are per-device instance, they are not of the driver itself. When a platform exposes a device configuration (or many) they would be overridden. I'm not sure we should aim at configuring this with Kconfig, looks more like a job for a device tree or similar approach to hardware description.

I know that currently the test application is configuring this via CFLAG as if it was a driver configuration, but that would hopefully change with another approach.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15873#pullrequestreview-578155237
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210128/c22fa285/attachment.htm>


More information about the notifications mailing list