Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] GPIOIF example #41

Open
m4tto opened this issue Jun 7, 2021 · 1 comment
Open

[Question] GPIOIF example #41

m4tto opened this issue Jun 7, 2021 · 1 comment

Comments

@m4tto
Copy link

m4tto commented Jun 7, 2021

Do you have a running example with GPIOIF in capture counter mode? I cannot make it working and no interrupt is generated.

These are the initialization instructions:

mtk_os_hal_gpioif_ctlr_init(group);

// Register callback function
mtk_os_hal_gpioif_int_callback_register(group, CAP_callback, NULL);

// Disable de-glitch 
mtk_os_hal_gpioif_de_glitch(group, 0, 0, 0, 0); 
mtk_os_hal_gpioif_de_glitch(group, 1, 0, 0, 0); 

// Configure capture
mtk_os_hal_gpioif_set_capture_mode(group, 
                                   MHAL_GPIOIF_GPIO_0_BOTH_RISING_FALLING, 
                                   MHAL_GPIOIF_GPIO_1_BOTH_RISING_FALLING, 
                                   MHAL_GPIOIF_CLOCK_32KHZ);                // Possible values 32KHz, 26MHz, 125MHz, 200MHz 

mtk_os_hal_gpioif_interrupt_control(group, 1, 1, IRQ_GPIOIF_CFIFO0_NOT_EMPTY|IRQ_GPIOIF_CFIFO1_NOT_EMPTY); 

Do I have to set something in the app_manifest?

@LawranceLiu
Copy link
Contributor

Please refer to the sample code:
98d4c91

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants