From 513c3e055ab4074185885bc78f50f5a7c106714e Mon Sep 17 00:00:00 2001 From: morgan Date: Fri, 24 Jan 2025 12:37:07 +0800 Subject: [PATCH] driver: add econ roi gating --- cxp_kernel.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cxp_kernel.py b/cxp_kernel.py index 2fb7c79..15d196c 100644 --- a/cxp_kernel.py +++ b/cxp_kernel.py @@ -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}")