2 Replies Latest reply on Jul 26, 2016 6:23 AM by aleesi



      Hey, This below piece of code is from soc_sleep() function in qm_power.c file. I'm using GPIO interrupt to wake- up the system.

      I want to know how to perform the below given operaion.



           * If wake source is any of AON Timer, RTC, GPIO interrupt, program 

           * CCU_SYS_CLK_CTL.CCU_SYS_CLK_SEL to RTC Oscillator.      */  

            /* Enter SoC sleep mode. */  


        • 1. Re: CCU_SYS_CLK_CTL and CCU_SYS_CLK_SEL



          We’ll investigate on your case. We’ll post a reply soon.



          • 2. Re: CCU_SYS_CLK_CTL and CCU_SYS_CLK_SEL





            All 25 GPIOs are Always-on interrupt and wake capable. We don't have an example to illustrate the use case you are referring to but we do have the an example that illustrates how to use the GPIO interruptions.

            You would need to add some bite and pieces to the Sleep Mode example, more precisely the GPIO configuration below:



            /* Request IRQ and write GPIO port config */

            direction = BIT(PIN_OUT);


            int_en = BIT(PIN_INTR);       /* Interrupt enabled */

            int_type = BIT(PIN_INTR);     /* Edge sensitive interrupt */

            int_polarity = BIT(PIN_INTR); /* Rising edge */

            int_debounce = BIT(PIN_INTR); /* Debounce enabled */

            int_bothedge = 0x0;   /* Both edge disabled */

            callback = gpio_example_callback;


            QM_GPIO_0, &cfg);


            /* Set PIN_OUT to trigger PIN_INTR interrupt */

            QM_GPIO_0, PIN_OUT);


            QM_GPIO_0, PIN_OUT);


            and your callback




            void gpio_example_callback(uint32_t status)


            callback_invoked = true;

            QM_PRINTF("GPIO callback - status register = 0x%u\n", status);

            qm_gpio_clear_pin(QM_GPIO_0, PIN_OUT);