Ejemplo n.º 1
0
    def getAccumulatorOutput(self) -> AccumulatorResult:
        """Read the accumulated value and the number of accumulated values
        atomically.

        This function reads the value and count from the FPGA atomically. This
        can be used for averaging.
        """
        if not self.isAccumulatorChannel():
            raise IndexError("Channel %d is not an accumulator channel." % self.channel)
        (value, count) = hal.getAccumulatorOutput(self.port)

        return AccumulatorResult(value + self.accumulatorOffset, count)
Ejemplo n.º 2
0
    def getAccumulatorOutput(self):
        """Read the accumulated value and the number of accumulated values
        atomically.

        This function reads the value and count from the FPGA atomically. This
        can be used for averaging.

        :returns: tuple of (value, count)
        """
        if not self.isAccumulatorChannel():
            raise IndexError("Channel %d is not an accumulator channel." % self.channel)
        return hal.getAccumulatorOutput(self.port)
Ejemplo n.º 3
0
    def getAccumulatorOutput(self) -> AccumulatorResult:
        """Read the accumulated value and the number of accumulated values
        atomically.

        This function reads the value and count from the FPGA atomically. This
        can be used for averaging.
        """
        if not self.isAccumulatorChannel():
            raise IndexError("Channel %d is not an accumulator channel." % self.channel)
        (value, count) = hal.getAccumulatorOutput(self.port)

        return AccumulatorResult(value + self.accumulatorOffset, count)