智能车制作

标题: PORT_ISFR_ISF(x) [打印本页]

作者: 孙桥9266    时间: 2015-6-8 18:43
标题: PORT_ISFR_ISF(x)
请教一下大家,KL46里面PORT_ISFR_ISF(x)是什么意思,(x)指的什么?

作者: 孙桥9266    时间: 2015-6-9 19:25
la9998372 发表于 2015-6-9 10:17
你是用的标准的官方头文件吗?

* @addtogroup PORT_Register_Masks PORT Register Masks
* @{
*/

/* PCR Bit Fields */
#define PORT_PCR_PS_MASK                         0x1u
#define PORT_PCR_PS_SHIFT                        0
#define PORT_PCR_PE_MASK                         0x2u
#define PORT_PCR_PE_SHIFT                        1
#define PORT_PCR_SRE_MASK                        0x4u
#define PORT_PCR_SRE_SHIFT                       2
#define PORT_PCR_PFE_MASK                        0x10u
#define PORT_PCR_PFE_SHIFT                       4
#define PORT_PCR_DSE_MASK                        0x40u
#define PORT_PCR_DSE_SHIFT                       6
#define PORT_PCR_MUX_MASK                        0x700u
#define PORT_PCR_MUX_SHIFT                       8
#define PORT_PCR_MUX(x)                          (((uint32_t)(((uint32_t)(x))<<PORT_PCR_MUX_SHIFT))&PORT_PCR_MUX_MASK)
#define PORT_PCR_IRQC_MASK                       0xF0000u
#define PORT_PCR_IRQC_SHIFT                      16
#define PORT_PCR_IRQC(x)                         (((uint32_t)(((uint32_t)(x))<<PORT_PCR_IRQC_SHIFT))&PORT_PCR_IRQC_MASK)
#define PORT_PCR_ISF_MASK                        0x1000000u
#define PORT_PCR_ISF_SHIFT                       24
/* GPCLR Bit Fields */
#define PORT_GPCLR_GPWD_MASK                     0xFFFFu
#define PORT_GPCLR_GPWD_SHIFT                    0
#define PORT_GPCLR_GPWD(x)                       (((uint32_t)(((uint32_t)(x))<<PORT_GPCLR_GPWD_SHIFT))&PORT_GPCLR_GPWD_MASK)
#define PORT_GPCLR_GPWE_MASK                     0xFFFF0000u
#define PORT_GPCLR_GPWE_SHIFT                    16
#define PORT_GPCLR_GPWE(x)                       (((uint32_t)(((uint32_t)(x))<<PORT_GPCLR_GPWE_SHIFT))&PORT_GPCLR_GPWE_MASK)
/* GPCHR Bit Fields */
#define PORT_GPCHR_GPWD_MASK                     0xFFFFu
#define PORT_GPCHR_GPWD_SHIFT                    0
#define PORT_GPCHR_GPWD(x)                       (((uint32_t)(((uint32_t)(x))<<PORT_GPCHR_GPWD_SHIFT))&PORT_GPCHR_GPWD_MASK)
#define PORT_GPCHR_GPWE_MASK                     0xFFFF0000u
#define PORT_GPCHR_GPWE_SHIFT                    16
#define PORT_GPCHR_GPWE(x)                       (((uint32_t)(((uint32_t)(x))<<PORT_GPCHR_GPWE_SHIFT))&PORT_GPCHR_GPWE_MASK)
/* ISFR Bit Fields */
#define PORT_ISFR_ISF_MASK                       0xFFFFFFFFu
#define PORT_ISFR_ISF_SHIFT                      0
#define PORT_ISFR_ISF(x)                         (((uint32_t)(((uint32_t)(x))<<PORT_ISFR_ISF_SHIFT))&PORT_ISFR_ISF_MASK)



作者: 孙桥9266    时间: 2015-6-10 09:50
la9998372 发表于 2015-6-9 23:24
x是port的第几个管脚的中断标志吧。

谢谢

作者: 孙桥9266    时间: 2015-6-10 09:58
孙桥9266 发表于 2015-6-10 09:50
谢谢

这是OV7620用K60的行中断处理函数
if( PORT_ISFR_ISF(2)  & (1 << 2))         
    {
         PORT_ISFR_ISF(2) |= (1 << 2);
我想改为KL46的,不知道对不对,其中或等于那里报错了,
if( PORT_ISFR_ISF(2)  & (1 << 2))     //PTA2   
    {
         PORT_ISFR_ISF(2) |= (1 << 2);
今年大一,第一年参加,实在是不会,如果你知道的话,请指教一下,十分感谢

作者: 孙桥9266    时间: 2015-6-10 09:59
la9998372 发表于 2015-6-9 23:24
x是port的第几个管脚的中断标志吧。

这是OV7620用K60的行中断处理函数
if( PORT_ISFR_ISF(2)  & (1 << 2))         
    {
         PORT_ISFR_ISF(2) |= (1 << 2);
我想改为KL46的,不知道对不对,其中或等于那里报错了,
if( PORT_ISFR_ISF(2)  & (1 << 2))     //PTA2   
    {
         PORT_ISFR_ISF(2) |= (1 << 2);
今年大一,第一年参加,实在是不会,如果你知道的话,请指教一下,十分感谢

作者: 孙桥9266    时间: 2015-6-10 18:36
la9998372 发表于 2015-6-10 13:42
你用这个判断一下PORTX->ISFR&PINX

if( PORTA->ISFR  & (1 << 2))         
    {
         PORTA->ISFR |= (1 << 2);
是这样吗?我改成这样就没报错了,我用的是KL46


作者: 孙桥9266    时间: 2015-6-10 20:12
la9998372 发表于 2015-6-10 19:35
嗯,是的

谢谢了

作者: 孙桥9266    时间: 2015-6-11 14:40
la9998372 发表于 2015-6-10 13:42
这是K60的吧。。。

我是从KL26改成KL46的,我搞错了

作者: 孙桥9266    时间: 2015-6-11 16:24
la9998372 发表于 2015-6-10 19:35
嗯,是的

可以再问你一下吗?这是KL46里面的DMA中断回调函数
void DMA_CallbackInstall(uint8_t chl, DMA_CallBackType AppCBFun)  
{
    if(AppCBFun != NULL)
    {
        DMA_CallBackTable[chl] = AppCBFun;                          
    }
}
typedef void (*DMA_CallBackType)(void);
里面的AppCBFun是什么了?


作者: 孙桥9266    时间: 2015-6-12 12:28
la9998372 发表于 2015-6-11 20:17
这个就不太清楚了。。。。没看明白

没事没事,谢谢,





欢迎光临 智能车制作 (http://111.231.132.190/) Powered by Discuz! X3.2