uC chip interface arduino  0.9.0
A interface for async and neuromrphic IC testing
Loading...
Searching...
No Matches
PinPacket Class Reference

The PinPacket is used to comunicate pin instructions with the uC all availible instructions are defined in the PinHeader. More...

Inheritance diagram for PinPacket:
Collaboration diagram for PinPacket:

Public Member Functions

def __init__ (self, header, pin_id, value=0, time=0)
 constructor for the PinPacket More...
 
def __str__ (self)
 
def from_bytearray (self, byte_array)
 constructs a PinPacket from a bytearray More...
 
def pin_id (self)
 getter method for the pin_id attribute More...
 
def set_header (self, header)
 setter method for the header attribute More...
 
def set_pin_id (self, pin_id)
 setter method for the pin_id attribute More...
 
def set_value (self, value)
 setter method for the pin value attribute More...
 
def to_bytearray (self)
 method to convert the packet to a bytearray in the correct format of <header><exec_time><pin_id> More...
 
def value (self)
 getter method for the value attribute More...
 
- Public Member Functions inherited from Packet
def __init__ (self)
 
def check_and_log (self)
 check_and_log logs the packet if the header is in the logging lists More...
 
def from_bytearray (cls, byte_array)
 method to construct a packet from a bytearray depending on the header the correct packet type is returned More...
 
def header (self)
 getter method for the header attribute More...
 
def set_exec_time (self, time)
 setter method for the execution time attribute More...
 
def set_header (self, header)
 setter method for the header attribute More...
 
def time (self)
 getter method for the time attribute More...
 
def to_bytearray (self)
 placeholder for converting the package to a bytearray More...
 

Detailed Description

The PinPacket is used to comunicate pin instructions with the uC all availible instructions are defined in the PinHeader.

Definition at line 290 of file packet.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  header,
  pin_id,
  value = 0,
  time = 0 
)

constructor for the PinPacket

Parameters
header(PinHeader or UINT8) the header of the packet
pin_id(uint_8) the pin id to be adressed
value(uint_8) the value to be sent (optional, default = 0) - 0 to set pin LOW, (>=) 1 to set pin HIGH.
time(uint_32) the time of execution of the packet (optional, default = 0)

Reimplemented from Packet.

Definition at line 294 of file packet.py.

Member Function Documentation

◆ __str__()

def __str__ (   self)

Definition at line 353 of file packet.py.

◆ from_bytearray()

def from_bytearray (   self,
  byte_array 
)

constructs a PinPacket from a bytearray

Parameters
byte_array9 byte bytearray to construct the Packet from
Returns
: PinPacket @raise Exception: if package construction fails

Reimplemented from Packet.

Definition at line 357 of file packet.py.

◆ pin_id()

def pin_id (   self)

getter method for the pin_id attribute

Returns
: the pin_id of the pin

Definition at line 307 of file packet.py.

◆ set_header()

def set_header (   self,
  header 
)

setter method for the header attribute

Parameters
header(PinHeader or uint8) the header of the packet

Reimplemented from Packet.

Definition at line 319 of file packet.py.

◆ set_pin_id()

def set_pin_id (   self,
  pin_id 
)

setter method for the pin_id attribute

Parameters
pin_id(uint_8) the pin id to be adressed

Definition at line 328 of file packet.py.

◆ set_value()

def set_value (   self,
  value 
)

setter method for the pin value attribute

Parameters
value(uint_8) the value

Definition at line 338 of file packet.py.

◆ to_bytearray()

def to_bytearray (   self)

method to convert the packet to a bytearray in the correct format of <header><exec_time><pin_id>

Returns
: the packet as a bytearray

Reimplemented from Packet.

Definition at line 347 of file packet.py.

◆ value()

def value (   self)

getter method for the value attribute

Returns
: the value of the pin

Definition at line 313 of file packet.py.


The documentation for this class was generated from the following file: