共2条
1/1 1 跳转至页
S3C44B0 求助:请各位大大帮我看看这个问题(S3C44B0),谢谢!
问
请教:
在 option.h 里
#define _ISR_STARTADDRESS 0xc7fff00
S3C44B0 的 44B.H 的程序如下:
#define rLOCKTIME (*(volatile unsigned *)0x1d8000c)
/* INTERRUPT */
#define rINTCON (*(volatile unsigned *)0x1e00000)
#define rINTPND (*(volatile unsigned *)0x1e00004)
#define rINTMOD (*(volatile unsigned *)0x1e00008)
#define rINTMSK (*(volatile unsigned *)0x1e0000c)
#define rI_PSLV (*(volatile unsigned *)0x1e00010)
#define rI_PMST (*(volatile unsigned *)0x1e00014)
#define rI_CSLV (*(volatile unsigned *)0x1e00018)
#define rI_CMST (*(volatile unsigned *)0x1e0001c)
#define rI_ISPR (*(volatile unsigned *)0x1e00020)
#define rI_ISPC (*(volatile unsigned *)0x1e00024)
#define rF_ISPR (*(volatile unsigned *)0x1e00038)
#define rF_ISPC (*(volatile unsigned *)0x1e0003c)
/* LCD */
#define rLCDCON1 (*(volatile unsigned *)0x1f00000)
#define rLCDCON2 (*(volatile unsigned *)0x1f00004)
#define rLCDCON3 (*(volatile unsigned *)0x1f00040)
#define rLCDSADDR1 (*(volatile unsigned *)0x1f00008)
#define rLCDSADDR2 (*(volatile unsigned *)0x1f0000c)
#define rLCDSADDR3 (*(volatile unsigned *)0x1f00010)
#define rREDLUT (*(volatile unsigned *)0x1f00014)
#define rGREENLUT (*(volatile unsigned *)0x1f00018)
#define rBLUELUT (*(volatile unsigned *)0x1f0001c)
#define rDP1_2 (*(volatile unsigned *)0x1f00020)
#define rDP4_7 (*(volatile unsigned *)0x1f00024)
#define rDP3_5 (*(volatile unsigned *)0x1f00028)
#define rDP2_3 (*(volatile unsigned *)0x1f0002c)
#define rDP5_7 (*(volatile unsigned *)0x1f00030)
#define rDP3_4 (*(volatile unsigned *)0x1f00034)
#define rDP4_5 (*(volatile unsigned *)0x1f00038)
#define rDP6_7 (*(volatile unsigned *)0x1f0003c)
#define rDITHMODE (*(volatile unsigned *)0x1f00044)
/* ZDMA0 */
#define rZDCON0 (*(volatile unsigned *)0x1e80000)
#define rZDISRC0 (*(volatile unsigned *)0x1e80004)
#define rZDIDES0 (*(volatile unsigned *)0x1e80008)
#define rZDICNT0 (*(volatile unsigned *)0x1e8000c)
#define rZDCSRC0 (*(volatile unsigned *)0x1e80010)
#define rZDCDES0 (*(volatile unsigned *)0x1e80014)
#define rZDCCNT0 (*(volatile unsigned *)0x1e80018)
/* ZDMA1 */
#define rZDCON1 (*(volatile unsigned *)0x1e80020)
#define rZDISRC1 (*(volatile unsigned *)0x1e80024)
#define rZDIDES1 (*(volatile unsigned *)0x1e80028)
#define rZDICNT1 (*(volatile unsigned *)0x1e8002c)
#define rZDCSRC1 (*(volatile unsigned *)0x1e80030)
#define rZDCDES1 (*(volatile unsigned *)0x1e80034)
#define rZDCCNT1 (*(volatile unsigned *)0x1e80038)
/* BDMA0 */
#define rBDCON0 (*(volatile unsigned *)0x1f80000)
#define rBDISRC0 (*(volatile unsigned *)0x1f80004)
#define rBDIDES0 (*(volatile unsigned *)0x1f80008)
#define rBDICNT0 (*(volatile unsigned *)0x1f8000c)
#define rBDCSRC0 (*(volatile unsigned *)0x1f80010)
#define rBDCDES0 (*(volatile unsigned *)0x1f80014)
#define rBDCCNT0 (*(volatile unsigned *)0x1f80018)
/* BDMA1 */
#define rBDCON1 (*(volatile unsigned *)0x1f80020)
#define rBDISRC1 (*(volatile unsigned *)0x1f80024)
#define rBDIDES1 (*(volatile unsigned *)0x1f80028)
#define rBDICNT1 (*(volatile unsigned *)0x1f8002c)
#define rBDCSRC1 (*(volatile unsigned *)0x1f80030)
#define rBDCDES1 (*(volatile unsigned *)0x1f80034)
#define rBDCCNT1 (*(volatile unsigned *)0x1f80038)
/* ISR */
#define pISR_RESET (*(unsigned *)(_ISR_STARTADDRESS+0x0))
#define pISR_UNDEF (*(unsigned *)(_ISR_STARTADDRESS+0x4))
#define pISR_SWI (*(unsigned *)(_ISR_STARTADDRESS+0x8))
#define pISR_PABORT (*(unsigned *)(_ISR_STARTADDRESS+0xc))
#define pISR_DABORT (*(unsigned *)(_ISR_STARTADDRESS+0x10))
#define pISR_RESERVED (*(unsigned *)(_ISR_STARTADDRESS+0x14))
#define pISR_IRQ (*(unsigned *)(_ISR_STARTADDRESS+0x18))
#define pISR_FIQ (*(unsigned *)(_ISR_STARTADDRESS+0x1c))
#define pISR_ADC (*(unsigned *)(_ISR_STARTADDRESS+0x20))
#define pISR_RTC (*(unsigned *)(_ISR_STARTADDRESS+0x24))
#define pISR_UTXD1 (*(unsigned *)(_ISR_STARTADDRESS+0x28))
#define pISR_UTXD0 (*(unsigned *)(_ISR_STARTADDRESS+0x2c))
#define pISR_SIO (*(unsigned *)(_ISR_STARTADDRESS+0x30))
#define pISR_IIC (*(unsigned *)(_ISR_STARTADDRESS+0x34))
#define pISR_URXD1 (*(unsigned *)(_ISR_STARTADDRESS+0x38))
#define pISR_URXD0 (*(unsigned *)(_ISR_STARTADDRESS+0x3c))
#define pISR_TIMER5 (*(unsigned *)(_ISR_STARTADDRESS+0x40))
#define pISR_TIMER4 (*(unsigned *)(_ISR_STARTADDRESS+0x44))
#define pISR_TIMER3 (*(unsigned *)(_ISR_STARTADDRESS+0x48))
#define pISR_TIMER2 (*(unsigned *)(_ISR_STARTADDRESS+0x4c))
#define pISR_TIMER1 (*(unsigned *)(_ISR_STARTADDRESS+0x50))
#define pISR_TIMER0 (*(unsigned *)(_ISR_STARTADDRESS+0x54))
#define pISR_UERR01 (*(unsigned *)(_ISR_STARTADDRESS+0x58))
#define pISR_WDT (*(unsigned *)(_ISR_STARTADDRESS+0x5c))
#define pISR_BDMA1 (*(unsigned *)(_ISR_STARTADDRESS+0x60))
#define pISR_BDMA0 (*(unsigned *)(_ISR_STARTADDRESS+0x64))
#define pISR_ZDMA1 (*(unsigned *)(_ISR_STARTADDRESS+0x68))
#define pISR_ZDMA0 (*(unsigned *)(_ISR_STARTADDRESS+0x6c))
#define pISR_TICK (*(unsigned *)(_ISR_STARTADDRESS+0x70))
#define pISR_EINT4567 (*(unsigned *)(_ISR_STARTADDRESS+0x74))
#define pISR_EINT3 (*(unsigned *)(_ISR_STARTADDRESS+0x78))
#define pISR_EINT2 (*(unsigned *)(_ISR_STARTADDRESS+0x7c))
#define pISR_EINT1 (*(unsigned *)(_ISR_STARTADDRESS+0x80))
#define pISR_EINT0 (*(unsigned *)(_ISR_STARTADDRESS+0x84))
/* PENDING BIT */
//CAUTION:You must clear the pending bit as general special register.
// it's different way with KS32C6x00
#define BIT_ADC (0x1)
#define BIT_RTC (0x1<<1)
#define BIT_UTXD1 (0x1<<2)
#define BIT_UTXD0 (0x1<<3)
#define BIT_SIO (0x1<<4)
#define BIT_IIC (0x1<<5)
#define BIT_URXD1 (0x1<<6)
#define BIT_URXD0 (0x1<<7)
#define BIT_TIMER5 (0x1<<8)
#define BIT_TIMER4 (0x1<<9)
#define BIT_TIMER3 (0x1<<10)
#define BIT_TIMER2 (0x1<<11)
#define BIT_TIMER1 (0x1<<12)
#define BIT_TIMER0 (0x1<<13)
#define BIT_UERR01 (0x1<<14)
#define BIT_WDT (0x1<<15)
#define BIT_BDMA1 (0x1<<16)
#define BIT_BDMA0 (0x1<<17)
#define BIT_ZDMA1 (0x1<<18)
#define BIT_ZDMA0 (0x1<<19)
#define BIT_TICK (0x1<<20)
#define BIT_EINT4567 (0x1<<21)
#define BIT_EINT3 (0x1<<22)
#define BIT_EINT2 (0x1<<23)
#define BIT_EINT1 (0x1<<24)
#define BIT_EINT0 (0x1<<25)
#define BIT_GLOBAL (0x1<<26)
#ifdef __cplusplus
}
#endif
#endif /*__44B0X_H___*/
各位大哥:
问题1:
//* ISR */ 下面的:
#define pISR_RESET (*(unsigned *)(_ISR_STARTADDRESS+0x0))
#define pISR_UNDEF (*(unsigned *)(_ISR_STARTADDRESS+0x4))
#define pISR_SWI (*(unsigned *)(_ISR_STARTADDRESS+0x8))
#define pISR_PABORT (*(unsigned *)(_ISR_STARTADDRESS+0xc))
........................................
.......................................
这些定义的是什么?
为什么是: (_ISR_STARTADDRESS+0x4)) 呢?
(_ISR_STARTADDRESS+0x8)) 呢?
问题2:
/* PENDING BIT */ 下面的:
#define BIT_ADC (0x1)
#define BIT_RTC (0x1<<1)
#define BIT_UTXD1 (0x1<<2)
#define BIT_UTXD0 (0x1<<3)
#define BIT_SIO (0x1<<4)
#define BIT_IIC (0x1<<5)
....................................
...................................
这些东西定义的是什么呢?
为什么是:(0x1) 呢?
为什么是 (0x1<<1) 呢?
谢谢各位大哥!
答 1: 我的理解。我的理解是:
#define pISR_EINT4567 (*(unsigned *)(_ISR_STARTADDRESS+0x74))
//定义一个 pISR_EINT4567的宏, 该宏代表的是一个函数指针
到程序里面要初始化中断的时候是这样用的:
pISR_EINT4567=(INT)eINT4567Isr; // 把中断服务程序入口赋值给该函数指针? 答 2: ??#define pISR_ADC (*(unsigned *)(_ISR_STARTADDRESS+0x20))
#define pISR_RTC (*(unsigned *)(_ISR_STARTADDRESS+0x24))
……
……
……
#define pISR_EINT1 (*(unsigned *)(_ISR_STARTADDRESS+0x80))
#define pISR_EINT0 (*(unsigned *)(_ISR_STARTADDRESS+0x84))
以上应该是中断向量表在内存区的定义
(原本在0x00000000处也有个向量表的?)
我也不是很清楚。
汗啊。 答 3: 谢谢 大哥:aray2000 大哥:
#define BIT_ADC (0x1)
#define BIT_RTC (0x1<<1)
为什么是这样啊?
aray2000 大哥,您说的:“以上应该是中断向量表在内存区的定义‘
是在 RAM 中的定义,是吗?
原本在0x00000000处也有个向量表的?)
是在 ROM 中的定义,是吗?
谢谢!
答 4: ~~~#define BIT_ADC (0x1)
#define BIT_RTC (0x1<<1)
位的宏定义啊 0x1<<1 =2 写成那样应该是为了方便阅读 答 5: 谢谢 两位大哥:谢谢两位大哥:
我知道:
/* INTERRUPT */
#define rINTCON (*(volatile unsigned *)0x1e00000)
#define rINTPND (*(volatile unsigned *)0x1e00004)
#define rINTMOD (*(volatile unsigned *)0x1e00008)
#define rINTMSK (*(volatile unsigned *)0x1e0000c)
#define rI_PSLV (*(volatile unsigned *)0x1e00010)
#define rI_PMST (*(volatile unsigned *)0x1e00014)
#define rI_CSLV (*(volatile unsigned *)0x1e00018)
#define rI_CMST (*(volatile unsigned *)0x1e0001c)
#define rI_ISPR (*(volatile unsigned *)0x1e00020)
#define rI_ISPC (*(volatile unsigned *)0x1e00024)
#define rF_ISPR (*(volatile unsigned *)0x1e00038)
#define rF_ISPC (*(volatile unsigned *)0x1e0003c)
定义的是 44B0 的寄存器,赋的是寄存器地址的值
可是
/* ISR */
#define pISR_RESET (*(unsigned *)(_ISR_STARTADDRESS+0x0))
#define pISR_UNDEF (*(unsigned *)(_ISR_STARTADDRESS+0x4))
#define pISR_SWI (*(unsigned *)(_ISR_STARTADDRESS+0x8))
#define pISR_PABORT (*(unsigned *)(_ISR_STARTADDRESS+0xc))
#define pISR_DABORT (*(unsigned *)(_ISR_STARTADDRESS+0x10))
#define pISR_RESERVED (*(unsigned *)(_ISR_STARTADDRESS+0x14))
#define pISR_IRQ (*(unsigned *)(_ISR_STARTADDRESS+0x18))
#define pISR_FIQ (*(unsigned *)(_ISR_STARTADDRESS+0x1c))
#define pISR_ADC (*(unsigned *)(_ISR_STARTADDRESS+0x20))
#define pISR_RTC (*(unsigned *)(_ISR_STARTADDRESS+0x24))
#define pISR_UTXD1 (*(unsigned *)(_ISR_STARTADDRESS+0x28))
#define pISR_UTXD0 (*(unsigned *)(_ISR_STARTADDRESS+0x2c))
#define pISR_SIO (*(unsigned *)(_ISR_STARTADDRESS+0x30))
#define pISR_IIC (*(unsigned *)(_ISR_STARTADDRESS+0x34))
#define pISR_URXD1 (*(unsigned *)(_ISR_STARTADDRESS+0x38))
#define pISR_URXD0 (*(unsigned *)(_ISR_STARTADDRESS+0x3c))
#define pISR_TIMER5 (*(unsigned *)(_ISR_STARTADDRESS+0x40))
#define pISR_TIMER4 (*(unsigned *)(_ISR_STARTADDRESS+0x44))
#define pISR_TIMER3 (*(unsigned *)(_ISR_STARTADDRESS+0x48))
#define pISR_TIMER2 (*(unsigned *)(_ISR_STARTADDRESS+0x4c))
#define pISR_TIMER1 (*(unsigned *)(_ISR_STARTADDRESS+0x50))
#define pISR_TIMER0 (*(unsigned *)(_ISR_STARTADDRESS+0x54))
#define pISR_UERR01 (*(unsigned *)(_ISR_STARTADDRESS+0x58))
#define pISR_WDT (*(unsigned *)(_ISR_STARTADDRESS+0x5c))
#define pISR_BDMA1 (*(unsigned *)(_ISR_STARTADDRESS+0x60))
#define pISR_BDMA0 (*(unsigned *)(_ISR_STARTADDRESS+0x64))
#define pISR_ZDMA1 (*(unsigned *)(_ISR_STARTADDRESS+0x68))
#define pISR_ZDMA0 (*(unsigned *)(_ISR_STARTADDRESS+0x6c))
#define pISR_TICK (*(unsigned *)(_ISR_STARTADDRESS+0x70))
#define pISR_EINT4567 (*(unsigned *)(_ISR_STARTADDRESS+0x74))
#define pISR_EINT3 (*(unsigned *)(_ISR_STARTADDRESS+0x78))
#define pISR_EINT2 (*(unsigned *)(_ISR_STARTADDRESS+0x7c))
#define pISR_EINT1 (*(unsigned *)(_ISR_STARTADDRESS+0x80))
#define pISR_EINT0 (*(unsigned *)(_ISR_STARTADDRESS+0x84))
它定义的什么呢?
比如:
#define pISR_EINT0 (*(unsigned *)(_ISR_STARTADDRESS+0x84))
它为什么是 _ISR_STARTADDRESS+0x84 ,是根据什么来的?
还有:
define BIT_ADC (0x1)
#define BIT_RTC (0x1<<1)
#define BIT_UTXD1 (0x1<<2)
#define BIT_UTXD0 (0x1<<3)
#define BIT_SIO (0x1<<4)
#define BIT_IIC (0x1<<5)
#define BIT_URXD1 (0x1<<6)
#define BIT_URXD0 (0x1<<7)
#define BIT_TIMER5 (0x1<<8)
#define BIT_TIMER4 (0x1<<9)
#define BIT_TIMER3 (0x1<<10)
定义的是什么?
比如:#define BIT_TIMER3 (0x1<<10)
为什么它的值 是 0x1<<10?
是根据什么来的?
谢谢!
在 option.h 里
#define _ISR_STARTADDRESS 0xc7fff00
S3C44B0 的 44B.H 的程序如下:
#define rLOCKTIME (*(volatile unsigned *)0x1d8000c)
/* INTERRUPT */
#define rINTCON (*(volatile unsigned *)0x1e00000)
#define rINTPND (*(volatile unsigned *)0x1e00004)
#define rINTMOD (*(volatile unsigned *)0x1e00008)
#define rINTMSK (*(volatile unsigned *)0x1e0000c)
#define rI_PSLV (*(volatile unsigned *)0x1e00010)
#define rI_PMST (*(volatile unsigned *)0x1e00014)
#define rI_CSLV (*(volatile unsigned *)0x1e00018)
#define rI_CMST (*(volatile unsigned *)0x1e0001c)
#define rI_ISPR (*(volatile unsigned *)0x1e00020)
#define rI_ISPC (*(volatile unsigned *)0x1e00024)
#define rF_ISPR (*(volatile unsigned *)0x1e00038)
#define rF_ISPC (*(volatile unsigned *)0x1e0003c)
/* LCD */
#define rLCDCON1 (*(volatile unsigned *)0x1f00000)
#define rLCDCON2 (*(volatile unsigned *)0x1f00004)
#define rLCDCON3 (*(volatile unsigned *)0x1f00040)
#define rLCDSADDR1 (*(volatile unsigned *)0x1f00008)
#define rLCDSADDR2 (*(volatile unsigned *)0x1f0000c)
#define rLCDSADDR3 (*(volatile unsigned *)0x1f00010)
#define rREDLUT (*(volatile unsigned *)0x1f00014)
#define rGREENLUT (*(volatile unsigned *)0x1f00018)
#define rBLUELUT (*(volatile unsigned *)0x1f0001c)
#define rDP1_2 (*(volatile unsigned *)0x1f00020)
#define rDP4_7 (*(volatile unsigned *)0x1f00024)
#define rDP3_5 (*(volatile unsigned *)0x1f00028)
#define rDP2_3 (*(volatile unsigned *)0x1f0002c)
#define rDP5_7 (*(volatile unsigned *)0x1f00030)
#define rDP3_4 (*(volatile unsigned *)0x1f00034)
#define rDP4_5 (*(volatile unsigned *)0x1f00038)
#define rDP6_7 (*(volatile unsigned *)0x1f0003c)
#define rDITHMODE (*(volatile unsigned *)0x1f00044)
/* ZDMA0 */
#define rZDCON0 (*(volatile unsigned *)0x1e80000)
#define rZDISRC0 (*(volatile unsigned *)0x1e80004)
#define rZDIDES0 (*(volatile unsigned *)0x1e80008)
#define rZDICNT0 (*(volatile unsigned *)0x1e8000c)
#define rZDCSRC0 (*(volatile unsigned *)0x1e80010)
#define rZDCDES0 (*(volatile unsigned *)0x1e80014)
#define rZDCCNT0 (*(volatile unsigned *)0x1e80018)
/* ZDMA1 */
#define rZDCON1 (*(volatile unsigned *)0x1e80020)
#define rZDISRC1 (*(volatile unsigned *)0x1e80024)
#define rZDIDES1 (*(volatile unsigned *)0x1e80028)
#define rZDICNT1 (*(volatile unsigned *)0x1e8002c)
#define rZDCSRC1 (*(volatile unsigned *)0x1e80030)
#define rZDCDES1 (*(volatile unsigned *)0x1e80034)
#define rZDCCNT1 (*(volatile unsigned *)0x1e80038)
/* BDMA0 */
#define rBDCON0 (*(volatile unsigned *)0x1f80000)
#define rBDISRC0 (*(volatile unsigned *)0x1f80004)
#define rBDIDES0 (*(volatile unsigned *)0x1f80008)
#define rBDICNT0 (*(volatile unsigned *)0x1f8000c)
#define rBDCSRC0 (*(volatile unsigned *)0x1f80010)
#define rBDCDES0 (*(volatile unsigned *)0x1f80014)
#define rBDCCNT0 (*(volatile unsigned *)0x1f80018)
/* BDMA1 */
#define rBDCON1 (*(volatile unsigned *)0x1f80020)
#define rBDISRC1 (*(volatile unsigned *)0x1f80024)
#define rBDIDES1 (*(volatile unsigned *)0x1f80028)
#define rBDICNT1 (*(volatile unsigned *)0x1f8002c)
#define rBDCSRC1 (*(volatile unsigned *)0x1f80030)
#define rBDCDES1 (*(volatile unsigned *)0x1f80034)
#define rBDCCNT1 (*(volatile unsigned *)0x1f80038)
/* ISR */
#define pISR_RESET (*(unsigned *)(_ISR_STARTADDRESS+0x0))
#define pISR_UNDEF (*(unsigned *)(_ISR_STARTADDRESS+0x4))
#define pISR_SWI (*(unsigned *)(_ISR_STARTADDRESS+0x8))
#define pISR_PABORT (*(unsigned *)(_ISR_STARTADDRESS+0xc))
#define pISR_DABORT (*(unsigned *)(_ISR_STARTADDRESS+0x10))
#define pISR_RESERVED (*(unsigned *)(_ISR_STARTADDRESS+0x14))
#define pISR_IRQ (*(unsigned *)(_ISR_STARTADDRESS+0x18))
#define pISR_FIQ (*(unsigned *)(_ISR_STARTADDRESS+0x1c))
#define pISR_ADC (*(unsigned *)(_ISR_STARTADDRESS+0x20))
#define pISR_RTC (*(unsigned *)(_ISR_STARTADDRESS+0x24))
#define pISR_UTXD1 (*(unsigned *)(_ISR_STARTADDRESS+0x28))
#define pISR_UTXD0 (*(unsigned *)(_ISR_STARTADDRESS+0x2c))
#define pISR_SIO (*(unsigned *)(_ISR_STARTADDRESS+0x30))
#define pISR_IIC (*(unsigned *)(_ISR_STARTADDRESS+0x34))
#define pISR_URXD1 (*(unsigned *)(_ISR_STARTADDRESS+0x38))
#define pISR_URXD0 (*(unsigned *)(_ISR_STARTADDRESS+0x3c))
#define pISR_TIMER5 (*(unsigned *)(_ISR_STARTADDRESS+0x40))
#define pISR_TIMER4 (*(unsigned *)(_ISR_STARTADDRESS+0x44))
#define pISR_TIMER3 (*(unsigned *)(_ISR_STARTADDRESS+0x48))
#define pISR_TIMER2 (*(unsigned *)(_ISR_STARTADDRESS+0x4c))
#define pISR_TIMER1 (*(unsigned *)(_ISR_STARTADDRESS+0x50))
#define pISR_TIMER0 (*(unsigned *)(_ISR_STARTADDRESS+0x54))
#define pISR_UERR01 (*(unsigned *)(_ISR_STARTADDRESS+0x58))
#define pISR_WDT (*(unsigned *)(_ISR_STARTADDRESS+0x5c))
#define pISR_BDMA1 (*(unsigned *)(_ISR_STARTADDRESS+0x60))
#define pISR_BDMA0 (*(unsigned *)(_ISR_STARTADDRESS+0x64))
#define pISR_ZDMA1 (*(unsigned *)(_ISR_STARTADDRESS+0x68))
#define pISR_ZDMA0 (*(unsigned *)(_ISR_STARTADDRESS+0x6c))
#define pISR_TICK (*(unsigned *)(_ISR_STARTADDRESS+0x70))
#define pISR_EINT4567 (*(unsigned *)(_ISR_STARTADDRESS+0x74))
#define pISR_EINT3 (*(unsigned *)(_ISR_STARTADDRESS+0x78))
#define pISR_EINT2 (*(unsigned *)(_ISR_STARTADDRESS+0x7c))
#define pISR_EINT1 (*(unsigned *)(_ISR_STARTADDRESS+0x80))
#define pISR_EINT0 (*(unsigned *)(_ISR_STARTADDRESS+0x84))
/* PENDING BIT */
//CAUTION:You must clear the pending bit as general special register.
// it's different way with KS32C6x00
#define BIT_ADC (0x1)
#define BIT_RTC (0x1<<1)
#define BIT_UTXD1 (0x1<<2)
#define BIT_UTXD0 (0x1<<3)
#define BIT_SIO (0x1<<4)
#define BIT_IIC (0x1<<5)
#define BIT_URXD1 (0x1<<6)
#define BIT_URXD0 (0x1<<7)
#define BIT_TIMER5 (0x1<<8)
#define BIT_TIMER4 (0x1<<9)
#define BIT_TIMER3 (0x1<<10)
#define BIT_TIMER2 (0x1<<11)
#define BIT_TIMER1 (0x1<<12)
#define BIT_TIMER0 (0x1<<13)
#define BIT_UERR01 (0x1<<14)
#define BIT_WDT (0x1<<15)
#define BIT_BDMA1 (0x1<<16)
#define BIT_BDMA0 (0x1<<17)
#define BIT_ZDMA1 (0x1<<18)
#define BIT_ZDMA0 (0x1<<19)
#define BIT_TICK (0x1<<20)
#define BIT_EINT4567 (0x1<<21)
#define BIT_EINT3 (0x1<<22)
#define BIT_EINT2 (0x1<<23)
#define BIT_EINT1 (0x1<<24)
#define BIT_EINT0 (0x1<<25)
#define BIT_GLOBAL (0x1<<26)
#ifdef __cplusplus
}
#endif
#endif /*__44B0X_H___*/
各位大哥:
问题1:
//* ISR */ 下面的:
#define pISR_RESET (*(unsigned *)(_ISR_STARTADDRESS+0x0))
#define pISR_UNDEF (*(unsigned *)(_ISR_STARTADDRESS+0x4))
#define pISR_SWI (*(unsigned *)(_ISR_STARTADDRESS+0x8))
#define pISR_PABORT (*(unsigned *)(_ISR_STARTADDRESS+0xc))
........................................
.......................................
这些定义的是什么?
为什么是: (_ISR_STARTADDRESS+0x4)) 呢?
(_ISR_STARTADDRESS+0x8)) 呢?
问题2:
/* PENDING BIT */ 下面的:
#define BIT_ADC (0x1)
#define BIT_RTC (0x1<<1)
#define BIT_UTXD1 (0x1<<2)
#define BIT_UTXD0 (0x1<<3)
#define BIT_SIO (0x1<<4)
#define BIT_IIC (0x1<<5)
....................................
...................................
这些东西定义的是什么呢?
为什么是:(0x1) 呢?
为什么是 (0x1<<1) 呢?
谢谢各位大哥!
答 1: 我的理解。我的理解是:
#define pISR_EINT4567 (*(unsigned *)(_ISR_STARTADDRESS+0x74))
//定义一个 pISR_EINT4567的宏, 该宏代表的是一个函数指针
到程序里面要初始化中断的时候是这样用的:
pISR_EINT4567=(INT)eINT4567Isr; // 把中断服务程序入口赋值给该函数指针? 答 2: ??#define pISR_ADC (*(unsigned *)(_ISR_STARTADDRESS+0x20))
#define pISR_RTC (*(unsigned *)(_ISR_STARTADDRESS+0x24))
……
……
……
#define pISR_EINT1 (*(unsigned *)(_ISR_STARTADDRESS+0x80))
#define pISR_EINT0 (*(unsigned *)(_ISR_STARTADDRESS+0x84))
以上应该是中断向量表在内存区的定义
(原本在0x00000000处也有个向量表的?)
我也不是很清楚。
汗啊。 答 3: 谢谢 大哥:aray2000 大哥:
#define BIT_ADC (0x1)
#define BIT_RTC (0x1<<1)
为什么是这样啊?
aray2000 大哥,您说的:“以上应该是中断向量表在内存区的定义‘
是在 RAM 中的定义,是吗?
原本在0x00000000处也有个向量表的?)
是在 ROM 中的定义,是吗?
谢谢!
答 4: ~~~#define BIT_ADC (0x1)
#define BIT_RTC (0x1<<1)
位的宏定义啊 0x1<<1 =2 写成那样应该是为了方便阅读 答 5: 谢谢 两位大哥:谢谢两位大哥:
我知道:
/* INTERRUPT */
#define rINTCON (*(volatile unsigned *)0x1e00000)
#define rINTPND (*(volatile unsigned *)0x1e00004)
#define rINTMOD (*(volatile unsigned *)0x1e00008)
#define rINTMSK (*(volatile unsigned *)0x1e0000c)
#define rI_PSLV (*(volatile unsigned *)0x1e00010)
#define rI_PMST (*(volatile unsigned *)0x1e00014)
#define rI_CSLV (*(volatile unsigned *)0x1e00018)
#define rI_CMST (*(volatile unsigned *)0x1e0001c)
#define rI_ISPR (*(volatile unsigned *)0x1e00020)
#define rI_ISPC (*(volatile unsigned *)0x1e00024)
#define rF_ISPR (*(volatile unsigned *)0x1e00038)
#define rF_ISPC (*(volatile unsigned *)0x1e0003c)
定义的是 44B0 的寄存器,赋的是寄存器地址的值
可是
/* ISR */
#define pISR_RESET (*(unsigned *)(_ISR_STARTADDRESS+0x0))
#define pISR_UNDEF (*(unsigned *)(_ISR_STARTADDRESS+0x4))
#define pISR_SWI (*(unsigned *)(_ISR_STARTADDRESS+0x8))
#define pISR_PABORT (*(unsigned *)(_ISR_STARTADDRESS+0xc))
#define pISR_DABORT (*(unsigned *)(_ISR_STARTADDRESS+0x10))
#define pISR_RESERVED (*(unsigned *)(_ISR_STARTADDRESS+0x14))
#define pISR_IRQ (*(unsigned *)(_ISR_STARTADDRESS+0x18))
#define pISR_FIQ (*(unsigned *)(_ISR_STARTADDRESS+0x1c))
#define pISR_ADC (*(unsigned *)(_ISR_STARTADDRESS+0x20))
#define pISR_RTC (*(unsigned *)(_ISR_STARTADDRESS+0x24))
#define pISR_UTXD1 (*(unsigned *)(_ISR_STARTADDRESS+0x28))
#define pISR_UTXD0 (*(unsigned *)(_ISR_STARTADDRESS+0x2c))
#define pISR_SIO (*(unsigned *)(_ISR_STARTADDRESS+0x30))
#define pISR_IIC (*(unsigned *)(_ISR_STARTADDRESS+0x34))
#define pISR_URXD1 (*(unsigned *)(_ISR_STARTADDRESS+0x38))
#define pISR_URXD0 (*(unsigned *)(_ISR_STARTADDRESS+0x3c))
#define pISR_TIMER5 (*(unsigned *)(_ISR_STARTADDRESS+0x40))
#define pISR_TIMER4 (*(unsigned *)(_ISR_STARTADDRESS+0x44))
#define pISR_TIMER3 (*(unsigned *)(_ISR_STARTADDRESS+0x48))
#define pISR_TIMER2 (*(unsigned *)(_ISR_STARTADDRESS+0x4c))
#define pISR_TIMER1 (*(unsigned *)(_ISR_STARTADDRESS+0x50))
#define pISR_TIMER0 (*(unsigned *)(_ISR_STARTADDRESS+0x54))
#define pISR_UERR01 (*(unsigned *)(_ISR_STARTADDRESS+0x58))
#define pISR_WDT (*(unsigned *)(_ISR_STARTADDRESS+0x5c))
#define pISR_BDMA1 (*(unsigned *)(_ISR_STARTADDRESS+0x60))
#define pISR_BDMA0 (*(unsigned *)(_ISR_STARTADDRESS+0x64))
#define pISR_ZDMA1 (*(unsigned *)(_ISR_STARTADDRESS+0x68))
#define pISR_ZDMA0 (*(unsigned *)(_ISR_STARTADDRESS+0x6c))
#define pISR_TICK (*(unsigned *)(_ISR_STARTADDRESS+0x70))
#define pISR_EINT4567 (*(unsigned *)(_ISR_STARTADDRESS+0x74))
#define pISR_EINT3 (*(unsigned *)(_ISR_STARTADDRESS+0x78))
#define pISR_EINT2 (*(unsigned *)(_ISR_STARTADDRESS+0x7c))
#define pISR_EINT1 (*(unsigned *)(_ISR_STARTADDRESS+0x80))
#define pISR_EINT0 (*(unsigned *)(_ISR_STARTADDRESS+0x84))
它定义的什么呢?
比如:
#define pISR_EINT0 (*(unsigned *)(_ISR_STARTADDRESS+0x84))
它为什么是 _ISR_STARTADDRESS+0x84 ,是根据什么来的?
还有:
define BIT_ADC (0x1)
#define BIT_RTC (0x1<<1)
#define BIT_UTXD1 (0x1<<2)
#define BIT_UTXD0 (0x1<<3)
#define BIT_SIO (0x1<<4)
#define BIT_IIC (0x1<<5)
#define BIT_URXD1 (0x1<<6)
#define BIT_URXD0 (0x1<<7)
#define BIT_TIMER5 (0x1<<8)
#define BIT_TIMER4 (0x1<<9)
#define BIT_TIMER3 (0x1<<10)
定义的是什么?
比如:#define BIT_TIMER3 (0x1<<10)
为什么它的值 是 0x1<<10?
是根据什么来的?
谢谢!
共2条
1/1 1 跳转至页
回复
有奖活动 | |
---|---|
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |
打赏帖 | |
---|---|
【笔记】生成报错synthdesignERROR被打赏50分 | |
【STM32H7S78-DK评测】LTDC+DMA2D驱动RGBLCD屏幕被打赏50分 | |
【STM32H7S78-DK评测】Coremark基准测试被打赏50分 | |
【STM32H7S78-DK评测】浮点数计算性能测试被打赏50分 | |
【STM32H7S78-DK评测】Execute in place(XIP)模式学习笔记被打赏50分 | |
每周了解几个硬件知识+buckboost电路(五)被打赏10分 | |
【换取逻辑分析仪】RA8 PMU 模块功能寄存器功能说明被打赏20分 | |
野火启明6M5适配SPI被打赏20分 | |
NUCLEO-U083RC学习历程2-串口输出测试被打赏20分 | |
【笔记】STM32CUBEIDE的Noruletomaketarget编译问题被打赏50分 |