# Path: pymoku/_instrument.py
# def from_reg_signed(_offset, _len, xform=lambda obj, x: x):
#     """ Returns a callable that will unpack a signed data value from a r
#     egister bitfield. Designed as shorthand for common use in instrument
#     register accessor lists. Supports single and compound registers
#     (i.e. data values that span more than one register).
# 
#     :param _offset: Offset of data field in the register (set)
#     :param _len: Length of data field in the register (set)
#     :param xform: a callable that translates the register value to the
#     user attribute's natural units
#     """
#     # TODO: As above, this and the unsigned version share all but one
#     # line of code, should consolidate.
#     mask = ((1 << _len) - 1) << _offset
# 
#     def __sg(obj, reg):
#         try:
#             return xform(obj, _upsgn((reg & mask) >> _offset, _len))
#         except TypeError:
#             v = 0
#             for r in reg:
#                 v <<= 32
#                 v |= r
# 
#             return xform(obj, _upsgn((v & mask) >> _offset, _len))
# 
#     return __sg
# 
# def from_reg_bool(_offset):
#     """ Returns a callable that will unpack a boolean value from a
#     register bit. Designed as shorthand for common use in instrument
#     register accessor lists. Equivalent to
#     :any:`from_reg_unsigned(_offset, 1, xform=bool)`.
# 
#     :param _offset: Offset of data field in the register (set)
#     """
#     return from_reg_unsigned(_offset, 1, xform=lambda obj, x: bool(x))
# 
# Path: pymoku/_instrument.py
# def to_reg_signed(_offset, _len, allow_set=None, allow_range=None,
#                   xform=lambda obj, x: x):
#     """ Returns a callable that will pack a new signed data value in to a
#     register. Designed as shorthand for common use in instrument register
#     accessor lists. Supports single and compound registers (i.e. data values
#     that span more than one register).
# 
#     :param _offset: Offset of data field in the register (set)
#     :param _len: Length of data field in the register (set)
#     :param allow_set: Set containing all valid values of the data field.
#     :param allow_range: a two-tuple specifying the bounds of the data value.
#     :param xform: a callable that translates the user value written to the
#     attribute to the register value
#     """
#     # TODO: This signed and the below unsigned share all but one line of
#     # code, should consolidate
#     def __ss(obj, val, old):
#         val = xform(obj, val)
#         mask = ((1 << _len) - 1) << _offset
# 
#         if allow_set and allow_range:
#             raise MokuException("Can't check against both ranges and sets")
# 
#         if allow_set and val not in allow_set:
#             return None
#         elif allow_range and (val < allow_range[0] or val > allow_range[1]):
#             return None
# 
#         v = _sgn(val, _len) << _offset
# 
#         try:
#             return (old & ~mask) | v
#         except TypeError:
#             r = []
#             for o in reversed(old):
#                 r.insert(0, (o & ~mask) | v & 0xFFFFFFFF)
# 
#                 v = v >> 32
#                 mask = mask >> 32
# 
#             return tuple(r)
# 
#     return __ss
# 
# def to_reg_bool(_offset):
#     """ Returns a callable that will pack a new boolean data value in to a
#     single bit of a register. Designed as shorthand for common use in
#     instrument register accessor lists. Equivalent to :any:
#     `to_reg_unsigned(_offset, 1, allow_set=[0, 1], xform=int)`
# 
#     :param _offset: Offset of bit in the register (set)
#     """
#     return to_reg_unsigned(_offset, 1, allow_set=[0, 1], xform=lambda obj,
#                            x: int(x))


from ._instrument import from_reg_signed, from_reg_bool
from ._instrument import to_reg_signed, to_reg_bool
        return self._instr._accessor_get(r, from_reg_signed(0, 5))

    @bandwidth.setter
    def bandwidth(self, value):
        r = self.reg_base + EmbeddedPLL._REG_BANDWIDTH
        self._instr._accessor_set(r, to_reg_signed(0, 5), value)  # allow_set?

    @property
    def autoacquire(self):
        r = self.reg_base + EmbeddedPLL._REG_AUTOACQ
        return self._instr._accessor_get(r, from_reg_bool(0))

    @autoacquire.setter
    def autoacquire(self, value):
        r = self.reg_base + EmbeddedPLL._REG_AUTOACQ
        self._instr._accessor_set(r, to_reg_bool(0), value)  # allow_set?

    @property
    def reacquire(self):
        r = self.reg_base + EmbeddedPLL._REG_REACQ
        return self._instr._accessor_get(r, from_reg_bool(0))

    @reacquire.setter
    def reacquire(self, value):
        r = self.reg_base + EmbeddedPLL._REG_REACQ
        self._instr._accessor_set(r, to_reg_bool(0), value)  # allow_set?

    @property
    def pllreset(self):
        r = self.reg_base + EmbeddedPLL._REG_RESET

# Path: pymoku/_instrument.py
# def from_reg_signed(_offset, _len, xform=lambda obj, x: x):
#     """ Returns a callable that will unpack a signed data value from a r
#     egister bitfield. Designed as shorthand for common use in instrument
#     register accessor lists. Supports single and compound registers
#     (i.e. data values that span more than one register).
# 
#     :param _offset: Offset of data field in the register (set)
#     :param _len: Length of data field in the register (set)
#     :param xform: a callable that translates the register value to the
#     user attribute's natural units
#     """
#     # TODO: As above, this and the unsigned version share all but one
#     # line of code, should consolidate.
#     mask = ((1 << _len) - 1) << _offset
# 
#     def __sg(obj, reg):
#         try:
#             return xform(obj, _upsgn((reg & mask) >> _offset, _len))
#         except TypeError:
#             v = 0
#             for r in reg:
#                 v <<= 32
#                 v |= r
# 
#             return xform(obj, _upsgn((v & mask) >> _offset, _len))
# 
#     return __sg
# 
# def from_reg_bool(_offset):
#     """ Returns a callable that will unpack a boolean value from a
#     register bit. Designed as shorthand for common use in instrument
#     register accessor lists. Equivalent to
#     :any:`from_reg_unsigned(_offset, 1, xform=bool)`.
# 
#     :param _offset: Offset of data field in the register (set)
#     """
#     return from_reg_unsigned(_offset, 1, xform=lambda obj, x: bool(x))
# 
# Path: pymoku/_instrument.py
# def to_reg_signed(_offset, _len, allow_set=None, allow_range=None,
#                   xform=lambda obj, x: x):
#     """ Returns a callable that will pack a new signed data value in to a
#     register. Designed as shorthand for common use in instrument register
#     accessor lists. Supports single and compound registers (i.e. data values
#     that span more than one register).
# 
#     :param _offset: Offset of data field in the register (set)
#     :param _len: Length of data field in the register (set)
#     :param allow_set: Set containing all valid values of the data field.
#     :param allow_range: a two-tuple specifying the bounds of the data value.
#     :param xform: a callable that translates the user value written to the
#     attribute to the register value
#     """
#     # TODO: This signed and the below unsigned share all but one line of
#     # code, should consolidate
#     def __ss(obj, val, old):
#         val = xform(obj, val)
#         mask = ((1 << _len) - 1) << _offset
# 
#         if allow_set and allow_range:
#             raise MokuException("Can't check against both ranges and sets")
# 
#         if allow_set and val not in allow_set:
#             return None
#         elif allow_range and (val < allow_range[0] or val > allow_range[1]):
#             return None
# 
#         v = _sgn(val, _len) << _offset
# 
#         try:
#             return (old & ~mask) | v
#         except TypeError:
#             r = []
#             for o in reversed(old):
#                 r.insert(0, (o & ~mask) | v & 0xFFFFFFFF)
# 
#                 v = v >> 32
#                 mask = mask >> 32
# 
#             return tuple(r)
# 
#     return __ss
# 
# def to_reg_bool(_offset):
#     """ Returns a callable that will pack a new boolean data value in to a
#     single bit of a register. Designed as shorthand for common use in
#     instrument register accessor lists. Equivalent to :any:
#     `to_reg_unsigned(_offset, 1, allow_set=[0, 1], xform=int)`
# 
#     :param _offset: Offset of bit in the register (set)
#     """
#     return to_reg_unsigned(_offset, 1, allow_set=[0, 1], xform=lambda obj,
#                            x: int(x))


# Path: pymoku/_embedded_pll.py
from ._instrument import from_reg_signed, from_reg_bool
from ._instrument import to_reg_signed, to_reg_bool

        return self._instr._accessor_get(r, from_reg_signed(0, 5))

    @bandwidth.setter
    def bandwidth(self, value):
        r = self.reg_base + EmbeddedPLL._REG_BANDWIDTH
        self._instr._accessor_set(r, to_reg_signed(0, 5), value)  # allow_set?

    @property
    def autoacquire(self):
        r = self.reg_base + EmbeddedPLL._REG_AUTOACQ
        return self._instr._accessor_get(r, from_reg_bool(0))

    @autoacquire.setter
    def autoacquire(self, value):
        r = self.reg_base + EmbeddedPLL._REG_AUTOACQ
        self._instr._accessor_set(r, to_reg_bool(0), value)  # allow_set?

    @property
    def reacquire(self):
        r = self.reg_base + EmbeddedPLL._REG_REACQ
        return self._instr._accessor_get(r, from_reg_bool(0))

    @reacquire.setter
    def reacquire(self, value):
        r = self.reg_base + EmbeddedPLL._REG_REACQ
        self._instr._accessor_set(r, to_reg_bool(0), value)  # allow_set?

    @property
    def pllreset(self):
        r = self.reg_base + EmbeddedPLL._REG_RESET

        return self._instr._accessor_get(r, from_reg_bool(31))