Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have an STM32F4 processor interfaced with a Solomon Systems SSD1963 GPU. The GPU has a Tearing Signal (TE) that notifies the processor when it is about to do a vertical refresh. I hope you can use this code as an example and adapt it to your solution.</p> <p>The TE signal is connected to the CPU's GPIO G7 pin. So first I have to configure the GPIO pin.</p> <pre><code>//GPIO Pin G7 GPIO_StructInit(&amp;GPIO_InitStructure); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(GPIOG, &amp;GPIO_InitStructure); </code></pre> <p>Next I have to configure the interrupt and NVIC.</p> <pre><code>SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOG, EXTI_PinSource7); EXTI_InitTypeDef EXTI_InitStructure; EXTI_StructInit(&amp;EXTI_InitStructure); EXTI_InitStructure.EXTI_Line = EXTI_Line7; EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt; EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising; EXTI_InitStructure.EXTI_LineCmd = ENABLE; EXTI_Init(&amp;EXTI_InitStructure); NVIC_InitTypeDef NVIC_InitStructure; NVIC_InitStructure.NVIC_IRQChannel = EXTI9_5_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x01; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x01; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&amp;NVIC_InitStructure); </code></pre> <p>Finally I have to create the interrupt handler. The <code>EXTI9_5_IRQHandler</code> handles external interrupts on lines 5 ~ 7. This method is actually defined in my CPUs startup assembly file as a weak reference. I just need to redefine the method and the linker will do the rest.</p> <pre><code>extern "C" void EXTI9_5_IRQHandler(void) { if(EXTI_GetITStatus(EXTI_Line7) != RESET) { //Handle the interrupt EXTI_ClearITPendingBit(EXTI_Line7); } } </code></pre> <p>I'm using Mentor Graphics' Sourcery Codebench Lite as my toolchain.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload