kopia lustrzana https://github.com/meshtastic/firmware
				
				
				
			Wiphone (#3793)
* add wiphone, still WIP * (very preliminary) wiphone support * undo config changes * revert extensions.json * eh?pull/3803/head
							rodzic
							
								
									77a66e1dce
								
							
						
					
					
						commit
						353c7e07d1
					
				|  | @ -0,0 +1,34 @@ | ||||||
|  | { | ||||||
|  |   "build": { | ||||||
|  |     "arduino": { | ||||||
|  |       "ldscript": "esp32_out.ld", | ||||||
|  |       "partitions": "default_16MB.csv" | ||||||
|  |     }, | ||||||
|  |     "core": "esp32", | ||||||
|  |     "extra_flags": [ | ||||||
|  |       "-DARDUINO_WIPHONE14", | ||||||
|  |       "-DBOARD_HAS_PSRAM", | ||||||
|  |       "-mfix-esp32-psram-cache-issue", | ||||||
|  |       "-mfix-esp32-psram-cache-strategy=memw" | ||||||
|  |     ], | ||||||
|  |     "f_cpu": "240000000L", | ||||||
|  |     "f_flash": "40000000L", | ||||||
|  |     "flash_mode": "dio", | ||||||
|  |     "mcu": "esp32", | ||||||
|  |     "variant": "wiphone", | ||||||
|  |     "board": "WiPhone" | ||||||
|  |   }, | ||||||
|  |   "connectivity": ["wifi", "bluetooth"], | ||||||
|  |   "frameworks": ["arduino", "espidf"], | ||||||
|  |   "name": "WIPhone Integrated 1.4", | ||||||
|  |   "upload": { | ||||||
|  |     "flash_size": "16MB", | ||||||
|  |     "maximum_ram_size": 532480, | ||||||
|  |     "maximum_size": 6553600, | ||||||
|  |     "maximum_data_size": 4521984, | ||||||
|  |     "require_upload_port": true, | ||||||
|  |     "speed": 921600 | ||||||
|  |   }, | ||||||
|  |   "url": "https://www.wiphone.io/", | ||||||
|  |   "vendor": "HackEDA" | ||||||
|  | } | ||||||
|  | @ -8,6 +8,12 @@ | ||||||
| #define TFT_BACKLIGHT_ON HIGH | #define TFT_BACKLIGHT_ON HIGH | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  | #ifdef GPIO_EXTENDER | ||||||
|  | #include <SparkFunSX1509.h> | ||||||
|  | #include <Wire.h> | ||||||
|  | extern SX1509 gpioExtender; | ||||||
|  | #endif | ||||||
|  | 
 | ||||||
| #ifndef TFT_MESH | #ifndef TFT_MESH | ||||||
| #define TFT_MESH COLOR565(0x67, 0xEA, 0x94) | #define TFT_MESH COLOR565(0x67, 0xEA, 0x94) | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|  | @ -143,6 +143,8 @@ | ||||||
| #define HW_VENDOR meshtastic_HardwareModel_STATION_G2 | #define HW_VENDOR meshtastic_HardwareModel_STATION_G2 | ||||||
| #elif defined(UNPHONE) | #elif defined(UNPHONE) | ||||||
| #define HW_VENDOR meshtastic_HardwareModel_UNPHONE | #define HW_VENDOR meshtastic_HardwareModel_UNPHONE | ||||||
|  | #elif defined(WIPHONE) | ||||||
|  | #define HW_VENDOR meshtastic_HardwareModel_WIPHONE | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| // -----------------------------------------------------------------------------
 | // -----------------------------------------------------------------------------
 | ||||||
|  |  | ||||||
|  | @ -0,0 +1,52 @@ | ||||||
|  | #ifndef Pins_Arduino_h | ||||||
|  | #define Pins_Arduino_h | ||||||
|  | 
 | ||||||
|  | #include <stdint.h> | ||||||
|  | 
 | ||||||
|  | #define EXTERNAL_NUM_INTERRUPTS 16 | ||||||
|  | #define NUM_DIGITAL_PINS 20 | ||||||
|  | #define NUM_ANALOG_INPUTS 16 | ||||||
|  | 
 | ||||||
|  | #define analogInputToDigitalPin(p) (((p) < 20) ? (esp32_adc2gpio[(p)]) : -1) | ||||||
|  | #define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1) | ||||||
|  | #define digitalPinHasPWM(p) (p < 34) | ||||||
|  | 
 | ||||||
|  | static const uint8_t TX = 1; | ||||||
|  | static const uint8_t RX = 3; | ||||||
|  | 
 | ||||||
|  | static const uint8_t SDA = 21; | ||||||
|  | static const uint8_t SCL = 22; | ||||||
|  | 
 | ||||||
|  | static const uint8_t SS = 5; | ||||||
|  | static const uint8_t MOSI = 23; | ||||||
|  | static const uint8_t MISO = 19; | ||||||
|  | static const uint8_t SCK = 18; | ||||||
|  | 
 | ||||||
|  | static const uint8_t G23 = 23; | ||||||
|  | static const uint8_t G19 = 19; | ||||||
|  | static const uint8_t G18 = 18; | ||||||
|  | static const uint8_t G3 = 3; | ||||||
|  | static const uint8_t G16 = 16; | ||||||
|  | static const uint8_t G21 = 21; | ||||||
|  | static const uint8_t G2 = 2; | ||||||
|  | static const uint8_t G12 = 12; | ||||||
|  | static const uint8_t G15 = 15; | ||||||
|  | static const uint8_t G35 = 35; | ||||||
|  | static const uint8_t G36 = 36; | ||||||
|  | static const uint8_t G25 = 25; | ||||||
|  | static const uint8_t G26 = 26; | ||||||
|  | static const uint8_t G1 = 1; | ||||||
|  | static const uint8_t G17 = 17; | ||||||
|  | static const uint8_t G22 = 22; | ||||||
|  | static const uint8_t G5 = 5; | ||||||
|  | static const uint8_t G13 = 13; | ||||||
|  | static const uint8_t G0 = 0; | ||||||
|  | static const uint8_t G34 = 34; | ||||||
|  | 
 | ||||||
|  | static const uint8_t DAC1 = 25; | ||||||
|  | static const uint8_t DAC2 = 26; | ||||||
|  | 
 | ||||||
|  | static const uint8_t ADC1 = 35; | ||||||
|  | static const uint8_t ADC2 = 36; | ||||||
|  | 
 | ||||||
|  | #endif /* Pins_Arduino_h */ | ||||||
|  | @ -0,0 +1,13 @@ | ||||||
|  | [env:wiphone] | ||||||
|  | extends = esp32_base | ||||||
|  | board = wiphone | ||||||
|  | monitor_filters = esp32_exception_decoder | ||||||
|  | board_build.partitions = default_16MB.csv | ||||||
|  | build_flags =  | ||||||
|  |   ${esp32_base.build_flags} -D WIPHONE -I variants/wiphone | ||||||
|  | lib_deps =  | ||||||
|  |   ${esp32_base.lib_deps} | ||||||
|  |   lovyan03/LovyanGFX@^1.1.8 | ||||||
|  |   sparkfun/SX1509 IO Expander@^3.0.5 | ||||||
|  |   pololu/APA102@^3.0.0 | ||||||
|  |    | ||||||
|  | @ -0,0 +1,58 @@ | ||||||
|  | #define I2C_SDA 15 | ||||||
|  | #define I2C_SCL 25 | ||||||
|  | 
 | ||||||
|  | #define GPIO_EXTENDER 1509 | ||||||
|  | #define EXTENDER_FLAG 0x40 | ||||||
|  | #define EXTENDER_PIN(x) (x + EXTENDER_FLAG) | ||||||
|  | 
 | ||||||
|  | #undef RF95_SCK | ||||||
|  | #undef RF95_MISO | ||||||
|  | #undef RF95_MOSI | ||||||
|  | #undef RF95_NSS | ||||||
|  | 
 | ||||||
|  | #define RF95_SCK 14 | ||||||
|  | #define RF95_MISO 12 | ||||||
|  | #define RF95_MOSI 13 | ||||||
|  | #define RF95_NSS 27 | ||||||
|  | 
 | ||||||
|  | #define USE_RF95 | ||||||
|  | #define LORA_DIO0 38 | ||||||
|  | #define LORA_RESET RADIOLIB_NC | ||||||
|  | #define LORA_DIO1 RADIOLIB_NC | ||||||
|  | #define LORA_DIO2 RADIOLIB_NC | ||||||
|  | 
 | ||||||
|  | // This board has no GPS or Screen for now
 | ||||||
|  | #undef GPS_RX_PIN | ||||||
|  | #undef GPS_TX_PIN | ||||||
|  | #define NO_GPS | ||||||
|  | #define HAS_GPS 0 | ||||||
|  | #define NO_SCREEN | ||||||
|  | #define HAS_SCREEN 0 | ||||||
|  | 
 | ||||||
|  | // Default SPI1 will be mapped to the display
 | ||||||
|  | #define ST7789_SDA 23 | ||||||
|  | #define ST7789_SCK 18 | ||||||
|  | #define ST7789_CS 5 | ||||||
|  | #define ST7789_RS 26 | ||||||
|  | #define ST7789_BL -1 // EXTENDER_PIN(9)
 | ||||||
|  | 
 | ||||||
|  | #define ST7789_RESET -1 | ||||||
|  | #define ST7789_MISO 19 | ||||||
|  | #define ST7789_BUSY -1 | ||||||
|  | #define ST7789_SPI_HOST SPI3_HOST | ||||||
|  | #define ST7789_BACKLIGHT_EN -1 // EXTENDER_PIN(9)
 | ||||||
|  | #define SPI_FREQUENCY 40000000 | ||||||
|  | #define SPI_READ_FREQUENCY 16000000 | ||||||
|  | #define TFT_HEIGHT 240 | ||||||
|  | #define TFT_WIDTH 320 | ||||||
|  | #define TFT_OFFSET_X 0 | ||||||
|  | #define TFT_OFFSET_Y 0 | ||||||
|  | #define TFT_OFFSET_ROTATION 0 | ||||||
|  | #define SCREEN_ROTATE | ||||||
|  | #define SCREEN_TRANSITION_FRAMERATE 5 | ||||||
|  | 
 | ||||||
|  | #define I2S_MCLK_GPIO0 | ||||||
|  | #define I2S_BCK_PIN 4 // rev1.3 - 4 (wp05)
 | ||||||
|  | #define I2S_WS_PIN 33 | ||||||
|  | #define I2S_MOSI_PIN 21 | ||||||
|  | #define I2S_MISO_PIN 34 | ||||||
		Ładowanie…
	
		Reference in New Issue
	
	 Thomas Göttgens
						Thomas Göttgens