How to request a irq for s32v?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to request a irq for s32v?

1,416 次查看
huangzhong
Contributor II

I have problem in requesting a irq for s32v, I don't konw the first parameter in s32v should be, for example I want to set the PA0 port to be a irq function, and I user the following code:

   volatile struct SIUL2_tag *Siul2_Reg = NULL;
   Siul2_Reg = ioremap((uintptr_t)&SIUL2, sizeof(struct SIUL2_tag));

   //PA0 irq
   Siul2_Reg->MSCR[590].B.MUX_MODE = 2; // interrupt mux mode selected

   // PA0 (the pad is )

   ret = request_irq(???, PA0_interrupt_handle, IRQF_TRIGGER_FALLING, "PA0_IRQ", NULL);
   if(ret)
   {
      printk("request_irq failed!\n");
      return -1;
   } 

11.jpg

   the "???" should be? could you tell me how to fill it in a simple case.

         Look forward to your answer , thank you very much!

标签 (1)
0 项奖励
回复
2 回复数

1,194 次查看
cezardobromir
NXP Employee
NXP Employee

Hi,

That number that you have shown in the picture is actually the IMCR number.

If you look into the RM at the SIUL2 module you will see that the MSCR registers take values from 0 to 309.

The IMCR registers have values from 0 to 511 but to use them from the IO_Signal_Description table you need to subtract 512 from the values that are grater than 511.

So, for your example you should write in IMCR[79] in the DAISY field.

Best regards,

Cezar

0 项奖励
回复

1,194 次查看
stanish
NXP Employee
NXP Employee

Hi,

Could you please indicate:

* which version of the tool are you using (e.g. S32DS ARM 2.0?)

* SDK version

Thank you

Stan

0 项奖励
回复