-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #222 from Paciente8159/ESP8266
ESP8266 core integration
- Loading branch information
Showing
28 changed files
with
2,911 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
Name: boardmap_wemos_d1.h | ||
Description: Contains all MCU and PIN definitions for Arduino WeMos D1 to run µCNC. | ||
Copyright: Copyright (c) João Martins | ||
Author: João Martins | ||
Date: 17/06/2022 | ||
µCNC is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. Please see <http://www.gnu.org/licenses/> | ||
µCNC is distributed WITHOUT ANY WARRANTY; | ||
Also without the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
See the GNU General Public License for more details. | ||
*/ | ||
|
||
#ifndef BOARDMAP_WEMOS_D1_H | ||
#define BOARDMAP_WEMOS_D1_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
#ifndef BOARD_NAME | ||
#define BOARD_NAME "WEMOS D1" | ||
#endif | ||
|
||
// SAME AS GRBL for test purposes | ||
// Setup step pins | ||
#define STEP2_BIT 4 // assigns STEP2 pin | ||
#define STEP2_PORT D // assigns STEP2 port | ||
#define STEP1_BIT 5 // assigns STEP1 pin | ||
#define STEP1_PORT D // assigns STEP1 port | ||
#define STEP0_BIT 16 // assigns STEP0 pin | ||
#define STEP0_PORT D // assigns STEP0 port | ||
|
||
// Setup dir pins | ||
#define DIR2_BIT 13 // assigns DIR2 pin | ||
#define DIR2_PORT D // assigns DIR2 port | ||
#define DIR1_BIT 12 // assigns DIR1 pin | ||
#define DIR1_PORT D // assigns DIR1 port | ||
#define DIR0_BIT 14 // assigns DIR0 pin | ||
#define DIR0_PORT D // assigns DIR0 port | ||
|
||
// Setup control input pins | ||
// #define ESTOP_BIT 0 | ||
// #define ESTOP_PORT A | ||
//#define ESTOP_ISR | ||
|
||
// Setup com pins | ||
#if (INTERFACE == INTERFACE_UART) | ||
#define RX_BIT 3 | ||
#define TX_BIT 1 | ||
#define RX_PORT D | ||
#define TX_PORT D | ||
// only uncomment this if other port other then 0 is used | ||
// #define COM_PORT 0 | ||
#endif | ||
|
||
// Setup PWM | ||
#define PWM0_BIT 2 // assigns PWM0 pin | ||
#define PWM0_PORT D // assigns PWM0 pin | ||
|
||
// Setup generic IO Pins | ||
// spindle dir | ||
#define DOUT0_BIT 15 | ||
#define DOUT0_PORT D | ||
|
||
// Stepper enable pin. For Grbl on Uno board a single pin is used | ||
#define STEP0_EN_BIT 0 | ||
#define STEP0_EN_PORT D | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
################ | ||
# STM32 Boards # | ||
################ | ||
|
||
[env:d1] | ||
platform = espressif8266 | ||
framework = arduino | ||
board = d1 | ||
build_src_filter = +<*>-<src/tinyusb> | ||
lib_deps = | ||
https://github.com/tzapu/WiFiManager/archive/refs/heads/master.zip | ||
build_flags = -DBOARD=BOARD_WEMOS_D1 -DINTERFACE=0 -DENABLE_WIFI | ||
upload_speed = 256000 | ||
board_build.f_cpu = 160000000L |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include "../../../../cnc_config.h" | ||
#ifdef ESP8266 | ||
#ifndef RAM_ONLY_SETTINGS | ||
#include <Arduino.h> | ||
#include <EEPROM.h> | ||
#include <stdint.h> | ||
extern "C" | ||
{ | ||
void esp8266_eeprom_init(int size) | ||
{ | ||
EEPROM.begin(size); | ||
} | ||
|
||
uint8_t esp8266_eeprom_read(uint16_t address) | ||
{ | ||
return EEPROM.read(address); | ||
} | ||
|
||
void esp8266_eeprom_write(uint16_t address, uint8_t value) | ||
{ | ||
EEPROM.write(address, value); | ||
} | ||
|
||
void esp8266_eeprom_flush(void) | ||
{ | ||
if (!EEPROM.commit()) | ||
{ | ||
Serial.println("[MSG: EEPROM write error]"); | ||
} | ||
} | ||
} | ||
|
||
#endif | ||
#endif |
Oops, something went wrong.