コード例 #1
0
 def setSampleDataOnRising(self):
     """Configure that the data is stable on the rising edge and the data
     changes on the falling edge.
     """
     self.dataOnTrailing = False
     hal.setSPIOpts(self.port, self.bitOrder, self.dataOnTrailing,
                    self.clockPolarity)
コード例 #2
0
ファイル: spi.py プロジェクト: vanjac/robotpy-wpilib
 def setClockActiveHigh(self):
     """Configure the clock output line to be active high.
     This is sometimes called clock polarity low or clock idle low.
     """
     self.clockPolarity = False
     hal.setSPIOpts(self.port, self.bitOrder, self.dataOnTrailing,
                    self.clockPolarity)
コード例 #3
0
ファイル: spi.py プロジェクト: vanjac/robotpy-wpilib
 def setMSBFirst(self):
     """Configure the order that bits are sent and received on the wire
     to be most significant bit first.
     """
     self.bitOrder = True
     hal.setSPIOpts(self.port, self.bitOrder, self.dataOnTrailing,
                    self.clockPolarity)
コード例 #4
0
 def setClockActiveLow(self) -> None:
     """Configure the clock output line to be active low. This is sometimes called clock polarity high
     or clock idle high.
     """
     self.clockPolarity = True
     hal.setSPIOpts(self.port, self.bitOrder, self.dataOnTrailing,
                    self.clockPolarity)
コード例 #5
0
ファイル: spi.py プロジェクト: topherCantrell/robotpy-wpilib
 def setClockActiveHigh(self) -> None:
     """Configure the clock output line to be active high. This is sometimes called clock polarity low
     or clock idle low.
     """
     self.clockIdleHigh = False
     hal.setSPIOpts(self.port, self.msbFirst, self.sampleOnTrailing,
                    self.clockIdleHigh)
コード例 #6
0
ファイル: spi.py プロジェクト: topherCantrell/robotpy-wpilib
 def setLSBFirst(self) -> None:
     """Configure the order that bits are sent and received on the wire to be least significant bit
     first.
     """
     self.msbFirst = False
     hal.setSPIOpts(self.port, self.msbFirst, self.sampleOnTrailing,
                    self.clockIdleHigh)
コード例 #7
0
 def setMSBFirst(self):
     """Configure the order that bits are sent and received on the wire
     to be most significant bit first.
     """
     self.bitOrder = True
     hal.setSPIOpts(self.port, self.bitOrder, self.dataOnTrailing,
                    self.clockPolarity)
コード例 #8
0
ファイル: spi.py プロジェクト: vanjac/robotpy-wpilib
 def setSampleDataOnRising(self):
     """Configure that the data is stable on the rising edge and the data
     changes on the falling edge.
     """
     self.dataOnTrailing = False
     hal.setSPIOpts(self.port, self.bitOrder, self.dataOnTrailing,
                    self.clockPolarity)
コード例 #9
0
 def setClockActiveHigh(self):
     """Configure the clock output line to be active high.
     This is sometimes called clock polarity low or clock idle low.
     """
     self.clockPolarity = False
     hal.setSPIOpts(self.port, self.bitOrder, self.dataOnTrailing,
                    self.clockPolarity)
コード例 #10
0
ファイル: spi.py プロジェクト: robotpy/robotpy-wpilib
 def setClockActiveHigh(self) -> None:
     """Configure the clock output line to be active high. This is sometimes called clock polarity low
     or clock idle low.
     """
     self.clockIdleHigh = False
     hal.setSPIOpts(
         self.port, self.msbFirst, self.sampleOnTrailing, self.clockIdleHigh
     )
コード例 #11
0
ファイル: spi.py プロジェクト: robotpy/robotpy-wpilib
 def setLSBFirst(self) -> None:
     """Configure the order that bits are sent and received on the wire to be least significant bit
     first.
     """
     self.msbFirst = False
     hal.setSPIOpts(
         self.port, self.msbFirst, self.sampleOnTrailing, self.clockIdleHigh
     )
コード例 #12
0
ファイル: spi.py プロジェクト: topherCantrell/robotpy-wpilib
    def setSampleDataOnRising(self) -> None:
        """
        Configure that the data is stable on the rising edge and the data changes on the falling edge.

        .. deprecated:: 2019.0.0
            Use setSampleDataOnLeadingEdge in most cases
        """
        self.sampleOnTrailing = False
        hal.setSPIOpts(self.port, self.msbFirst, self.sampleOnTrailing,
                       self.clockIdleHigh)
コード例 #13
0
ファイル: spi.py プロジェクト: topherCantrell/robotpy-wpilib
    def setSampleDataOnFalling(self) -> None:
        """
        Configure that the data is stable on the falling edge and the data changes on the rising edge.
        Note that this gets reversed if setClockActiveLow is set

        .. deprecated:: 2019.0.0
            Use setSampleDataOnTrailingEdge in most cases
        """
        self.sampleOnTrailing = True
        hal.setSPIOpts(self.port, self.msbFirst, self.sampleOnTrailing,
                       self.clockIdleHigh)
コード例 #14
0
ファイル: spi.py プロジェクト: robotpy/robotpy-wpilib
    def setSampleDataOnRising(self) -> None:
        """
        Configure that the data is stable on the rising edge and the data changes on the falling edge.

        .. deprecated:: 2019.0.0
            Use setSampleDataOnLeadingEdge in most cases
        """
        self.sampleOnTrailing = False
        hal.setSPIOpts(
            self.port, self.msbFirst, self.sampleOnTrailing, self.clockIdleHigh
        )
コード例 #15
0
ファイル: spi.py プロジェクト: robotpy/robotpy-wpilib
    def setSampleDataOnFalling(self) -> None:
        """
        Configure that the data is stable on the falling edge and the data changes on the rising edge.
        Note that this gets reversed if setClockActiveLow is set

        .. deprecated:: 2019.0.0
            Use setSampleDataOnTrailingEdge in most cases
        """
        self.sampleOnTrailing = True
        hal.setSPIOpts(
            self.port, self.msbFirst, self.sampleOnTrailing, self.clockIdleHigh
        )
コード例 #16
0
 def setSampleDataOnTrailingEdge(self) -> None:
     """Configure that the data is stable on the trailing edge and the data changes on the leading edge."""
     self.dataOnTrailing = True
     hal.setSPIOpts(self.port, self.bitOrder, self.dataOnTrailing,
                    self.clockPolarity)
コード例 #17
0
ファイル: spi.py プロジェクト: topherCantrell/robotpy-wpilib
 def setSampleDataOnTrailingEdge(self) -> None:
     """Configure that the data is stable on the trailing edge and the data changes on the leading edge."""
     self.sampleOnTrailing = True
     hal.setSPIOpts(self.port, self.msbFirst, self.sampleOnTrailing,
                    self.clockIdleHigh)
コード例 #18
0
ファイル: spi.py プロジェクト: robotpy/robotpy-wpilib
 def setSampleDataOnTrailingEdge(self) -> None:
     """Configure that the data is stable on the trailing edge and the data changes on the leading edge."""
     self.sampleOnTrailing = True
     hal.setSPIOpts(
         self.port, self.msbFirst, self.sampleOnTrailing, self.clockIdleHigh
     )