File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -2386,3 +2386,21 @@ uint8_t BMI160Class::getRegister(uint8_t reg) {
2386
2386
void BMI160Class::setRegister (uint8_t reg, uint8_t data) {
2387
2387
reg_write (reg, data);
2388
2388
}
2389
+
2390
+ /* * Check if new gyroscope data is available
2391
+ * @return True if new data is available, else false.
2392
+ */
2393
+ bool BMI160Class::gyroDataReady ()
2394
+ {
2395
+ return reg_read_bits (BMI160_RA_STATUS, BMI160_STATUS_DRDY_GYR, 1 );
2396
+ }
2397
+
2398
+ /* * Check if new accelerometer data is available
2399
+ * @return True if new data is available, else false.
2400
+ */
2401
+ bool BMI160Class::accelDataReady ()
2402
+ {
2403
+ return reg_read_bits (BMI160_RA_STATUS, BMI160_STATUS_DRDY_ACC, 1 );
2404
+ }
2405
+
2406
+
Original file line number Diff line number Diff line change @@ -652,6 +652,9 @@ class BMI160Class {
652
652
uint8_t getInterruptLatch ();
653
653
void setInterruptLatch (uint8_t latch);
654
654
void resetInterrupt ();
655
+
656
+ bool gyroDataReady ();
657
+ bool accelDataReady ();
655
658
656
659
protected:
657
660
virtual int serial_buffer_transfer (uint8_t *buf, unsigned tx_cnt, unsigned rx_cnt);
You can’t perform that action at this time.
0 commit comments