weixin_39782752
2020-12-09 10:01Interrupt Functions
Interrupt Codes: ACC_NM - Accelerometer No Motion ACC_SM - Accelerometer Slow Motion ACC_AM - Accelerometer Any Motion ACC_HIGH_G - Accelerometer High G GYR_HIGH_RATE - Gyroscope High Rate GYRO_AM - Gyroscope Any Motion
enableInterrupts() takes the type of interrupt code, such as ACC_NM (Accelerometer No Motion), and whether the developer wants the INT pin to trigger as two arguments.
enableInterruptAxes() takes the interrupt code, and the axes to allow to trigger it, as two arguments and enables them. Currently there is no 'disable' function but this is due.
setIntThreshold() takes the interrupt code and a threshold value, as well as a string to define the axis and sets the input to exceed in order to trigger an interrupt. Each type of threshold is different for each code, so there is a serial output comment to reflect when the developer has set an invalid value. This can be made unnecessary by adding the function usage case to the Wiki.
setIntDuration() take the interrupt code and a duration value, as as a string to define the axes (not implemented currently), and sets the duration for which the threshold must be exceeded in order to trigger.
checkInterruptStates() is a sanity check for all interrupt registers, allowing the developer to drop this into their code and check setup and runtime behaviours.
readIntStatus() is best used as the callback function for the interrupt service routine, reading the status code from the INT_STA register.
clearInt() clears and resets the interrupt so the pin will return to it's previous level.
printWithZeros() ensures the register values are printed with their leading zeros.
该提问来源于开源项目:adafruit/Adafruit_BNO055
- 点赞
- 回答
- 收藏
- 复制链接分享
4条回答
为你推荐
- 尝试使用本地子模块时出现问题
- it技术
- 互联网问答
- IT行业问题
- 计算机技术
- 编程语言问答
- 1个回答
- pprof(用于golang)未显示我的软件包的详细信息
- it技术
- 互联网问答
- IT行业问题
- 计算机技术
- 编程语言问答
- 1个回答
- 转义从PHP生成的javascript对象中的引号
- json
- javascript
- mysql
- php
- 3个回答
- 利用这个设计六路互补spwm波能否实现,今天去实验室仿真没波形,完全没学过stm32的小白制作课程设计
- stm32f103
- 2个回答