📄 ms_reg.h
字号:
#ifndef MS_REG_H
#define MS_REG_H
typedef enum msbus_direction
{ MS_WRITE,
MS_READ
} msBus_Direction;
//#define GIOTTO 1
//#define DEGAS 1
// Register Bank Select
#define REGBK 0x00
#define PORR BIT7
#define BUST BIT6
#define AINC BIT3
#define REGBANK_MASK 0x7
#define REGBANKSCALER 0x0 //Scaler Bank
#define REGBANKADC 0x1 // ADC Bank
#define REGBANKTCON 0x2 // TCON Bank
#define REGBANKPIP 0x3 // PIP Bank
#define REGBANKMIU 0x4 // MIU Bank
#define cScalerBank 0x00 // Scaler Bank
#define cMIUBank 0x04
#define cVBIBank 0x06 // VBI Bank
#define cDecoderBank 0x07 // Decoder Bank
// Bank = 01
// Double buffer control
#define DBFC 0x01 // enable dobule buffer while vertical blanking
#define DBC_B BIT0
#define DBL_0 0
#define DBL_1 2
#define DBL_2 4
#define DBL_3 6
//PLL Divider control
#define PLLDIVM 0x02 // PLL divider (HTotal)
#define PLLDIVL 0x03
// input Gain
#define REDGAIN 0x04
#define GRNGAIN 0x05
#define BLUGAIN 0x06
// input Offset
#define REDOFST 0x07
#define GRNOFST 0x08
#define BLUOFST 0x09
// Clamp Timing
#define CLPLACE 0x0A // clamping placement
#define CLDUR 0x0B // clamping duration
// General Control
#define GCTRL 0x0C
#define DRBS BIT0 // DVI R/B swap
#define CSTP BIT1 // Coast polarity 1(d)/0 = H/L
#define WDIS BIT2 // disable pll watchdog timer
#define CCDIS BIT3 // disable clamp during active coast
#define CLPE BIT4 // Clamping edge 0/1= leading/trailing
#define HSLE BIT5 // hsync lock edge 0/1=leading/trailing
#define ECLK BIT6 // internal/external clcok
#define HSP_B BIT7 // Hsync Polarity 1/0 = H/L
// PLL coefficient
#define BWCOEF 0x0D
#define FCOEF 0x0E
#define DCOEF 0x0F
//Clock Phase control
#define CLKCTRL1 0x10
#define CLKCTRL2 0x11
// VCO control
#define VCOCTRL 0x12
// Power management
#define RT_CTL 0x13
// SOG/HSYNC programming levle
#define SOG_LVL 0x14
#define HS_LVL 0x15
#define RT_STATUS1 0x17
#define RT_STATUS2 0x18
#define PHR_STATUS1 0x19
#define PHR_STATUS2 0x1A
#define DVI_PHR 0x1B
#define DVI_PHG 0x1C
#define DVI_PHB 0x1D
#define DVI_ERST 0x1E
#define DVI_ERTH 0x1F
#define TESTEN 0x20
#define PLLCTRLV 0x30
// Bank = 00
// Graphic Port
#define ISELECT 0x02
#define IHSU_B BIT2
#define CSC_B BIT3
#define COMP_B BIT4
#define NIS_B BIT7
#define STYPE_Mask 0x60
#define ISEL_Mask 0xFC
#define ISEL_Analog1 0x00
#define ISEL_Analog2 0x01
#define ISEL_DVI 0x02
#define ISEL_Video 0x03
#define IPCTRL2 0x04
#define HWRP_B BIT0 // input horizontal wrap
#define VWRP_B BIT1 // input vertical wrap
#define ESLS_B BIT2 // early sample line select
#define VSE_B BIT3 // input vsync reference edge
#define HSE_B BIT4 // input hsync reference edge
#define IVSD_B BIT5 // vsync delay select
#define DEON_B BIT6 // DE only
#define DHSR_B BIT7 // Digital input horizontal range
// Input image sample range
#define SPRVST_L 0x05 // V-start
#define SPRVST_H 0x06
#define SPRHST_L 0x07 // H-start
#define SPRHST_H 0x08
#define SPRVDC_L 0x09 // V-
#define SPRVDC_H 0x0A
#define SPRHDC_L 0x0B // H-D
#define SPRHDC_H 0x0C
#define DVCTRL 0x0D
#define MLSWP_B BIT0 // MSB/LSB swap
#define YCSWP_B BIT1 // Y/C swap
#define FVDM_B BIT7 // Force VD count adjustment Mode
#define LVL 0x0F // Lock Y line
//Display Timing
#define DEVST_L 0x10 // V-start
#define DEVST_H 0x11
#define DEHST_L 0x12 // h start
#define DEHST_H 0x13
#define DEVEND_L 0x14 // v end
#define DEVEND_H 0x15
#define DEHEND_L 0x16 // h end
#define DEHEND_H 0x17
// scale image window size
#define SIHST_L 0x18
#define SIHST_H 0x19
#define SIVEND_L 0x1A
#define SIVEND_H 0x1B
#define SIHEND_L 0x1C
#define SIHEND_H 0x1D
//output sync timing
#define VDTOT_L 0x1E
#define VDTOT_H 0x1F
#define VSST_L 0x20
#define VSST_H 0x21
#define VSEND_L 0x22
#define VSEND_H 0x23
#define HDTOT_L 0x24
#define HDTOT_H 0x25
#define HSEND 0x26
// output sync control
#define OSCCTRL1 0x27
#define CTRL_B BIT0
#define AHRT_B BIT1
#define MOD2_B BIT2
#define EHTT_B BIT3
#define VSGP_B BIT4
#define HSRM_B BIT5
#define LCM_B BIT6
#define AVOS_B BIT7
#define OSCCTRL2 0x28
#define CRM_B BIT0
#define SLE_B BIT1
#define ATEN2_B BIT5
// background color
#define FWC 0x32
#define FWC_B BIT0 // border color on/off
#define FCR 0x33
#define FCG 0x34
#define FCB 0x35
// Dither control
#define DITHCTRL 0x36
#define DITH_B BIT0 // enable dither function
#define OBN_B BIT1 // Output Bit number 0/1:8/6
#define TROT_B BIT2 // temporal coefficient rotate
#define SROT_B BIT3 // Spatial Coefficient Rotate
#define DITHG_BM 0x30
#define DITHG_GM 0xC0
#define DITHCOEF 0x37
#define TRFN 0x38
// Peaking control
#define MPPCTRL 0x3B
#define MVEN_B BIT0
#define MPEN_B BIT1
#define MLEN_B BIT2
#define MCEN_B BIT3
#define MLME_B BIT4
#define MCME_B BIT5
#define MCORING 0x3C
#define MCTI 0x3D
#define MLTI 0x3E
#define M_PEAL 0x3F
// gamma control
#define GAMMAC 0x40
#define GCFE_B BIT0 // enable gamma function
#define GCIO_B BIT1 // enable gamme I/O access
#define GAMMAP 0x41
//output control
#define OCTRL1 0x42
#define ERBX_B BIT0
#define ORBX_B BIT1
#define EMLX_B BIT2
#define OMLX_B BIT3
#define LTIM_B BIT4
#define MLXT_B BIT5
#define OCTRL2 0x43
#define DPO_B BIT0 // Dual output
#define DPX_B BIT1 // switch output A, B
#define STO_B BIT2 // stag
#define REV_B BIT3 // revser luminosity
#define BLKS_B BIT4 // black background
#define WHTS_B BIT5 // white
#define DOT_B BIT6 // differential output
#define TCOP_B BIT7 // tcon control
#define OCTRL3 0x44
#define ENRT_B BIT0 // enr TG
#define ENRL_B BIT1 // enr TLRG
#define END_B BIT2 // end TRG
#define ENU_B BIT3 // enu TRG
#define PMOD BIT7 // Power down MOD
//osd alpha blending control
#define BLENDC 0x4B
#define BLENDL 0x4C
// scaling ratio
#define SRH_L 0x50
#define SRH_M 0x51
#define SRH_H 0x52
#define SENH_B BIT7 // Enable Horizontal scaling
#define SRV_L 0x53
#define SRV_M 0x54
#define SRV_H 0x55
#define SENV_B BIT7 // Enable Vertical scaling
// scaling filter control
#define SFH 0x56
#define SFV 0x57
#define HDSUSG 0x58
#define HDSUSL 0x59
#define VDSUSG 0x5A
#define VDSUSL 0x5B
// Color Matrix Coefficient
#define CM11_L 0x5E
#define CM11_H 0x5F
#define CM12_L 0x60
#define CM12_H 0x61
#define CM13_L 0x62
#define CM13_H 0x63
#define CM21_L 0x64
#define CM21_H 0x65
#define CM22_L 0x66
#define CM22_H 0x67
#define CM23_L 0x68
#define CM23_h 0x69
#define CM31_L 0x6A
#define CM31_h 0x6B
#define CM32_L 0x6C
#define CM32_H 0x6D
#define CM33_L 0x6E
#define CM33_H 0x6F
// Color Matrix Control
#define CMCTL 0x70
#define CMC_B BIT4
#define RRAN_B BIT2
#define GRAN_B BIT1
#define BRAN_B BIT0
//brightness control
#define BRC 0x71
#define BRC_B BIT0 // enable brightness function
#define BCR 0x72
#define BCG 0x73
#define BCB 0x74
// interlaced mode line shift
#define INTMDS 0x75 //
#define SSFD_B BIT7 // Sub Window Shift Field
#define MSFD_B BIT3 // Main Window Shift Field
// auto gain function adjust
#define ATGCTRL 0x78
#define ATGE_B BIT0
#define ATGR_B BIT1
#define MAXB_B BIT5
#define MAXG_B BIT6
#define MAXR_B BIT7
#define ATGST 0x79
#define MINB_B BIT0
#define MING_B BIT1
#define MINR_B BIT2
#define ATGVSEL 0x7A
#define ATGVALUE 0x7D
//Auto position function and jitter function
#define ATOCTRL 0x7B
#define ATOE_B BIT0
#define ATOR_B BIT1
#define AOVDV 0x7C
// auto position function result
#define AOVST_L 0x7E
#define AOVST_H 0x7F
#define AOHST_L 0x80
#define AOHST_H 0x81
#define AOVEND_L 0x82
#define AOVEND_H 0x83
#define AOHEND_L 0x84
#define AOHEND_H 0x85
// jitter detecting result
#define JLR_L 0x86
#define JLR_H 0x87
// Auto phase
#define ATPTH 0x8A
#define ATPCTRL 0x8B
#define ATPE_B BIT0
#define ATPR_B BIT1
#define ATPV1 0x8C
#define ATPV2 0x8D
#define ATPV3 0x8E
#define ATPV4 0x8F
#define ASCTRL 0x90
#define OVER_B BIT0 // Over run status
#define UNDER_B BIT1 // Under run status
#define IVB_B BIT7 // Input VSync Blanking Staus
#define LSLVP_L 0x91 // Locking short line vertical position.
#define LSLW_L 0x93 // Locking short line width.
#define LVSST 0x95 // Llocking Vertical total line number
#define LHSST 0x97 // Llocking Horizontal total line number
#define LFRST_L 0x99 // locking fraction status
#define LFRST_H 0x9A
#define LHMARGIN 0x9B // Locking htotal margin
#define LRSV_L 0x9C // Locking read start value
#define LRSV_H 0x9D //
#define LSMARGIN 0x9E // Locking SSC margin
////////////////////////// osd control ///////////////////////////////
// OSD i/o access
#define OSDIOA 0xA0
#define OWEND_B BIT7 // OSD Write End
#define OSDWCODE 0x10 // OSD Write Code
#define OSDWATTR 0x20 // OSD Write Attribute
#define OSDWMFONT 0x30 // OSD Write Mono Font
#define OSDWCFONT 0x40 // OSD Write Mono Font
#define OSDWTFONT 0x50 // OSD Write Texture Font
#define OSDREAD 0x60 // CPU Read
#define cWriteCode 0x10
#define cWriteAttribute 0x20
#define cCpuWrite 0x20
#define cWriteMonoFont 0x30
#define cWriteColorFont 0x40
#define cCpuRead 0x60
#define OSBM BIT3 // OSD I/O Acess Burst mode
#define DP BIT2 // OSD Palette I/O Acess
#define ORBW BIT1 // OSD Register Burst Mode
// osd address/data port
#define OSDRA 0xA1
#define OSDRD 0xA2
// osd ram font address/data port
#define RAMFA 0xA3
#define RAMFD 0xA4
// osd display code address/data port
#define DISPCA_L 0xA5
#define DISPCA_H 0xA6
#define DISPCD 0xA7
// osd display attribute address/data port
#define DISPAA_L 0xA8
#define DISPAA_H 0xA9
#define DISPAD 0xAA
#define WFIFOSTS 0xAB
#define FOVL BIT2
#define FFULL BIT1
#define FEMP BIT0
#define CLRPA 0xAC
#define CLRPC 0xAD
#define DISPCDE 0xAE
#define CUDL BIT7
#define CBLK BIT6
#define TXTU BIT4
#define CEB BIT3
#define DISPADE 0xAF
// i/o and pwm
// DDC control
#define DDCCTRL 0xB3
#define DDCEN1 0xB4
#define D_EN_B BIT7
#define DDC_LAST1 0xB5
#define DDCADDR 0xB6
#define DDCDATA 0xB7
#define DDCEN2 0xB8
#define DDC_LAST2 0xB9
#define DDCADDR2 0xBA
#define DDCDATA2 0xBB
// output and pwm control
#define MISCFC 0xBC
#define GOUTV 0xBD
// pwm control
#define PWMCLK 0xC2
#define PWM0C 0xC3
#define PWM1C 0xC4
#define PWM0F 0xC5
#define PWM1F 0xC6
#define PWM2C 0xC7
#define PWM2F 0xC8
// interrupt control
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -