weixin_39782752
weixin_39782752
2020-12-09 10:01

Interrupt 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条回答

为你推荐