2018-10-21 19:00:20 +02:00
|
|
|
#ifndef _LOPY4_H
|
|
|
|
#define _LOPY4_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2018-09-28 08:26:37 +02:00
|
|
|
// Hardware related definitions for Pycom LoPy4 Board
|
2018-03-18 19:45:17 +01:00
|
|
|
|
2018-08-11 19:12:04 +02:00
|
|
|
#define HAS_LORA 1 // comment out if device shall not send data via LoRa
|
2018-11-04 12:25:50 +01:00
|
|
|
|
2018-08-11 19:12:04 +02:00
|
|
|
#define HAS_SPI 1 // comment out if device shall not send data via SPI
|
2018-11-04 12:25:50 +01:00
|
|
|
// pin definitions for local wired SPI slave interface
|
2018-11-04 13:58:35 +01:00
|
|
|
#define SPI_MOSI GPIO_NUM_22
|
|
|
|
#define SPI_MISO GPIO_NUM_33
|
|
|
|
#define SPI_SCLK GPIO_NUM_26
|
|
|
|
#define SPI_CS GPIO_NUM_36
|
2018-09-11 16:15:39 +02:00
|
|
|
|
2018-03-18 19:45:17 +01:00
|
|
|
#define CFG_sx1276_radio 1
|
2018-09-30 18:02:05 +02:00
|
|
|
//#define HAS_LED NOT_A_PIN // LoPy4 has no on board mono LED, we use on board RGB LED
|
2018-10-21 19:00:20 +02:00
|
|
|
#define HAS_RGB_LED (0) // WS2812B RGB LED on GPIO0 (P2)
|
2018-07-08 12:24:13 +02:00
|
|
|
#define BOARD_HAS_PSRAM // use extra 4MB extern RAM
|
2018-03-18 19:45:17 +01:00
|
|
|
|
2018-10-21 22:24:45 +02:00
|
|
|
// Pins for LORA chip SPI interface, reset line and interrupt lines
|
2018-10-21 22:16:29 +02:00
|
|
|
#define LORA_SCK (5)
|
|
|
|
#define LORA_CS (18)
|
|
|
|
#define LORA_MISO (19)
|
|
|
|
#define LORA_MOSI (27)
|
|
|
|
#define LORA_RST LMIC_UNUSED_PIN
|
2018-11-20 15:02:37 +01:00
|
|
|
#define LORA_IRQ (23) // LoRa IRQ
|
2018-10-21 22:16:29 +02:00
|
|
|
#define LORA_IO1 (23) // Pin tied via diode to DIO0
|
|
|
|
#define LORA_IO2 (23) // Pin tied via diode to DIO0
|
2018-03-18 19:45:17 +01:00
|
|
|
|
|
|
|
// select WIFI antenna (internal = onboard / external = u.fl socket)
|
2018-10-21 19:00:20 +02:00
|
|
|
#define HAS_ANTENNA_SWITCH (21) // pin for switching wifi antenna (P12)
|
2018-10-06 21:37:27 +02:00
|
|
|
#define WIFI_ANTENNA 0 // 0 = internal, 1 = external
|
2018-06-24 11:17:55 +02:00
|
|
|
|
2018-09-29 19:26:24 +02:00
|
|
|
// uncomment this only if your LoPy runs on a PYTRACK BOARD
|
2018-06-24 11:17:55 +02:00
|
|
|
//#define HAS_GPS 1
|
2018-10-20 09:58:53 +02:00
|
|
|
//#define GPS_I2C GPIO_NUM_25, GPIO_NUM_26 // SDA (P22), SCL (P21)
|
2018-06-24 11:17:55 +02:00
|
|
|
//#define GPS_ADDR 0x10
|
|
|
|
|
2018-09-29 19:26:24 +02:00
|
|
|
// uncomment this only if your LoPy runs on a EXPANSION BOARD
|
2018-10-21 19:00:20 +02:00
|
|
|
#define HAS_LED (12) // use if LoPy is on Expansion Board, this has a user LED
|
2018-09-30 17:48:51 +02:00
|
|
|
#define LED_ACTIVE_LOW 1 // use if LoPy is on Expansion Board, this has a user LED
|
2018-10-21 19:00:20 +02:00
|
|
|
#define HAS_BUTTON (13) // user button on expansion board
|
2018-09-30 17:48:51 +02:00
|
|
|
#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
|
2018-10-21 19:00:20 +02:00
|
|
|
//#define BATT_FACTOR 4 // voltage divider 115kOhm/56kOhm -> expansion board 2.0
|
|
|
|
|
|
|
|
#endif
|