code: def _read_ch_config(fid):
      """Read BTi channel config."""
      cfg = {
          "name": read_str(fid, BTI.FILE_CONF_CH_NAME),
          "chan_no": read_int16(fid),
          "ch_type": read_uint16(fid),
          "sensor_no": read_int16(fid),
      }
  
      fid.seek(fid, BTI.FILE_CONF_CH_NEXT, 1)
  
      cfg.update(
          {
              "gain": read_float(fid),
              "units_per_bit": read_float(fid),
              "yaxis_label": read_str(fid, BTI.FILE_CONF_CH_YLABEL),
              "aar_val": read_double(fid),
              "checksum": read_int32(fid),
              "reserved": read_str(fid, BTI.FILE_CONF_CH_RESERVED),
          }
      )
  
      _correct_offset(fid)
  
      # Then the channel info
      ch_type, chan = cfg["ch_type"], dict()
      chan["dev"] = {
          "size": read_int32(fid),
          "checksum": read_int32(fid),
          "reserved": read_str(fid, 32),
      }
      if ch_type in [BTI.CHTYPE_MEG, BTI.CHTYPE_REF]:
          chan["loops"] = [
              _read_coil_def(fid)
              for d in range(chan["dev"]["total_loops"])
          ]
  
      elif ch_type == BTI.CHTYPE_EEG:
          chan["impedance"] = read_float(fid)
          chan["padding"] = read_str(fid, BTI.FILE_CONF_CH_PADDING)
          chan["transform"] = read_transform(fid)
          chan["reserved"] = read_char(fid, BTI.FILE_CONF_CH_RESERVED)
  
      elif ch_type in [
          BTI.CHTYPE_TRIGGER,
          BTI.CHTYPE_EXTERNAL,
          BTI.CHTYPE_UTILITY,
          BTI.CHTYPE_DERIVED,
      ]:
          chan["user_space_size"] = read_int32(fid)
          if ch_type == BTI.CHTYPE_TRIGGER:
              fid.seek(2, 1)
          chan["reserved"] = read_str(fid, BTI.FILE_CONF_CH_RESERVED)
  
      elif ch_type == BTI.CHTYPE_SHORTED:
          chan["reserved"] = read_str(fid, BTI.FILE_CONF_CH_RESERVED)
  
      cfg["chan"] = chan
  
      _correct_offset(fid)
  
      return cfg
  
imports: import functools
  import os.path
  from io import BytesIO
  from itertools import count
  import numpy
  from ..._fiff._digitization import _make_bti_dig_points
  from ..._fiff.constants import FIFF
  from ..._fiff.meas_info import _empty_info
  from ..._fiff.tag import _coil_trans_to_loc, _loc_to_coil_trans
  from ..._fiff.utils import _mult_cal_one, read_str
  from ...transforms import Transform, combine_transforms, invert_transform
  from ...utils import _stamp_to_dt, _validate_type, logger, path_like, verbose
  from ..base import BaseRaw
  from .constants import BTI
  from .read import read_char, read_dev_header, read_double, read_double_matrix, read_float, read_float_matrix, read_int16, read_int16_matrix, read_int32, read_int64, read_transform, read_uint16, read_uint32
label_desc: Use image node_id 17 for calling a global function with example usage: _read_ch_config(fid) and returns: cfg