pub fn rtc_calib_cal_code(unit: u8, atten: Attenuation) -> Option<u16> {
        let version = Self::rtc_calib_version();

        if version != 1 {
            return None;
        }

        let adc_vol_diff: [u16; 8] = [
            Self::read_field_le(ADC1_CAL_VOL_ATTEN0),
            Self::read_field_le(ADC1_CAL_VOL_ATTEN1),
            Self::read_field_le(ADC1_CAL_VOL_ATTEN2),
            Self::read_field_le(ADC1_CAL_VOL_ATTEN3),
            Self::read_field_le(ADC2_CAL_VOL_ATTEN0),
            Self::read_field_le(ADC2_CAL_VOL_ATTEN1),
            Self::read_field_le(ADC2_CAL_VOL_ATTEN2),
            Self::read_field_le(ADC2_CAL_VOL_ATTEN3),
        ];

        let mut adc1_vol = [0; 4];
        let mut adc2_vol = [0; 4];
        adc1_vol[3] = adc_vol_diff[3] + 900;
        adc1_vol[2] = adc_vol_diff[2] + adc1_vol[3] + 800;
        adc1_vol[1] = adc_vol_diff[1] + adc1_vol[2] + 700;
        adc1_vol[0] = adc_vol_diff[0] + adc1_vol[1] + 800;
        adc2_vol[3] = adc1_vol[3] - adc_vol_diff[7] + 15;
        adc2_vol[2] = adc1_vol[2] - adc_vol_diff[6] + 20;
        adc2_vol[1] = adc1_vol[1] - adc_vol_diff[5] + 10;
        adc2_vol[0] = adc1_vol[0] - adc_vol_diff[4] + 40;

        let atten = match atten {
            Attenuation::_0dB => 0,
            Attenuation::_2p5dB => 1,
            Attenuation::_6dB => 2,
            Attenuation::_11dB => 3,
        };

        Some(if unit == 0 {
            adc1_vol[atten]
        } else {
            adc2_vol[atten]
        })
    }
Get ADC reference point digital code for specified attenuation

see <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32s3/esp_efuse_rtc_calib.c#L63>
esp-hal/src/soc/esp32s3/efuse/mod.rs