bl_iot_sdk
bl_iot_sdk copied to clipboard
PIR interrupt example
How to use PIR interrupt?
Which pins can be used for PIR detection?
Thanks!
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 😊)
@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
@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' ?)