code: def set_current_limit(self, channel, value, unit='A'):
          '''Setting current limit
  
          Note: same limit for all channels.
          '''
          dac_offset = self._ch_cal[channel]['DACI']['offset']
          dac_gain = self._ch_cal[channel]['DACI']['gain']
  
          if unit == 'raw':
              value = value
          elif unit == 'A':
              value = int((value - dac_offset) / dac_gain)
          elif unit == 'mA':
              value = int((value / 1000 - dac_offset) / dac_gain)
          else:
              raise TypeError("Invalid unit type.")
  
          DacMax5380._set_dac_value(self, channel, valuef set_current_limit(self, channel, value, unit='A'):
          '''Setting current limit
  
          Note: same limit for all channels.
          '''
          dac_offset = self._ch_cal[channel]['DACI']['offset']
          dac_gain = self._ch_cal[channel]['DACI']['gain']
  
          if unit == 'raw':
              value = value
          elif unit == 'A':
              value = int((value - dac_offset) / dac_gain)
          elif unit == 'mA':
              value = int((value / 1000 - dac_offset) / dac_gain)
          else:
              raise TypeError("Invalid unit type.")
  
          DacMax5380._set_dac_value(self, channel, value)
docs: Setting current limit
  
          Note: same limit for all channels.