+#elif defined(__SDCC_ADC_STYLE65J50)
+
+/*
+ * These devices use a bitmask in ANCON0/1 to configure
+ * AN7..0/AN15..8 as digital ports (bit set) or analog
+ * inputs (bit clear).
+ *
+ * These settings are selected based on their similarity with
+ * the 2220-style settings; 65j50-style is more flexible, though.
+ *
+ * Reference voltages are configured via adc_open's config parameter
+ * using ADC_VCFG_*.
+ */
+
+#define ADC_CFG_16A 0x0000
+#define ADC_CFG_15A 0x8000
+#define ADC_CFG_14A 0xC000
+#define ADC_CFG_13A 0xE000
+#define ADC_CFG_12A 0xF000
+#define ADC_CFG_11A 0xF800
+#define ADC_CFG_10A 0xFC00
+#define ADC_CFG_9A 0xFE00
+#define ADC_CFG_8A 0xFF00
+#define ADC_CFG_7A 0xFF80
+#define ADC_CFG_6A 0xFFC0
+#define ADC_CFG_5A 0xFFE0
+#define ADC_CFG_4A 0xFFF0
+#define ADC_CFG_3A 0xFFF8
+#define ADC_CFG_2A 0xFFFC
+#define ADC_CFG_1A 0xFFFE
+#define ADC_CFG_0A 0xFFFF
+