code: def set_current_limit(self, channel, value, unit='A'):
          '''Setting current limit
  
          Note: same limit for all channels.
          '''
          # TODO: add units / calibration
          if unit == 'raw':
              value = value
          elif unit == 'A':
              value = int(value * 1000 * self.CURRENT_LIMIT_GAIN)
          elif unit == 'mA':
              value = int(value * self.CURRENT_LIMIT_GAIN)
          elif unit == 'uA':
              value = int(value / 1000 * self.CURRENT_LIMIT_GAIN)
          else:
              raise TypeError("Invalid unit type.")
  
          I2cAnalogChannel._set_dac_value(self, address=self.CURRENT_LIMIT_DAC_SLAVE_ADD, dac_ch=self.CURRENT_LIMIT_DAC_CH, value=valuef set_current_limit(self, channel, value, unit='A'):
          '''Setting current limit
  
          Note: same limit for all channels.
          '''
          # TODO: add units / calibration
          if unit == 'raw':
              value = value
          elif unit == 'A':
              value = int(value * 1000 * self.CURRENT_LIMIT_GAIN)
          elif unit == 'mA':
              value = int(value * self.CURRENT_LIMIT_GAIN)
          elif unit == 'uA':
              value = int(value / 1000 * self.CURRENT_LIMIT_GAIN)
          else:
              raise TypeError("Invalid unit type.")
  
          I2cAnalogChannel._set_dac_value(self, address=self.CURRENT_LIMIT_DAC_SLAVE_ADD, dac_ch=self.CURRENT_LIMIT_DAC_CH, value=value)
docs: Setting current limit
  
          Note: same limit for all channels.