ODROID-C5: change adc max value and adc file path

ODROID-C5 has two internal 10bit ADCs. However, the value of in_voltage0_raw outputs a difficult number.

So, klipper read "in_voltage0_input", which outputs the actual voltage value, to read the value of ADC.

Change-Id: I32aada4e66e6034823bf66c41fccf178d6ff50d0
This commit is contained in:
2025-05-28 15:23:57 +09:00
parent 5797bd9cb3
commit 88ad6d1934

View File

@@ -13,13 +13,15 @@
#include "internal.h" // report_errno
#include "sched.h" // sched_shutdown
DECL_CONSTANT("ADC_MAX", 4095); // Assume 12bit adc
// ODROID-C5
DECL_CONSTANT("ADC_MAX", 1800); // Assume 12bit adc
#define ANALOG_START (1<<12)
DECL_ENUMERATION_RANGE("pin", "analog0", ANALOG_START, 8);
#define IIO_PATH "/sys/bus/iio/devices/iio:device0/in_voltage%d_raw"
// ODROID-C5
#define IIO_PATH "/sys/bus/iio/devices/iio:device0/in_voltage%d_input"
struct gpio_adc
gpio_adc_setup(uint32_t pin)