stypedefs+=self.get_typedef32(comment="DQS and DQM patterns (DQM - 0, DQS 0xaa or 0x55)",
data=self._enc_mcntrl_dqs_dqm_patterns(),
name="x393_mcntr_dqs_dqm_patt_rw",
frmt_spcs=frmt_spcs)
stypedefs+=self.get_typedef32(comment="DQ and DQS tristate control when turning on and off",
data=self._enc_mcntrl_dqs_dq_tri(),
name="x393_mcntr_dqs_dqm_tri_rw",
frmt_spcs=frmt_spcs)
returnstypedefs
defdefine_macros(self):
#memory arbiter priorities
ba=vrlg.CONTROL_ADDR
z3=(0,3)
z15=(0,15)
ia=1
c="chn"
sdefines=[]
sdefines+=[
(('R/W addresses to set up memory arbiter priorities. For sensors (chn = 8..11), for compressors - 12..15',)),
(("X393_MCNTRL_ARBITER_PRIORITY",c,vrlg.MCONTR_ARBIT_ADDR+ba,ia,z15,"x393_arbite_pri_rw","Set memory arbiter priority (currently r/w, may become just wo)"))]
sdefines+=[
(('Enable/disable memory channels (bits in a 16-bit word). For sensors (chn = 8..11), for compressors - 12..15',)),
(("X393_MCNTRL_CHN_EN",c,vrlg.MCONTR_TOP_16BIT_ADDR+vrlg.MCONTR_TOP_16BIT_CHN_EN+ba,0,None,"x393_mcntr_chn_en_rw","Enable/disable memory channels (currently r/w, may become just wo)")),
(("X393_MCNTRL_DQS_DQM_PATT",c,vrlg.MCONTR_PHY_16BIT_ADDR+vrlg.MCONTR_PHY_16BIT_PATTERNS+ba,0,None,"x393_mcntr_dqs_dqm_patt_rw","Setup DQS and DQM patterns")),
(("X393_MCNTRL_DQ_DQS_TRI",c,vrlg.MCONTR_PHY_16BIT_ADDR+vrlg.MCONTR_PHY_16BIT_PATTERNS_TRI+ba,0,None,"x393_mcntr_dqs_dqm_tri_rw","Setup DQS and DQ on/off sequence")),
(("Following enable/disable addresses can be written with any data,only addresses matter",)),
(('Write-only addresses to program memory channels for sensors (chn = 0..3), memory channels 8..11',)),
(("X393_SENS_MCNTRL_SCANLINE_MODE",c,vrlg.MCNTRL_SCANLINE_MODE+ba,ia,z3,"x393_mcntrl_mode_scan_wo","Set mode register (write last after other channel registers are set)")),
(("X393_SENS_MCNTRL_SCANLINE_STATUS_CNTRL",c,vrlg.MCNTRL_SCANLINE_STATUS_CNTRL+ba,ia,z3,"x393_status_ctrl_wo","Set status control register (status update mode)")),
(("X393_SENS_MCNTRL_SCANLINE_FRAME_LAST",c,vrlg.MCNTRL_SCANLINE_FRAME_LAST+ba,ia,z3,"x393_mcntrl_window_last_frame_num_wo","Set last frame number (number of frames in buffer minus 1)")),
(('Write-only addresses to program memory channels for compressors (chn = 0..3), memory channels 12..15',)),
(("X393_SENS_MCNTRL_TILED_MODE",c,vrlg.MCNTRL_TILED_MODE+ba,ia,z3,"x393_mcntrl_mode_scan_wo","Set mode register (write last after other channel registers are set)")),
(("X393_SENS_MCNTRL_TILED_STATUS_CNTRL",c,vrlg.MCNTRL_TILED_STATUS_CNTRL+ba,ia,z3,"x393_status_ctrl_wo","Set status control register (status update mode)")),
(("X393_SENS_MCNTRL_TILED_FRAME_LAST",c,vrlg.MCNTRL_TILED_FRAME_LAST+ba,ia,z3,"x393_mcntrl_window_last_frame_num_wo","Set last frame number (number of frames in buffer minus 1)")),
(('Write-only addresses to program memory channel for membridge, memory channel 1',)),
(("X393_MEMBRIDGE_SCANLINE_MODE",c,vrlg.MCNTRL_SCANLINE_MODE+ba,0,None,"x393_mcntrl_mode_scan_wo","Set mode register (write last after other channel registers are set)")),
(("X393_MEMBRIDGE_SCANLINE_STATUS_CNTRL",c,vrlg.MCNTRL_SCANLINE_STATUS_CNTRL+ba,0,None,"x393_status_ctrl_wo","Set status control register (status update mode)")),
(("X393_MEMBRIDGE_SCANLINE_FRAME_LAST",c,vrlg.MCNTRL_SCANLINE_FRAME_LAST+ba,0,None,"x393_mcntrl_window_last_frame_num_wo","Set last frame number (number of frames in buffer minus 1)")),
(('Write-only addresses to PS PIO (Software generated DDR3 memory access sequences)',)),
(("X393_MCNTRL_PS_EN_RST",c,vrlg.MCNTRL_PS_EN_RST+ba,0,None,"x393_ps_pio_en_rst_wo","Set PS PIO enable and reset")),
(("X393_MCNTRL_PS_CMD",c,vrlg.MCNTRL_PS_CMD+ba,0,None,"x393_ps_pio_cmd_wo","Set PS PIO commands")),
(("X393_MCNTRL_PS_STATUS_CNTRL",c,vrlg.MCNTRL_PS_STATUS_CNTRL+ba,0,None,"x393_status_ctrl_wo","Set PS PIO status control register (status update mode)"))]
#other program status (move to other places?)
ba=vrlg.MCONTR_PHY_16BIT_ADDR
ia=0
c=""
sdefines+=[
(('Write-only addresses to to program status report mode For memory controller',)),
(("X393_MCONTR_PHY_STATUS_CNTRL",c,vrlg.MCONTR_PHY_STATUS_CNTRL+ba,0,None,"x393_status_ctrl_wo","Set status control register (status update mode)")),
(("X393_MCONTR_TOP_16BIT_STATUS_CNTRL",c,vrlg.MCONTR_TOP_16BIT_STATUS_CNTRL+ba,0,None,"x393_status_ctrl_wo","Set status control register (status update mode)")),
]
ba=vrlg.MCNTRL_TEST01_ADDR
ia=0
c=""
sdefines+=[
(('Write-only addresses to to program status report mode for test channels',)),
(("X393_MCNTRL_TEST01_CHN2_STATUS_CNTRL",c,vrlg.MCNTRL_TEST01_CHN2_STATUS_CNTRL+ba,0,None,"x393_status_ctrl_wo","Set status control register (status update mode)")),
(("X393_MCNTRL_TEST01_CHN3_STATUS_CNTRL",c,vrlg.MCNTRL_TEST01_CHN3_STATUS_CNTRL+ba,0,None,"x393_status_ctrl_wo","Set status control register (status update mode)")),
(("X393_MCNTRL_TEST01_CHN4_STATUS_CNTRL",c,vrlg.MCNTRL_TEST01_CHN4_STATUS_CNTRL+ba,0,None,"x393_status_ctrl_wo","Set status control register (status update mode)")),
(('Write-only addresses for test channels commands',)),
(("X393_MCNTRL_TEST01_CHN2_MODE",c,vrlg.MCNTRL_TEST01_CHN2_MODE+ba,0,None,"x393_test01_mode_wo","Set command for test01 channel 2")),
(("X393_MCNTRL_TEST01_CHN3_MODE",c,vrlg.MCNTRL_TEST01_CHN3_MODE+ba,0,None,"x393_test01_mode_wo","Set command for test01 channel 3")),
(("X393_MCNTRL_TEST01_CHN4_MODE",c,vrlg.MCNTRL_TEST01_CHN4_MODE+ba,0,None,"x393_test01_mode_wo","Set command for test01 channel 4")),
]
#read_all_status
ba=vrlg.STATUS_ADDR
ia=0
c=""
sdefines+=[
(('Read-only addresses for status information',)),
(("X393_MCONTR_PHY_STATUS",c,vrlg.MCONTR_PHY_STATUS_REG_ADDR+ba,0,None,"x393_status_mcntrl_phy_ro","Status register for MCNTRL PHY")),
(("X393_MCONTR_TOP_STATUS",c,vrlg.MCONTR_TOP_STATUS_REG_ADDR+ba,0,None,"x393_status_mcntrl_top_ro","Status register for MCNTRL requests")),
(("X393_MCNTRL_PS_STATUS",c,vrlg.MCNTRL_PS_STATUS_REG_ADDR+ba,0,None,"x393_status_mcntrl_ps_ro","Status register for MCNTRL software R/W")),
(("X393_MCNTRL_CHN1_STATUS",c,vrlg.MCNTRL_SCANLINE_STATUS_REG_CHN1_ADDR+ba,0,None,"x393_status_mcntrl_lintile_ro","Status register for MCNTRL CHN1 (membridge)")),
(("X393_MCNTRL_CHN3_STATUS",c,vrlg.MCNTRL_SCANLINE_STATUS_REG_CHN3_ADDR+ba,0,None,"x393_status_mcntrl_lintile_ro","Status register for MCNTRL CHN3 (scanline)")),
(("X393_MCNTRL_CHN2_STATUS",c,vrlg.MCNTRL_TILED_STATUS_REG_CHN2_ADDR+ba,0,None,"x393_status_mcntrl_lintile_ro","Status register for MCNTRL CHN2 (tiled)")),
(("X393_MCNTRL_CHN4_STATUS",c,vrlg.MCNTRL_TILED_STATUS_REG_CHN4_ADDR+ba,0,None,"x393_status_mcntrl_lintile_ro","Status register for MCNTRL CHN4 (tiled)")),
(("X393_TEST01_CHN2_STATUS",c,vrlg.MCNTRL_TEST01_STATUS_REG_CHN2_ADDR+ba,0,None,"x393_status_mcntrl_testchn_ro","Status register for test channel 2")),
(("X393_TEST01_CHN3_STATUS",c,vrlg.MCNTRL_TEST01_STATUS_REG_CHN3_ADDR+ba,0,None,"x393_status_mcntrl_testchn_ro","Status register for test channel 3")),
(("X393_TEST01_CHN4_STATUS",c,vrlg.MCNTRL_TEST01_STATUS_REG_CHN4_ADDR+ba,0,None,"x393_status_mcntrl_testchn_ro","Status register for test channel 4")),
(("X393_MEMBRIDGE_STATUS",c,vrlg.MEMBRIDGE_STATUS_REG+ba,0,None,"x393_status_membridge_ro","Status register for membridge")),
(('Read-only addresses for sensors status information',)),
(("X393_SENSI2C_STATUS",c,vrlg.SENSI2C_STATUS_REG_REL+ba,ia,z3,"x393_status_sens_i2c_ro","Status of the sensors i2c")),
(("X393_SENSIO_STATUS",c,vrlg.SENSIO_STATUS_REG_REL+ba,ia,z3,"x393_status_sens_io_ro","Status of the sensor ports I/O pins")),
]
"""
"""
returnsdefines
defdefine_other_macros(self):# Used mostly for development/testing, not needed for normal camera operation
ba=vrlg.MCNTRL_SCANLINE_CHN3_ADDR
c=""
sdefines=[]
sdefines+=[
(('Write-only addresses to program memory channel 3 (test channel)',)),
(("X393_MCNTRL_CHN3_SCANLINE_MODE",c,vrlg.MCNTRL_SCANLINE_MODE+ba,0,None,"x393_mcntrl_mode_scan_wo","Set mode register (write last after other channel registers are set)")),
(("X393_MCNTRL_CHN3_SCANLINE_STATUS_CNTRL",c,vrlg.MCNTRL_SCANLINE_STATUS_CNTRL+ba,0,None,"x393_status_ctrl_wo","Set status control register (status update mode)")),
(("X393_MCNTRL_CHN3_SCANLINE_FRAME_LAST",c,vrlg.MCNTRL_SCANLINE_FRAME_LAST+ba,0,None,"x393_mcntrl_window_last_frame_num_wo","Set last frame number (number of frames in buffer minus 1)")),
(('Write-only addresses to program memory channel 2 (test channel)',)),
(("X393_MCNTRL_CHN2_TILED_MODE",c,vrlg.MCNTRL_TILED_MODE+ba,0,None,"x393_mcntrl_mode_scan_wo","Set mode register (write last after other channel registers are set)")),
(("X393_MCNTRL_CHN2_TILED_STATUS_CNTRL",c,vrlg.MCNTRL_TILED_STATUS_CNTRL+ba,0,None,"x393_status_ctrl_wo","Set status control register (status update mode)")),
(("X393_MCNTRL_CHN2_TILED_FRAME_LAST",c,vrlg.MCNTRL_TILED_FRAME_LAST+ba,0,None,"x393_mcntrl_window_last_frame_num_wo","Set last frame number (number of frames in buffer minus 1)")),
(('Write-only addresses to program memory channel 4 (test channel)',)),
(("X393_MCNTRL_CHN4_TILED_MODE",c,vrlg.MCNTRL_TILED_MODE+ba,0,None,"x393_mcntrl_mode_scan_wo","Set mode register (write last after other channel registers are set)")),
(("X393_MCNTRL_CHN4_TILED_STATUS_CNTRL",c,vrlg.MCNTRL_TILED_STATUS_CNTRL+ba,0,None,"x393_status_ctrl_wo","Set status control register (status update mode)")),
(("X393_MCNTRL_CHN4_TILED_FRAME_LAST",c,vrlg.MCNTRL_TILED_FRAME_LAST+ba,0,None,"x393_mcntrl_window_last_frame_num_wo","Set last frame number (number of frames in buffer minus 1)")),
dw.append(("chn_nreset",vrlg.MCONTR_LINTILE_EN,1,1,"0: immediately reset all the internal circuitry"))
dw.append(("enable",vrlg.MCONTR_LINTILE_NRESET,1,1,"enable requests from this channel ( 0 will let current to finish, but not raise want/need)"))
dw.append(("write_mem",vrlg.MCONTR_LINTILE_WRITE,1,0,"0 - read from memory, 1 - write to memory"))
dw.append(("extra_pages",vrlg.MCONTR_LINTILE_EXTRAPG,vrlg.MCONTR_LINTILE_EXTRAPG_BITS,0,"2-bit number of extra pages that need to stay (not to be overwritten) in the buffer"))
dw.append(("keep_open",vrlg.MCONTR_LINTILE_KEEP_OPEN,1,0,"for 8 or less rows - do not close page between accesses (not used in scanline mode)"))
dw.append(("byte32",vrlg.MCONTR_LINTILE_BYTE32,1,1,"32-byte columns (0 - 16-byte), not used in scanline mode"))