コード例 #1
0
    def __init__(self,
                 conn: BPConnection = None,
                 port: serial.Serial = None,
                 portname: str = "/dev/bus_pirate",
                 speed=115200,
                 timeout=1):
        """Class Constructor"""

        # Property Definitions
        self.__log = Logger.getlogger()
        """Class Logger"""

        # Conection
        self.Connection = conn
        if self.Connection == None:
            self.Connection = BPConnection(port, portname, speed, timeout)

        # Interfaces
        self.BitBang = BPBitBang(self.Connection)
        """BitBang Interface"""
        self.Uart = BPUart(self.Connection)
        """Uart used for Serial I/O"""
        self.I2c = BPI2c(self.Connection)
        """I2c Interface"""
        self.Spi = BPSpi(self.Connection)
        """Spi Interface"""
        self.OneWire = BPOneWire(self.Connection)
        """OneWire Interface"""
        self.RawWire = BPRawWire(self.Connection)
        """RawWire Interface"""
        self.Aux = BPAux(self.Connection)
        """Aux Pins (pullup / power supply)"""
コード例 #2
0
    def __init__(self,
                 port: serial.Serial = None,
                 portname: str = "/dev/bus_pirate",
                 speed=115200,
                 timeout=1):

        # Property Definitions

        self.__log = Logger.getlogger()
        """Class Logger"""

        self.Mode = BPMode.Console
        """Mode of operation"""

        self.Attempts = 15
        """Number of attempts to make at establishing a connection"""

        self.Port = port
        """Serial Port to use"""

        self.MinDelay = 1
        """Minimum Delay"""

        if self.Port == None:
            self.Port = serial.Serial()
            self.Port.port = portname
            self.Port.baudrate = 115200
            self.Port.timeout = timeout
コード例 #3
0
    def __init__(self, conn: BPConnection):
        """Class constructor"""
        super(BPOneWire, self).__init__(conn)

        # Property Definitions
        self.__log = Logger.getlogger()
        """Class Logger"""
        self.RequiredMode = [BPMode.OneWire]
        """Mode that is required for the interface to operate"""
コード例 #4
0
ファイル: BPUart.py プロジェクト: ASoftTech/Py.BusPiratePy3
    def __init__(self, conn: BPConnection):
        """Class constructor"""
        super(BPUart, self).__init__(conn)

        # Property Definitions
        self.__log = Logger.getlogger()
        """Class Logger"""
        self.RequiredMode = [BPMode.Uart]
        """Mode that is required for the interface to operate"""
        self.Config = BPUartConfig(conn)
        """Configuration for the Port"""
コード例 #5
0
    def __init__(self, parent: BPBase):
        """Class constructor"""

        # Property Definitions
        self.__log = Logger.getlogger()
        """Class Logger"""
        self.Parent = parent
        """Parent Serial Port class"""
        self.RequiredMode = [BPMode.Uart]
        """Mode that is required for the interface to operate"""
        self.SerialRegister = 0x00
        """Configuration Bits for the Uart"""
コード例 #6
0
    def __init__(self, conn: BPConnection):
        """Class constructor"""
        super(BPAux, self).__init__(conn)

        # Property Definitions
        self.__log = Logger.getlogger()
        """Class Logger"""
        self.RequiredMode = [
            BPMode.Spi, BPMode.I2c, BPMode.Uart, BPMode.OneWire, BPMode.RawWire
        ]
        """Mode that is required for the interface to operate"""
        self.AuxRegister = 0x00
        """Current State of the Aux Pins"""