Skip to content

Commit 2568ccd

Browse files
committed
added getSWRevision(), and getBootloaderRevision()
1 parent 74a8a0b commit 2568ccd

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/BNO055ESP32.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,20 @@ void BNO055::disableExternalCrystal(){
343343
setExtCrystalUse(false);
344344
}
345345

346+
int16_t BNO055::getSWRevision(){
347+
setPage(0);
348+
uint8_t buffer[2];
349+
readLen(BNO055_REG_SW_REV_ID_LSB, 2, buffer);
350+
return (((int16_t)buffer[0]) | (((int16_t)buffer[1]) << 8));
351+
}
352+
353+
uint8_t BNO055::getBootloaderRevision(){
354+
setPage(0);
355+
uint8_t tmp;
356+
read8(BNO055_REG_BL_REV_ID, &tmp);
357+
return tmp;
358+
}
359+
346360
bno055_system_status_t BNO055::getSystemStatus(){
347361
setPage(0);
348362
uint8_t tmp;

src/BNO055ESP32.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,9 @@ class BNO055{
575575
bno055_vector_t getVectorGravity();
576576
bno055_quaternion_t getQuaternion();
577577

578+
int16_t getSWRevision();
579+
uint8_t getBootloaderRevision();
580+
578581
bno055_system_status_t getSystemStatus();
579582
bno055_self_test_result_t getSelfTestResult();
580583
bno055_system_error_t getSystemError();

0 commit comments

Comments
 (0)