Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Zynq interrupts can be divided into several parts

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "Zynq interrupt can be divided into several parts", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn that "Zynq interrupts can be divided into several parts"!

Zynq interrupts can be roughly divided into three parts

The first part is SGI, software generated interrupt, a total of 16 ports

The second part is the interrupt of PPI,CPU private peripherals, there are 5.

The third part is SPI, shared peripheral interrupts, from 44 PS IO peripherals and 16 PL interrupts. The middle part is the GIC, that is, the interrupt controller, which is used to enable, turn off, mask, set priority and so on.

The following is the interrupt controller block diagram, the main controller part is ICC and ICD, ICD connects SGI and PPI, ICD connects SPI, and the registers of both can be configured to control the interrupt.

SGI interrupt (software interrupt), a total of 16 IRQ ID numbers

PPI interrupt, CPU private interrupt, a total of 5 IRQ ID numbers

SPI interrupt part with a total of 60 IRQ ID numbers

Next, set GPIOINT_M ASK with interrupts: interrupt mask

INT_DIS: interrupt shutdown

INT_EN: interrupt enable

INT_TYPE: interrupt type, setting level sensitivity or edge sensitivity

INT_POLARITY: break polarity, set low or falling edge or high level or rising edge

INT_ANY: edge trigger mode, which can only be used if INT_TYPE is set to edge sensitive.

GPIO initialization à setting button and LED orientation à setting generate interrupt mode à interrupt setting open interrupt controller à open interrupt exception à open GPIO interrupt à judge KEY_ flag value is 1, write LED

GPIO_CONFIG = XGpioPs_LookupConfig (MIO_0_ID)

Status = XGpioPs_CfgInitialize (& GPIO_PTR, GPIO_CONFIG, PIO_CONFIG- > BaseAddr)

/ / set the LED direction

XGpioPs_SetDirectionPin (& GPIO_PTR,0, GPIO_OUTPUT)

XGpioPs_SetDirectionPin (& GPIO_PTR,13, GPIO_OUTPUT)

/ / set the button direction

XGpioPs_SetDirectionPin (& GPIO_PTR,PS_KEY1, GPIO_INPUT)

XGpioPs_SetDirectionPin (& GPIO_PTR,PS_KEY2, GPIO_INPUT)

/ / enable LED output

XGpioPs_SetOutputEnablePin (& GPIO_PTR,0, GPIO_OUTPUT)

XGpioPs_SetOutputEnablePin (& GPIO_PTR,13, GPIO_OUTPUT)

/ / set the interrupt type 0 to indicate the rising edge

XGpioPs_SetIntrTypePin (& GPIO_PTR,PS_KEY1, 0); / / rising edge

XGpioPs_SetIntrTypePin (& GPIO_PTR,PS_KEY2, 0); / / rising edge

/ / set the button to enable

XGpioPs_IntrEnablePin & GPIO_PTR,PS_KEY1)

XGpioPs_IntrEnablePin & GPIO_PTR,PS_KEY2)

/ / set interrupt

Status= IntrInitFuntion (& INTCInst, MIO_0_ID, & GPIO_PTR)

/ / generate GPIO for keystrokes

While (1)

{

If (key_flag)

{

XGpioPs_WritePin (& GPIO_PTR,0, key_val)

XGpioPs_WritePin (& GPIO_PTR,13, key_val)

Key_val= ~ key_val

Key_flag= 0

}

}

At this point, I believe that everyone on the "Zynq interrupt can be divided into several parts" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report