+ def _check_target_deflection(self, deflection):
+ defc = self.piezo._deflection_channel()
+ max_def = defc.get_maxdata()
+ if deflection > max_def:
+ _LOG.error(('requested setpoint ({} bits) is larger than the '
+ 'maximum deflection value of {} bits'
+ ).format(deflection, max_def))
+ raise ValueError(deflection)
+ elif deflection < 0:
+ _LOG.error(('requested setpoint ({} bits) is less than the '
+ 'minimum deflection value of 0 bits'
+ ).format(deflection))
+ raise ValueError(deflection)