Skip to content

Commit

Permalink
[nRF52] further build update
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Jul 23, 2024
1 parent 91a31af commit eec49ff
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
2 changes: 2 additions & 0 deletions software/firmware/source/SoftRF/SoftRF.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ enum
SOFTRF_MODEL_MIDI,
SOFTRF_MODEL_ECO,
SOFTRF_MODEL_INK,
SOFTRF_MODEL_CARD,
SOFTRF_MODEL_NEO,
};

Expand Down Expand Up @@ -254,6 +255,7 @@ enum
IMU_NONE,
ACC_BMA423,
ACC_ADXL362,
ACC_QMA6100P,
IMU_MPU6886,
IMU_MPU9250,
IMU_BNO080,
Expand Down
30 changes: 27 additions & 3 deletions software/firmware/source/SoftRF/src/platform/nRF52.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,22 @@ static void nRF52_setup()
// digitalWrite(OTG_ENABLE_PIN, HIGH);
} else {
Wire.end();

#if !defined(EXCLUDE_IMU)
#if !defined(ARDUINO_ARCH_MBED)
Wire.setPins(SOC_GPIO_PIN_T1000_SDA, SOC_GPIO_PIN_T1000_SCL);
#endif /* ARDUINO_ARCH_MBED */
Wire.begin();
Wire.beginTransmission(QMA6100P_ADDRESS);
nRF52_has_imu = (Wire.endTransmission() == 0);
if (nRF52_has_imu) {
nRF52_board = NRF52_SEEED_T1000;
hw_info.model = SOFTRF_MODEL_CARD;
hw_info.imu = ACC_QMA6100P;
nRF52_Device_Model = "Card Edition";
}
Wire.end();
#endif /* EXCLUDE_IMU */
}
#endif /* EXCLUDE_PMU */

Expand All @@ -713,6 +729,9 @@ static void nRF52_setup()
case NRF52_LILYGO_TULTIMA:
/* TBD */
break;
case NRF52_SEEED_T1000:
Serial1.setPins(SOC_GPIO_PIN_CONS_T1000_RX, SOC_GPIO_PIN_CONS_T1000_TX);
break;
case NRF52_LILYGO_TECHO_REV_0:
case NRF52_LILYGO_TECHO_REV_1:
case NRF52_LILYGO_TECHO_REV_2:
Expand Down Expand Up @@ -750,6 +769,9 @@ static void nRF52_setup()
case NRF52_LILYGO_TULTIMA:
Wire.setPins(SOC_GPIO_PIN_TULTIMA_SDA, SOC_GPIO_PIN_TULTIMA_SCL);
break;
case NRF52_SEEED_T1000:
Wire.setPins(SOC_GPIO_PIN_T1000_SDA, SOC_GPIO_PIN_T1000_SCL);
break;
case NRF52_LILYGO_TECHO_REV_0:
case NRF52_LILYGO_TECHO_REV_1:
case NRF52_LILYGO_TECHO_REV_2:
Expand All @@ -775,11 +797,13 @@ static void nRF52_setup()
}

#if !defined(EXCLUDE_IMU)
Wire.beginTransmission(MPU9250_ADDRESS);
nRF52_has_imu = (Wire.endTransmission() == 0);
if (nRF52_has_imu == false) {
Wire.beginTransmission(ICM20948_ADDRESS);
Wire.beginTransmission(MPU9250_ADDRESS);
nRF52_has_imu = (Wire.endTransmission() == 0);
if (nRF52_has_imu == false) {
Wire.beginTransmission(ICM20948_ADDRESS);
nRF52_has_imu = (Wire.endTransmission() == 0);
}
}
#endif /* EXCLUDE_IMU */

Expand Down
1 change: 1 addition & 0 deletions software/firmware/source/SoftRF/src/platform/nRF52.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ struct rst_info {
#define BME280_ADDRESS (0x77)
#define MPU9250_ADDRESS (0x68)
#define ICM20948_ADDRESS (0x68)
#define QMA6100P_ADDRESS (0x12) // 0x13 when AD0 = HIGH

#if defined(ARDUINO_ARCH_MBED)
#define PCF8563_SLAVE_ADDRESS (0x51)
Expand Down

0 comments on commit eec49ff

Please sign in to comment.