diff --git a/src/hal/heltec.h b/src/hal/heltec.h index 761d2b2c..1e6dd174 100644 --- a/src/hal/heltec.h +++ b/src/hal/heltec.h @@ -24,5 +24,12 @@ // additional definitions for LMIC #define LORA_IO1 (33) #define LORA_IO2 LMIC_UNUSED_PIN +#define LORA_SCK (5) +#define LORA_MOSI (27) +#define LORA_MISO (19) +#define LORA_CS (18) +#define LORA_RST (14) +#define LORA_IRQ (26) + #endif diff --git a/src/hal/heltecv2.h b/src/hal/heltecv2.h index a07147e2..40d1f266 100644 --- a/src/hal/heltecv2.h +++ b/src/hal/heltecv2.h @@ -26,5 +26,11 @@ // additional definitions for LMIC #define LORA_IO1 (35) #define LORA_IO2 (34) +#define LORA_SCK (5) +#define LORA_MOSI (27) +#define LORA_MISO (19) +#define LORA_CS (18) +#define LORA_RST (14) +#define LORA_IRQ (26) #endif diff --git a/src/hal/lopy.h b/src/hal/lopy.h index 83ba8290..55699366 100644 --- a/src/hal/lopy.h +++ b/src/hal/lopy.h @@ -1,37 +1,37 @@ -// clang-format off - -#ifndef _LOPY_H -#define _LOPY_H - -#include - -// Hardware related definitions for Pycom LoPy Board (NOT LoPy4) - -#define HAS_LORA 1 // comment out if device shall not send data via LoRa -#define CFG_sx1272_radio 1 -#define HAS_LED NOT_A_PIN // LoPy4 has no on board mono LED, we use on board RGB LED -#define HAS_RGB_LED (0) // WS2812B RGB LED on GPIO0 - -// Pins for LORA chip SPI interface come from board file, we need some -// additional definitions for LMIC -#define LORA_IRQ (23) - -// select WIFI antenna (internal = onboard / external = u.fl socket) -#define HAS_ANTENNA_SWITCH (16) // pin for switching wifi antenna -#define WIFI_ANTENNA 0 // 0 = internal, 1 = external - -// uncomment this only if your LoPy runs on a PYTRACK BOARD -#define HAS_GPS 1 -#define GPS_I2C GPIO_NUM_25, GPIO_NUM_26 // SDA (P22), SCL (P21) -#define GPS_ADDR 0x10 - -// uncomment this only if your LoPy runs on a EXPANSION BOARD -//#define HAS_LED (12) // use if LoPy is on Expansion Board, this has a user LED -//#define LED_ACTIVE_LOW 1 // use if LoPy is on Expansion Board, this has a user LED -//#define HAS_BUTTON (13) // user button on expansion board -//#define BUTTON_PULLUP 1 // Button need pullup instead of default pulldown -//#define HAS_BATTERY_PROBE ADC1_GPIO39_CHANNEL // battery probe GPIO pin -> ADC1_CHANNEL_7 -//#define BATT_FACTOR 2 // voltage divider 1MOhm/1MOhm -> expansion board 3.0 -//#define BATT_FACTOR 4 // voltage divider 115kOhm/56kOhm -> expansion board 2.0 - -#endif +// clang-format off + +#ifndef _LOPY_H +#define _LOPY_H + +#include + +// Hardware related definitions for Pycom LoPy Board (NOT LoPy4) + +#define HAS_LORA 1 // comment out if device shall not send data via LoRa +#define CFG_sx1272_radio 1 +#define HAS_LED NOT_A_PIN // LoPy4 has no on board mono LED, we use on board RGB LED +#define HAS_RGB_LED (0) // WS2812B RGB LED on GPIO0 + +// Pins for LORA chip SPI interface come from board file, we need some +// additional definitions for LMIC +#define LORA_IRQ (23) + +// select WIFI antenna (internal = onboard / external = u.fl socket) +#define HAS_ANTENNA_SWITCH (16) // pin for switching wifi antenna +#define WIFI_ANTENNA 0 // 0 = internal, 1 = external + +// uncomment this only if your LoPy runs on a PYTRACK BOARD +#define HAS_GPS 1 +#define GPS_I2C GPIO_NUM_25, GPIO_NUM_26 // SDA (P22), SCL (P21) +#define GPS_ADDR 0x10 + +// uncomment this only if your LoPy runs on a EXPANSION BOARD +//#define HAS_LED (12) // use if LoPy is on Expansion Board, this has a user LED +//#define LED_ACTIVE_LOW 1 // use if LoPy is on Expansion Board, this has a user LED +//#define HAS_BUTTON (13) // user button on expansion board +//#define BUTTON_PULLUP 1 // Button need pullup instead of default pulldown +//#define HAS_BATTERY_PROBE ADC1_GPIO39_CHANNEL // battery probe GPIO pin -> ADC1_CHANNEL_7 +//#define BATT_FACTOR 2 // voltage divider 1MOhm/1MOhm -> expansion board 3.0 +//#define BATT_FACTOR 4 // voltage divider 115kOhm/56kOhm -> expansion board 2.0 + +#endif diff --git a/src/hal/lopy4.h b/src/hal/lopy4.h index e7ef88ba..242fe275 100644 --- a/src/hal/lopy4.h +++ b/src/hal/lopy4.h @@ -1,48 +1,48 @@ -// clang-format off - -#ifndef _LOPY4_H -#define _LOPY4_H - -#include - -// Hardware related definitions for Pycom LoPy4 Board - -#define HAS_LORA 1 // comment out if device shall not send data via LoRa - -//#defin HAS_SPI 1 // comment out if device shall not send data via SPI -// pin definitions for local wired SPI slave interface -//#define SPI_MOSI GPIO_NUM_22 -//#define SPI_MISO GPIO_NUM_33 -//#define SPI_SCLK GPIO_NUM_26 -//#define SPI_CS GPIO_NUM_36 - -#define CFG_sx1276_radio 1 -//#define HAS_LED NOT_A_PIN // LoPy4 has no on board mono LED, we use on board RGB LED -#define HAS_RGB_LED (0) // WS2812B RGB LED on GPIO0 (P2) -#define BOARD_HAS_PSRAM // use extra 4MB extern RAM - -// Pins for LORA chip SPI interface come from board file, we need some -// additional definitions for LMIC -#define LORA_IRQ (23) -#define LORA_RST NOT_A_PIN -#define SS 18 - -// select WIFI antenna (internal = onboard / external = u.fl socket) -#define HAS_ANTENNA_SWITCH (21) // pin for switching wifi antenna (P12) -#define WIFI_ANTENNA 0 // 0 = internal, 1 = external - -// uncomment this only if your LoPy runs on a PYTRACK BOARD -//#define HAS_GPS 1 -//#define GPS_I2C GPIO_NUM_25, GPIO_NUM_26 // SDA (P22), SCL (P21) -//#define GPS_ADDR 0x10 - -// uncomment this only if your LoPy runs on a EXPANSION BOARD -#define HAS_LED (12) // use if LoPy is on Expansion Board, this has a user LED -#define LED_ACTIVE_LOW 1 // use if LoPy is on Expansion Board, this has a user LED -#define HAS_BUTTON (13) // user button on expansion board -#define BUTTON_PULLUP 1 // Button need pullup instead of default pulldown -#define HAS_BATTERY_PROBE ADC1_GPIO39_CHANNEL // battery probe GPIO pin -> ADC1_CHANNEL_7 -#define BATT_FACTOR 2 // voltage divider 1MOhm/1MOhm -> expansion board 3.0 -//#define BATT_FACTOR 4 // voltage divider 115kOhm/56kOhm -> expansion board 2.0 - +// clang-format off + +#ifndef _LOPY4_H +#define _LOPY4_H + +#include + +// Hardware related definitions for Pycom LoPy4 Board + +#define HAS_LORA 1 // comment out if device shall not send data via LoRa + +//#defin HAS_SPI 1 // comment out if device shall not send data via SPI +// pin definitions for local wired SPI slave interface +//#define SPI_MOSI GPIO_NUM_22 +//#define SPI_MISO GPIO_NUM_33 +//#define SPI_SCLK GPIO_NUM_26 +//#define SPI_CS GPIO_NUM_36 + +#define CFG_sx1276_radio 1 +//#define HAS_LED NOT_A_PIN // LoPy4 has no on board mono LED, we use on board RGB LED +#define HAS_RGB_LED (0) // WS2812B RGB LED on GPIO0 (P2) +#define BOARD_HAS_PSRAM // use extra 4MB extern RAM + +// Pins for LORA chip SPI interface come from board file, we need some +// additional definitions for LMIC +#define LORA_IRQ (23) +#define LORA_RST NOT_A_PIN +#define SS 18 + +// select WIFI antenna (internal = onboard / external = u.fl socket) +#define HAS_ANTENNA_SWITCH (21) // pin for switching wifi antenna (P12) +#define WIFI_ANTENNA 0 // 0 = internal, 1 = external + +// uncomment this only if your LoPy runs on a PYTRACK BOARD +//#define HAS_GPS 1 +//#define GPS_I2C GPIO_NUM_25, GPIO_NUM_26 // SDA (P22), SCL (P21) +//#define GPS_ADDR 0x10 + +// uncomment this only if your LoPy runs on a EXPANSION BOARD +#define HAS_LED (12) // use if LoPy is on Expansion Board, this has a user LED +#define LED_ACTIVE_LOW 1 // use if LoPy is on Expansion Board, this has a user LED +#define HAS_BUTTON (13) // user button on expansion board +#define BUTTON_PULLUP 1 // Button need pullup instead of default pulldown +#define HAS_BATTERY_PROBE ADC1_GPIO39_CHANNEL // battery probe GPIO pin -> ADC1_CHANNEL_7 +#define BATT_FACTOR 2 // voltage divider 1MOhm/1MOhm -> expansion board 3.0 +//#define BATT_FACTOR 4 // voltage divider 115kOhm/56kOhm -> expansion board 2.0 + #endif \ No newline at end of file