Commit a5738482 authored by Andrey Filippov's avatar Andrey Filippov

morte to the previous commit

parent 47f19c8b
...@@ -1897,8 +1897,8 @@ class X393SensCmprs(object): ...@@ -1897,8 +1897,8 @@ class X393SensCmprs(object):
num_payload_bytes = (0,1,2,4)[byte_var] num_payload_bytes = (0,1,2,4)[byte_var]
self.x393Sensor.set_sensor_i2c_table_reg_wr ( self.x393Sensor.set_sensor_i2c_table_reg_wr (
num_sensor = num_sensor, num_sensor = num_sensor,
page = indx*4, page = indx * 4 + byte_var,
slave_addr = num_payload_bytes, slave_addr = byte_var, # num_payload_bytes,
rah = mod_index, rah = mod_index,
num_bytes = 4, num_bytes = 4,
bit_delay = i2c_delay, # not used here bit_delay = i2c_delay, # not used here
...@@ -1916,6 +1916,8 @@ class X393SensCmprs(object): ...@@ -1916,6 +1916,8 @@ class X393SensCmprs(object):
self.x393Sensor.set_sensor_i2c_command ( self.x393Sensor.set_sensor_i2c_command (
num_sensor = num_sensor, num_sensor = num_sensor,
run_cmd = True) run_cmd = True)
if verbose >0 :
print (" --- Enabled i2c sequencer ---")
if exit_step == 21: return False if exit_step == 21: return False
......
...@@ -911,11 +911,14 @@ class X393Sensor(object): ...@@ -911,11 +911,14 @@ class X393Sensor(object):
if payload_mode < 0: if payload_mode < 0:
raise ValueError('Payload of 3 bytes is not implemented, only 0,1,2 or 4 bytes are valid.') raise ValueError('Payload of 3 bytes is not implemented, only 0,1,2 or 4 bytes are valid.')
_,mod_index = BOSON_MAP[mod_name] _,mod_index = BOSON_MAP[mod_name]
wdata = ((mod_index * 4 + payload_mode) << 24) + (func_lsb & 0xff) << 16 + (data & 0xffff)
wdata = ((mod_index * 4 + payload_mode) << 24) + ((func_lsb & 0xff) << 16) + (data & 0xffff)
self.write_sensor_i2c (num_sensor = num_sensor, self.write_sensor_i2c (num_sensor = num_sensor,
rel_addr = rel_addr, rel_addr = rel_addr,
addr = addr, addr = addr,
data = wdata) data = wdata)
print ("Boson sequencer command: addr= 0x%x, data = 0x%x"%(addr,wdata))
def write_sensor_reg16(self, def write_sensor_reg16(self,
num_sensor, num_sensor,
...@@ -1635,7 +1638,7 @@ class X393Sensor(object): ...@@ -1635,7 +1638,7 @@ class X393Sensor(object):
wait_packet = True, wait_packet = True,
enable_sequencer = True): enable_sequencer = True):
""" """
Send packet to UART Send packet to UART (assuming sequencer is disabled if needed)
@param num_sensor - sensor port number (0..3) @param num_sensor - sensor port number (0..3)
@param wait packet - if False, return empty packet if none is available @param wait packet - if False, return empty packet if none is available
@param enable_sequencer (Re)enable sequencer commands @param enable_sequencer (Re)enable sequencer commands
...@@ -1651,6 +1654,10 @@ class X393Sensor(object): ...@@ -1651,6 +1654,10 @@ class X393Sensor(object):
if not wait_packet: if not wait_packet:
break break
if not recv_pav: if not recv_pav:
if enable_sequencer:
self.set_sensor_uart_ctl_boson ( # next byte
num_sensor = num_sensor,
uart_extif_en = True)
return packet # empty bytearray return packet # empty bytearray
#read byte array. TODO: improve waiting for tghe next byte? #read byte array. TODO: improve waiting for tghe next byte?
# packet = bytearray() # packet = bytearray()
...@@ -1664,7 +1671,11 @@ class X393Sensor(object): ...@@ -1664,7 +1671,11 @@ class X393Sensor(object):
uart_recv_next = True) uart_recv_next = True)
if not recv_eop: if not recv_eop:
packet.append(recv_data) packet.append(recv_data)
# #
if enable_sequencer:
self.set_sensor_uart_ctl_boson ( # next byte
num_sensor = num_sensor,
uart_extif_en = True)
return packet return packet
def jtag_get_tdo(self, chn): def jtag_get_tdo(self, chn):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment