attenuation-control: Add scripts to control the attenuation
Xmlrpc client/server application to control the digital attenuators installed in the lava testbed. Implements AR_VUL-64. Signed-off-by: Thomas Klaehn <thomas.klaehn@u-blox.com>
This commit is contained in:
22
mock/IOPi/__init__.py
Normal file
22
mock/IOPi/__init__.py
Normal file
@@ -0,0 +1,22 @@
|
||||
class IOPi(object):
|
||||
address = None
|
||||
used_pins = [0 for i in range(17)]
|
||||
pin_directions = [0 for i in range(17)]
|
||||
pin_values = [0 for i in range(17)]
|
||||
|
||||
def __init__(self, address):
|
||||
self.address = address
|
||||
|
||||
def set_pin_direction(self, pin, direction):
|
||||
self.used_pins[pin] = 1
|
||||
self.pin_directions[pin] = direction
|
||||
|
||||
def write_pin(self, pin, value):
|
||||
self.used_pins[pin] = 1
|
||||
self.pin_values[pin] = value
|
||||
|
||||
def read_pin(self, pin):
|
||||
if self.used_pins[pin] == 1:
|
||||
return self.pin_values[pin]
|
||||
else:
|
||||
return None
|
0
mock/__init__.py
Normal file
0
mock/__init__.py
Normal file
Reference in New Issue
Block a user