Skip to content

Commit

Permalink
[nRF52] bring up of I2C air pressure sensor with Cozy Edition
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Sep 18, 2024
1 parent 5c4fe18 commit 888edae
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
4 changes: 2 additions & 2 deletions software/firmware/source/SkyWatch/Platform_ESP32.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ extern PCF8563_Class *rtc;

#undef SOC_GPIO_PIN_GNSS_RX
#undef SOC_GPIO_PIN_GNSS_TX
#define SOC_GPIO_PIN_GNSS_RX SOC_GPIO_PIN_TULTIMA_ESP_MOSI
#define SOC_GPIO_PIN_GNSS_TX SOC_GPIO_PIN_TULTIMA_ESP_MISO
#define SOC_GPIO_PIN_GNSS_RX SOC_GPIO_PIN_TULTIMA_ESP_HS
#define SOC_GPIO_PIN_GNSS_TX SOC_GPIO_PIN_TULTIMA_ESP_DR

extern IODev_ops_t ArdBLE_Bluetooth_ops;
#endif /* CONFIG_IDF_TARGET_ESP32C6 */
Expand Down
10 changes: 7 additions & 3 deletions software/firmware/source/SoftRF/src/platform/iomap/Heltec_T114.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@
#define SOC_GPIO_PIN_T114_DIO1 _PINNUM(0, 20) // P0.20
#define SOC_GPIO_PIN_T114_BUSY _PINNUM(0, 17) // P0.17

/* I2C */
#define SOC_GPIO_PIN_T114_SDA _PINNUM(0, 26) // P0.26
#define SOC_GPIO_PIN_T114_SCL _PINNUM(0, 27) // P0.27
/* I2C int. (same that T-Echo has) */
#define SOC_GPIO_PIN_T114_SDA_INT _PINNUM(0, 26) // P0.26
#define SOC_GPIO_PIN_T114_SCL_INT _PINNUM(0, 27) // P0.27

/* I2C ext. (air pressure sensor) */
#define SOC_GPIO_PIN_T114_SDA_EXT _PINNUM(0, 16) // P0.16
#define SOC_GPIO_PIN_T114_SCL_EXT _PINNUM(0, 13) // P0.13

/* button */
#define SOC_GPIO_PIN_T114_BUTTON _PINNUM(1, 10) // P1.10
Expand Down
21 changes: 20 additions & 1 deletion software/firmware/source/SoftRF/src/platform/nRF52.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ static void nRF52_setup()
case NRF52_LILYGO_TECHO_REV_1:
case NRF52_LILYGO_TECHO_REV_2:
case NRF52_NORDIC_PCA10059:
case NRF52_HELTEC_T114:
case NRF52_HELTEC_T114: /* internal bus */
default:
Wire.setPins(SOC_GPIO_PIN_SDA, SOC_GPIO_PIN_SCL);
break;
Expand Down Expand Up @@ -880,6 +880,10 @@ static void nRF52_setup()
nRF52_board = NRF52_HELTEC_T114;
hw_info.model = SOFTRF_MODEL_COZY;
nRF52_Device_Model = "Cozy Edition";
#if !defined(ARDUINO_ARCH_MBED)
/* external bus */
Wire.setPins(SOC_GPIO_PIN_T114_SDA_EXT, SOC_GPIO_PIN_T114_SCL_EXT);
#endif /* ARDUINO_ARCH_MBED */
}
#endif /* USE_TFT */

Expand Down Expand Up @@ -1758,6 +1762,21 @@ static void nRF52_fini(int reason)
pinMode(SOC_GPIO_PIN_SFL_SS, INPUT);
break;

case NRF52_LILYGO_TULTIMA:
#if !defined(ARDUINO_ARCH_MBED)
if (nRF52_has_extension) {
xl9555->pinMode(ExtensionIOXL9555::I2C_EXP_PIN_GNSS_TULTIMA_PWR, INPUT);
xl9555->pinMode(ExtensionIOXL9555::I2C_EXP_PIN_SENS_TULTIMA_PWR, INPUT);
xl9555->pinMode(ExtensionIOXL9555::I2C_EXP_PIN_LORA_TULTIMA_PWR, INPUT);
xl9555->pinMode(ExtensionIOXL9555::I2C_EXP_PIN_WIFI_TULTIMA_PWR, INPUT);

xl9555->pinMode(ExtensionIOXL9555::I2C_EXP_PIN_MOTOR_TULTIMA_EN, INPUT);
xl9555->pinMode(ExtensionIOXL9555::I2C_EXP_PIN_AMP_TULTIMA_EN, INPUT);
xl9555->deinit();
}
#endif /* ARDUINO_ARCH_MBED */
break;

case NRF52_NORDIC_PCA10059:
default:
// ledOff(SOC_GPIO_LED_PCA10059_GREEN);
Expand Down

0 comments on commit 888edae

Please sign in to comment.