📄 imx-regs.h
字号:
#define PD19_PF_LD4 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 19 )#define PD20_PF_LD5 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 20 )#define PD21_PF_LD6 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 21 )#define PD22_PF_LD7 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 22 )#define PD23_PF_LD8 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 23 )#define PD24_PF_LD9 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 24 )#define PD25_PF_LD10 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 25 )#define PD26_PF_LD11 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 26 )#define PD27_PF_LD12 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 27 )#define PD28_PF_LD13 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 28 )#define PD29_PF_LD14 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 29 )#define PD30_PF_LD15 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 30 )#define PD31_PF_TMR2OUT ( GPIO_PORTD | GPIO_PF | 31 )#define PD31_BIN_SPI2_TXD ( GPIO_GIUS | GPIO_PORTD | GPIO_BIN | 31 )/* * PWM controller */#define PWMC __REG(IMX_PWM_BASE + 0x00) /* PWM Control Register */#define PWMS __REG(IMX_PWM_BASE + 0x04) /* PWM Sample Register */#define PWMP __REG(IMX_PWM_BASE + 0x08) /* PWM Period Register */#define PWMCNT __REG(IMX_PWM_BASE + 0x0C) /* PWM Counter Register */#define PWMC_HCTR (0x01<<18) /* Halfword FIFO Data Swapping */#define PWMC_BCTR (0x01<<17) /* Byte FIFO Data Swapping */#define PWMC_SWR (0x01<<16) /* Software Reset */#define PWMC_CLKSRC (0x01<<15) /* Clock Source */#define PWMC_PRESCALER(x) (((x-1) & 0x7F) << 8) /* PRESCALER */#define PWMC_IRQ (0x01<< 7) /* Interrupt Request */#define PWMC_IRQEN (0x01<< 6) /* Interrupt Request Enable */#define PWMC_FIFOAV (0x01<< 5) /* FIFO Available */#define PWMC_EN (0x01<< 4) /* Enables/Disables the PWM */#define PWMC_REPEAT(x) (((x) & 0x03) << 2) /* Sample Repeats */#define PWMC_CLKSEL(x) (((x) & 0x03) << 0) /* Clock Selection */#define PWMS_SAMPLE(x) ((x) & 0xFFFF) /* Contains a two-sample word */#define PWMP_PERIOD(x) ((x) & 0xFFFF) /* Represents the PWM's period */#define PWMC_COUNTER(x) ((x) & 0xFFFF) /* Represents the current count value *//* * DMA Controller */#define DCR __REG(IMX_DMAC_BASE +0x00) /* DMA Control Register */#define DISR __REG(IMX_DMAC_BASE +0x04) /* DMA Interrupt status Register */#define DIMR __REG(IMX_DMAC_BASE +0x08) /* DMA Interrupt mask Register */#define DBTOSR __REG(IMX_DMAC_BASE +0x0c) /* DMA Burst timeout status Register */#define DRTOSR __REG(IMX_DMAC_BASE +0x10) /* DMA Request timeout Register */#define DSESR __REG(IMX_DMAC_BASE +0x14) /* DMA Transfer Error Status Register */#define DBOSR __REG(IMX_DMAC_BASE +0x18) /* DMA Buffer overflow status Register */#define DBTOCR __REG(IMX_DMAC_BASE +0x1c) /* DMA Burst timeout control Register */#define WSRA __REG(IMX_DMAC_BASE +0x40) /* W-Size Register A */#define XSRA __REG(IMX_DMAC_BASE +0x44) /* X-Size Register A */#define YSRA __REG(IMX_DMAC_BASE +0x48) /* Y-Size Register A */#define WSRB __REG(IMX_DMAC_BASE +0x4c) /* W-Size Register B */#define XSRB __REG(IMX_DMAC_BASE +0x50) /* X-Size Register B */#define YSRB __REG(IMX_DMAC_BASE +0x54) /* Y-Size Register B */#define SAR(x) __REG2( IMX_DMAC_BASE + 0x80, (x) << 6) /* Source Address Registers */#define DAR(x) __REG2( IMX_DMAC_BASE + 0x84, (x) << 6) /* Destination Address Registers */#define CNTR(x) __REG2( IMX_DMAC_BASE + 0x88, (x) << 6) /* Count Registers */#define CCR(x) __REG2( IMX_DMAC_BASE + 0x8c, (x) << 6) /* Control Registers */#define RSSR(x) __REG2( IMX_DMAC_BASE + 0x90, (x) << 6) /* Request source select Registers */#define BLR(x) __REG2( IMX_DMAC_BASE + 0x94, (x) << 6) /* Burst length Registers */#define RTOR(x) __REG2( IMX_DMAC_BASE + 0x98, (x) << 6) /* Request timeout Registers */#define BUCR(x) __REG2( IMX_DMAC_BASE + 0x98, (x) << 6) /* Bus Utilization Registers */#define DCR_DRST (1<<1)#define DCR_DEN (1<<0)#define DBTOCR_EN (1<<15)#define DBTOCR_CNT(x) ((x) & 0x7fff )#define CNTR_CNT(x) ((x) & 0xffffff )#define CCR_DMOD_LINEAR ( 0x0 << 12 )#define CCR_DMOD_2D ( 0x1 << 12 )#define CCR_DMOD_FIFO ( 0x2 << 12 )#define CCR_DMOD_EOBFIFO ( 0x3 << 12 )#define CCR_SMOD_LINEAR ( 0x0 << 10 )#define CCR_SMOD_2D ( 0x1 << 10 )#define CCR_SMOD_FIFO ( 0x2 << 10 )#define CCR_SMOD_EOBFIFO ( 0x3 << 10 )#define CCR_MDIR_DEC (1<<9)#define CCR_MSEL_B (1<<8)#define CCR_DSIZ_32 ( 0x0 << 6 )#define CCR_DSIZ_8 ( 0x1 << 6 )#define CCR_DSIZ_16 ( 0x2 << 6 )#define CCR_SSIZ_32 ( 0x0 << 4 )#define CCR_SSIZ_8 ( 0x1 << 4 )#define CCR_SSIZ_16 ( 0x2 << 4 )#define CCR_REN (1<<3)#define CCR_RPT (1<<2)#define CCR_FRC (1<<1)#define CCR_CEN (1<<0)#define RTOR_EN (1<<15)#define RTOR_CLK (1<<14)#define RTOR_PSC (1<<13)/* * Interrupt controller */#define IMX_INTCNTL __REG(IMX_AITC_BASE+0x00)#define INTCNTL_FIAD (1<<19)#define INTCNTL_NIAD (1<<20)#define IMX_NIMASK __REG(IMX_AITC_BASE+0x04)#define IMX_INTENNUM __REG(IMX_AITC_BASE+0x08)#define IMX_INTDISNUM __REG(IMX_AITC_BASE+0x0c)#define IMX_INTENABLEH __REG(IMX_AITC_BASE+0x10)#define IMX_INTENABLEL __REG(IMX_AITC_BASE+0x14)/* * General purpose timers */#define IMX_TCTL(x) __REG( 0x00 + (x))#define TCTL_SWR (1<<15)#define TCTL_FRR (1<<8)#define TCTL_CAP_RIS (1<<6)#define TCTL_CAP_FAL (2<<6)#define TCTL_CAP_RIS_FAL (3<<6)#define TCTL_OM (1<<5)#define TCTL_IRQEN (1<<4)#define TCTL_CLK_PCLK1 (1<<1)#define TCTL_CLK_PCLK1_16 (2<<1)#define TCTL_CLK_TIN (3<<1)#define TCTL_CLK_32 (4<<1)#define TCTL_TEN (1<<0)#define IMX_TPRER(x) __REG( 0x04 + (x))#define IMX_TCMP(x) __REG( 0x08 + (x))#define IMX_TCR(x) __REG( 0x0C + (x))#define IMX_TCN(x) __REG( 0x10 + (x))#define IMX_TSTAT(x) __REG( 0x14 + (x))#define TSTAT_CAPT (1<<1)#define TSTAT_COMP (1<<0)/* * LCD Controller */#define LCDC_SSA __REG(IMX_LCDC_BASE+0x00)#define LCDC_SIZE __REG(IMX_LCDC_BASE+0x04)#define SIZE_XMAX(x) ((((x) >> 4) & 0x3f) << 20)#define SIZE_YMAX(y) ( (y) & 0x1ff )#define LCDC_VPW __REG(IMX_LCDC_BASE+0x08)#define VPW_VPW(x) ( (x) & 0x3ff )#define LCDC_CPOS __REG(IMX_LCDC_BASE+0x0C)#define CPOS_CC1 (1<<31)#define CPOS_CC0 (1<<30)#define CPOS_OP (1<<28)#define CPOS_CXP(x) (((x) & 3ff) << 16)#define CPOS_CYP(y) ((y) & 0x1ff)#define LCDC_LCWHB __REG(IMX_LCDC_BASE+0x10)#define LCWHB_BK_EN (1<<31)#define LCWHB_CW(w) (((w) & 0x1f) << 24)#define LCWHB_CH(h) (((h) & 0x1f) << 16)#define LCWHB_BD(x) ((x) & 0xff)#define LCDC_LCHCC __REG(IMX_LCDC_BASE+0x14)#define LCHCC_CUR_COL_R(r) (((r) & 0x1f) << 11)#define LCHCC_CUR_COL_G(g) (((g) & 0x3f) << 5)#define LCHCC_CUR_COL_B(b) ((b) & 0x1f)#define LCDC_PCR __REG(IMX_LCDC_BASE+0x18)#define PCR_TFT (1<<31)#define PCR_COLOR (1<<30)#define PCR_PBSIZ_1 (0<<28)#define PCR_PBSIZ_2 (1<<28)#define PCR_PBSIZ_4 (2<<28)#define PCR_PBSIZ_8 (3<<28)#define PCR_BPIX_1 (0<<25)#define PCR_BPIX_2 (1<<25)#define PCR_BPIX_4 (2<<25)#define PCR_BPIX_8 (3<<25)#define PCR_BPIX_12 (4<<25)#define PCR_BPIX_16 (4<<25)#define PCR_PIXPOL (1<<24)#define PCR_FLMPOL (1<<23)#define PCR_LPPOL (1<<22)#define PCR_CLKPOL (1<<21)#define PCR_OEPOL (1<<20)#define PCR_SCLKIDLE (1<<19)#define PCR_END_SEL (1<<18)#define PCR_END_BYTE_SWAP (1<<17)#define PCR_REV_VS (1<<16)#define PCR_ACD_SEL (1<<15)#define PCR_ACD(x) (((x) & 0x7f) << 8)#define PCR_SCLK_SEL (1<<7)#define PCR_SHARP (1<<6)#define PCR_PCD(x) ((x) & 0x3f)#define LCDC_HCR __REG(IMX_LCDC_BASE+0x1C)#define HCR_H_WIDTH(x) (((x) & 0x3f) << 26)#define HCR_H_WAIT_1(x) (((x) & 0xff) << 8)#define HCR_H_WAIT_2(x) ((x) & 0xff)#define LCDC_VCR __REG(IMX_LCDC_BASE+0x20)#define VCR_V_WIDTH(x) (((x) & 0x3f) << 26)#define VCR_V_WAIT_1(x) (((x) & 0xff) << 8)#define VCR_V_WAIT_2(x) ((x) & 0xff)#define LCDC_POS __REG(IMX_LCDC_BASE+0x24)#define POS_POS(x) ((x) & 1f)#define LCDC_LSCR1 __REG(IMX_LCDC_BASE+0x28)#define LSCR1_PS_RISE_DELAY(x) (((x) & 0x7f) << 26)#define LSCR1_CLS_RISE_DELAY(x) (((x) & 0x3f) << 16)#define LSCR1_REV_TOGGLE_DELAY(x) (((x) & 0xf) << 8)#define LSCR1_GRAY2(x) (((x) & 0xf) << 4)#define LSCR1_GRAY1(x) (((x) & 0xf))#define LCDC_PWMR __REG(IMX_LCDC_BASE+0x2C)#define PWMR_CLS(x) (((x) & 0x1ff) << 16)#define PWMR_LDMSK (1<<15)#define PWMR_SCR1 (1<<10)#define PWMR_SCR0 (1<<9)#define PWMR_CC_EN (1<<8)#define PWMR_PW(x) ((x) & 0xff)#define LCDC_DMACR __REG(IMX_LCDC_BASE+0x30)#define DMACR_BURST (1<<31)#define DMACR_HM(x) (((x) & 0xf) << 16)#define DMACR_TM(x) ((x) &0xf)#define LCDC_RMCR __REG(IMX_LCDC_BASE+0x34)#define RMCR_LCDC_EN (1<<1)#define RMCR_SELF_REF (1<<0)#define LCDC_LCDICR __REG(IMX_LCDC_BASE+0x38)#define LCDICR_INT_SYN (1<<2)#define LCDICR_INT_CON (1)#define LCDC_LCDISR __REG(IMX_LCDC_BASE+0x40)#define LCDISR_UDR_ERR (1<<3)#define LCDISR_ERR_RES (1<<2)#define LCDISR_EOF (1<<1)#define LCDISR_BOF (1<<0)#endif // _IMX_REGS_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -