# vim: ts=2:sw=2:tw=80:nowrap

import Pyro4

from ....channels import Base as root_base

class Base(root_base):
  @Pyro4.expose
  def get_min_period(self):
    """
    Returns the minimum timing period (period between two rising edges of this
    clock pulse) in units of seconds.
    """
    return self.device.get_min_period()

  @property
  def _finite_end_clock(self):
    """
    Identifies a channel as requiring a special extra clock pulse at the end of
    the sequence in _non-continuous_ mode so that the hardware will recognize
    the end of the sequence (and also thus notify the software).  Currently,
    only NI hardware is known to require this.

    * For this specialization (for comedi), we need to test each subdevice
    * separately.  We'll use a lookup table to map (kernel,board) to known
    * capabilities for devices.

    !!!!NOTE!!!!
    For any driver/channel that defines this requirement, an extra transition
    will be generated by its clock in order to faciltate this last transition.
    Thus, it is necessary that the driver/channel ignore the last transition
    that is given to its clock source.
    """
    return self.device.finite_end_clock
