forked from M-Labs/artiq-zynq
driver: add econ roi gating
This commit is contained in:
parent
58b05a2877
commit
513c3e055a
@ -93,6 +93,8 @@ class CoaXPress:
|
||||
|
||||
self.xml_url = [0] * xml_url_len
|
||||
|
||||
self.econ_roi = False
|
||||
|
||||
@staticmethod
|
||||
def get_rtio_channels(channel, **kwargs):
|
||||
return [(channel, None)]
|
||||
@ -103,6 +105,8 @@ class CoaXPress:
|
||||
|
||||
@kernel
|
||||
def setup_roi(self, n, x0, y0, x1, y1):
|
||||
if self.econ_roi:
|
||||
assert x1-x0 >= 4
|
||||
# DEBUG:
|
||||
# c = int64(self.core.ref_multiplier)
|
||||
c = int64(8)
|
||||
@ -264,7 +268,7 @@ FORMAT_DICT = {
|
||||
"MONO10": 17825795,
|
||||
"MONO12": 17825797,
|
||||
}
|
||||
TESTPATTERN = "OFF"
|
||||
TESTPATTERN = "WHITE"
|
||||
PATTERN_DICT = {
|
||||
"OFF" : 0, # normal operation
|
||||
"BLACK" : 1, # all pixels set to 0
|
||||
@ -342,7 +346,7 @@ class IdleKernel(EnvExperiment):
|
||||
self.core.reset()
|
||||
self.core.break_realtime()
|
||||
|
||||
self.cxp.setup_roi(0, 1, 1, 2, 2)
|
||||
self.cxp.setup_roi(0, 1, 1, 5, 5)
|
||||
delay_mu(1000000)
|
||||
|
||||
if CXP_TRIG:
|
||||
@ -376,7 +380,7 @@ class IdleKernel(EnvExperiment):
|
||||
print("[{}]".format(", ".join(hex(np.uint32(x)) for x in arr)))
|
||||
|
||||
def run(self):
|
||||
# self.camera_init()
|
||||
self.camera_init()
|
||||
print(f"power mode before trigger = {self.camera_trigger_setup(FORMAT_DICT[PIXELFORMAT], PATTERN_DICT[TESTPATTERN])}")
|
||||
print(f"power mode after trigger = {self.camera_trigger()}")
|
||||
print(f"count = {np.uint32(self.cnt)} | timestamp = {self.timestamp}")
|
||||
|
Loading…
Reference in New Issue
Block a user