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

PIR interrupt example #43

Open
mikewen opened this issue Feb 19, 2021 · 3 comments
Open

PIR interrupt example #43

mikewen opened this issue Feb 19, 2021 · 3 comments

Comments

@mikewen
Copy link

mikewen commented Feb 19, 2021

How to use PIR interrupt?

Which pins can be used for PIR detection?

Thanks!

@gamelaster
Copy link

gamelaster commented Feb 19, 2021

Hi @mikewen , there is huge chance that the reply from developers will be delayed, due they celebrating Chinese New Year.
(EDIT: I guess I was wrong. Bouffalo developers are such a nice people 😊)

@YafeiJin
Copy link
Contributor

@mikewen If you want to wake up BL602 by one GPIO which is connected to one external PIR, please add the following into bl_factory_params_IoTKitA_40M.dts

    gpio7 {
        status = "okay";
        pin = <7>;
        feature = "button";
        active = "Hi";
        mode = "multipress";
        button {
            debounce = <10>;
            short_press_ms {
                start = <100>;
                end = <3000>;
                kevent = <2>;
            };
            long_press_ms {
                start = <6000>;
                end = <10000>;
                kevent = <3>;
            };
            longlong_press_ms {
                start = <15000>;
                kevent = <4>;
            };
            trig_level = "Hi";
        };
        hbn_use = "okay";
    };

Then call hal_hbn_enter in code.
Please double check the GPIO7 is not PULL-UP with your board, cause GPIO7 is used as UART RX by default. Maybe you need some rework. Thanks

@mikewen
Copy link
Author

mikewen commented Feb 19, 2021

@YafeiJin Thank you!

What does hal_hbn_enter do?
I guess use hal_hbn_enter to enter the sleep mode? (stand for 'hal hibernate enter' ?)

This was referenced Mar 23, 2023
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

3 participants