這裡介紹一下BMA456 的any-motion detection中斷設定功能,BMA456 內建中斷觸發控制器,可以透過暫存器的設置來啟動any-motion detection的設置,當偵測到any-motion detection事件就可以透過指定的中斷輸出管腳來通知主控端,以達到any-motion detection 的偵測。
Any-motion detection是加速度計的一種應用,可以應用於裝置的喚醒功能。
要設置BMA456 any motion detection 的interrupt 必需要設置any motion detection 的致能方式,duration和 threshold 等暫存器。
設置方式如下所示:
要Enable any motion detection feature,需要致能FEATURES_IN.ANYMO_2.x_en,FEATURES_IN.ANYMO_2.y_en,FEATURES_IN.ANYMO_2.z_en,等致能位元。
Any-motion detection是加速度計的一種應用,可以應用於裝置的喚醒功能。
要設置BMA456 any motion detection 的interrupt 必需要設置any motion detection 的致能方式,duration和 threshold 等暫存器。
設置方式如下所示:
要Enable any motion detection feature,需要致能FEATURES_IN.ANYMO_2.x_en,FEATURES_IN.ANYMO_2.y_en,FEATURES_IN.ANYMO_2.z_en,等致能位元。
再來設置FEATURES_IN.ANYMO_1.duration, 可調整的範圍是0~163 秒。
也可調整下列FEATURES_IN.ANYMO_1.threshold 的暫存器來設置觸發any motion 的Threshold,可設置的範圍0~ 1 G。
再將any motion 的中斷輸出,指定為INT 1 , 需致能any_motion_out 位元。
設定訊號從INT 1 管腳輸出, 需將INT1_IO_CTRL 設定為為輸出的output_en 設定致能,
這樣any motion 中斷訊號就能透過INT1 的管腳來通知主控端。
評論