Skip to content
Snippets Groups Projects
Commit 66168781 authored by Gijs Schoonderbeek's avatar Gijs Schoonderbeek
Browse files

Update rd_unb2c.py and UniBoard_I2C.py after testing on hardware

parent 91bc850d
Branches
No related tags found
1 merge request!2Modified the scripts to run on Raspberry Pi.
......@@ -46,7 +46,7 @@ CTRL_POWER = 0x10
# Front panel LED
################
LED_DRIVER = 0x41
LED_COLORS = {"red": 0x01, "blue": 0x02, "green" : 0x04, "magenta": 0x03, "yellow": 0x06, "cyaan": 0x05}
LED_COLORS = {"red": 0x06, "blue": 0x05, "green" : 0x03, "magenta": 0x04, "yellow": 0x02, "cyaan": 0x01, "white": 0x00, "black" :0x07}
################
# Node I2C switch
......
......@@ -44,13 +44,7 @@ def front_led(collor):
print("Front LED driver not found")
else:
front.write_bytes(0x01, collor)
sleep(0.5)
for cnt in range(6):
front.write_bytes(0x01, (1 << cnt%3)^0xff)
sleep(0.2)
front.write_bytes(0x01, 0)
sleep(0.2)
front.write_bytes(0x01, 0xf)
sleep(1.5)
def read_pol(node_nr, i2c_addr):
if node_nr >= 0:
......@@ -81,8 +75,6 @@ def read_pol(node_nr, i2c_addr):
if ret_ack < 1:
print("no device found")
else:
# pr_stri = "Found device at address 0x{:02x}".format(LOC_PWR.I2C_Address)
# print(pr_stri)
ret_ack, vout_mod = LOC_PWR.read_bytes(LP_VOUT_MODE, 1)
ret_ack, raw_value = LOC_PWR.read_bytes(LP_VOUT, 2)
vout_mod = int(vout_mod,16)
......@@ -170,7 +162,9 @@ def read_qsfp(node_nr = 0, module=0):
if 1:
rw_eeprom(0xCD)
front_led(LED_COLORS["green"])
for color in list(LED_COLORS.keys()):
print(color)
front_led(LED_COLORS[color])
for node_cnt in range(4):
for module_cnt in range(2):
read_ddr(node_nr=node_cnt,module=module_cnt)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment