Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve conflict with ESP32 arduino boards. resolves #3 #11

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ The BMI088 accelerometer features two interrupt pins that the data ready interru

| Pin Mode | Name |
| ---------- | ---------- |
| Push-Pull | PUSH_PULL |
| Open-Drain | OPEN_DRAIN |
| Push-Pull | PM_PUSH_PULL |
| Open-Drain | PM_OPEN_DRAIN |

| Active Level | Name |
| ------------ | ----------- |
Expand All @@ -119,7 +119,7 @@ Below is an example of setting the interrupt pin 1 to push-pull and active-high.

```C++
bool status;
status = accel.pinModeInt1(Bmi088Accel::PUSH_PULL,Bmi088Accel::ACTIVE_HIGH);
status = accel.pinModeInt1(Bmi088Accel::PM_PUSH_PULL,Bmi088Accel::ACTIVE_HIGH);
```

**(optional) mapDrdyInt1(bool enable)**
Expand Down Expand Up @@ -253,8 +253,8 @@ The BMI088 gyro features two interrupt pins that the data ready interrupt can be

| Pin Mode | Name |
| ---------- | ---------- |
| Push-Pull | PUSH_PULL |
| Open-Drain | OPEN_DRAIN |
| Push-Pull | PM_PUSH_PULL |
| Open-Drain | PM_OPEN_DRAIN |

| Active Level | Name |
| ------------ | ----------- |
Expand All @@ -265,7 +265,7 @@ Below is an example of setting the interrupt pin 3 to push-pull and active-high.

```C++
bool status;
status = gyro.pinModeInt3(Bmi088Gyro::PUSH_PULL,Bmi088Gyro::ACTIVE_HIGH);
status = gyro.pinModeInt3(Bmi088Gyro::PM_PUSH_PULL,Bmi088Gyro::ACTIVE_HIGH);
```

**(optional) mapDrdyInt3(bool enable)**
Expand Down Expand Up @@ -416,8 +416,8 @@ The BMI088 synchronized data interrupt pin can be setup with respect to whether

| Pin Mode | Name |
| ---------- | ---------- |
| Push-Pull | PUSH_PULL |
| Open-Drain | OPEN_DRAIN |
| Push-Pull | PM_PUSH_PULL |
| Open-Drain | PM_OPEN_DRAIN |

| Active Level | Name |
| ------------ | ----------- |
Expand All @@ -428,7 +428,7 @@ Below is an example of setting the interrupt to push-pull and active-high.

```C++
bool status;
status = bmi.pinModeDrdy(Bmi088::PUSH_PULL,Bmi088::ACTIVE_HIGH);
status = bmi.pinModeDrdy(Bmi088::PM_PUSH_PULL,Bmi088::ACTIVE_HIGH);
```

