cancel
Showing results for 
Search instead for 
Did you mean: 

HAL: reset EXTI block

pestov
Associate II
Posted on May 12, 2016 at 12:08

func 

HAL_DeInit(); // Reset of all peripherals  

does not reset EXTI block,

as it is in HAL_GPIO_DeInit()

    /*------------------------- EXTI Mode Configuration --------------------*/

      tmp = SYSCFG->EXTICR[position >> 2U];

      tmp &= (((uint32_t)0x0FU) << (4U * (position & 0x03U)));

      if(tmp == ((uint32_t)(GPIO_GET_INDEX(GPIOx)) << (4U * (position & 0x03U))))

      {

        /* Configure the External Interrupt or event for the current IO */

        tmp = ((uint32_t)0x0FU) << (4U * (position & 0x03U));

        SYSCFG->EXTICR[position >> 2U] &= ~tmp;

        /* Clear EXTI line configuration */

        EXTI->IMR &= ~((uint32_t)iocurrent);

        EXTI->EMR &= ~((uint32_t)iocurrent);

        

        /* Clear Rising Falling edge configuration */

        EXTI->RTSR &= ~((uint32_t)iocurrent);

        EXTI->FTSR &= ~((uint32_t)iocurrent);

      }

0 REPLIES 0