### Common Data Collection Functions
Expand Down
30 changes: 15 additions & 15 deletions src/BMI088.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -938,11 +938,11 @@ bool Bmi088Accel::pinModeInt1(PinIO io, PinMode mode, PinLevel level)
}
}
switch (mode) {
case PUSH_PULL: {
case PM_PUSH_PULL: {
pin_mode = ACC_INT_PUSHPULL;
break;
}
case OPEN_DRAIN: {
case PM_OPEN_DRAIN: {
pin_mode = ACC_INT_OPENDRAIN;
break;
}
Expand Down Expand Up @@ -993,11 +993,11 @@ bool Bmi088Accel::pinModeInt2(PinIO io, PinMode mode, PinLevel level)
}
}
switch (mode) {
case PUSH_PULL: {
case PM_PUSH_PULL: {
pin_mode = ACC_INT_PUSHPULL;
break;
}
case OPEN_DRAIN: {
case PM_OPEN_DRAIN: {
pin_mode = ACC_INT_OPENDRAIN;
break;
}
Expand Down Expand Up @@ -1309,11 +1309,11 @@ bool Bmi088Gyro::pinModeInt3(PinMode mode, PinLevel level)
uint8_t pin_mode, active_lvl;
readRegisters(GYRO_INT3_IO_CTRL_ADDR,1,&readReg);
switch (mode) {
case PUSH_PULL: {
case PM_PUSH_PULL: {
pin_mode = GYRO_INT_PUSHPULL;
break;
}
case OPEN_DRAIN: {
case PM_OPEN_DRAIN: {
pin_mode = GYRO_INT_OPENDRAIN;
break;
}
Expand Down Expand Up @@ -1350,11 +1350,11 @@ bool Bmi088Gyro::pinModeInt4(PinMode mode, PinLevel level)
uint8_t pin_mode, active_lvl;
readRegisters(GYRO_INT4_IO_CTRL_ADDR,1,&readReg);
switch (mode) {
case PUSH_PULL: {
case PM_PUSH_PULL: {
pin_mode = GYRO_INT_PUSHPULL;
break;
}
case OPEN_DRAIN: {
case PM_OPEN_DRAIN: {
pin_mode = GYRO_INT_OPENDRAIN;
break;
}
Expand Down Expand Up @@ -1566,7 +1566,7 @@ int Bmi088::begin()
return -5000;
}
// set default drdy pin settings
if (!pinModeDrdy(PUSH_PULL,ACTIVE_HIGH)) {
if (!pinModeDrdy(PM_PUSH_PULL,ACTIVE_HIGH)) {
return -6000;
}
return 1;
Expand Down Expand Up @@ -1636,23 +1636,23 @@ bool Bmi088::mapDrdy(DrdyPin pin)
{
switch (pin) {
case PIN_1: {
if(!accel->pinModeInt2(Bmi088Accel::PIN_INPUT,Bmi088Accel::PUSH_PULL,Bmi088Accel::ACTIVE_HIGH)) {
if(!accel->pinModeInt2(Bmi088Accel::PIN_INPUT,Bmi088Accel::PM_PUSH_PULL,Bmi088Accel::ACTIVE_HIGH)) {
return false;
}
accel->writeRegister(ACC_INT1_MAP_ADDR,ACC_INTA_ENABLE);
drdy_pin = 1;
return true;
}
case PIN_2: {
if(!accel->pinModeInt1(Bmi088Accel::PIN_INPUT,Bmi088Accel::PUSH_PULL,Bmi088Accel::ACTIVE_HIGH)) {
if(!accel->pinModeInt1(Bmi088Accel::PIN_INPUT,Bmi088Accel::PM_PUSH_PULL,Bmi088Accel::ACTIVE_HIGH)) {
return false;
}
accel->writeRegister(ACC_INT2_MAP_ADDR,ACC_INTA_ENABLE);
drdy_pin = 2;
return true;
}
default: {
if(!accel->pinModeInt1(Bmi088Accel::PIN_INPUT,Bmi088Accel::PUSH_PULL,Bmi088Accel::ACTIVE_HIGH)) {
if(!accel->pinModeInt1(Bmi088Accel::PIN_INPUT,Bmi088Accel::PM_PUSH_PULL,Bmi088Accel::ACTIVE_HIGH)) {
return false;
}
accel->writeRegister(ACC_INT2_MAP_ADDR,ACC_INTA_ENABLE);
Expand Down Expand Up @@ -1690,7 +1690,7 @@ bool Bmi088::mapSync(SyncPin pin)
{
switch (pin) {
case PIN_3: {
if (!gyro->pinModeInt3(Bmi088Gyro::PUSH_PULL,Bmi088Gyro::ACTIVE_HIGH)) {
if (!gyro->pinModeInt3(Bmi088Gyro::PM_PUSH_PULL,Bmi088Gyro::ACTIVE_HIGH)) {
return false;
}
if (!gyro->mapDrdyInt3(true)) {
Expand All @@ -1699,7 +1699,7 @@ bool Bmi088::mapSync(SyncPin pin)
return true;
}
case PIN_4: {
if (!gyro->pinModeInt4(Bmi088Gyro::PUSH_PULL,Bmi088Gyro::ACTIVE_HIGH)) {
if (!gyro->pinModeInt4(Bmi088Gyro::PM_PUSH_PULL,Bmi088Gyro::ACTIVE_HIGH)) {
return false;
}
if (!gyro->mapDrdyInt4(true)) {
Expand All @@ -1708,7 +1708,7 @@ bool Bmi088::mapSync(SyncPin pin)
return true;
}
default: {
if (!gyro->pinModeInt3(Bmi088Gyro::PUSH_PULL,Bmi088Gyro::ACTIVE_HIGH)) {
if (!gyro->pinModeInt3(Bmi088Gyro::PM_PUSH_PULL,Bmi088Gyro::ACTIVE_HIGH)) {
return false;
}
if (!gyro->mapDrdyInt3(true)) {
Expand Down
12 changes: 6 additions & 6 deletions src/BMI088.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ class Bmi088Accel {
ODR_12_5HZ_BW_1HZ
};
enum PinMode {
PUSH_PULL,
OPEN_DRAIN
PM_PUSH_PULL,
PM_OPEN_DRAIN
};
enum PinLevel {
ACTIVE_HIGH,
Expand Down Expand Up @@ -224,8 +224,8 @@ class Bmi088Gyro {
ODR_100HZ_BW_32HZ = 0x87
};
enum PinMode {
PUSH_PULL,
OPEN_DRAIN
PM_PUSH_PULL,
PM_OPEN_DRAIN
};
enum PinLevel {
ACTIVE_HIGH,
Expand Down Expand Up @@ -359,8 +359,8 @@ class Bmi088 {
PIN_4
};
enum PinMode {
PUSH_PULL,
OPEN_DRAIN
PM_PUSH_PULL,
PM_OPEN_DRAIN
};
enum PinLevel {
ACTIVE_HIGH,
Expand Down