🔧 MKS_ROBIN_PRO : I2C EEPROM + MKS Wifi (#26823)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
fredycpu 2024-03-03 19:39:50 +01:00 committed by GitHub
parent e6cda9932b
commit ec6f9dd5c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 61 additions and 23 deletions

View file

@ -691,6 +691,8 @@
#error "ANET_FULL_GRAPHICS_LCD_ALT_WIRING is now CTC_A10S_A13."
#elif defined(Z_PROBE_END_SCRIPT)
#error "Z_PROBE_END_SCRIPT is now EVENT_GCODE_AFTER_G29."
#elif defined(WIFI_SERIAL)
#error "WIFI_SERIAL is now WIFI_SERIAL_PORT."
#endif
// Changes to Probe Temp Compensation (#17392)

View file

@ -99,7 +99,9 @@
#define ESTATE(S) (READ(S##_PIN) == S##_ENDSTOP_HIT_STATE)
void test_gpio_readlevel_L() {
WRITE(WIFI_IO0_PIN, HIGH);
#if PIN_EXISTS(WIFI_IO0)
WRITE(WIFI_IO0_PIN, HIGH);
#endif
delay(10);
pw_det_sta = (READ(MKS_TEST_POWER_LOSS_PIN) == LOW);
pw_off_sta = (READ(MKS_TEST_PS_ON_PIN) == LOW);
@ -132,7 +134,9 @@
}
void test_gpio_readlevel_H() {
WRITE(WIFI_IO0_PIN, LOW);
#if PIN_EXISTS(WIFI_IO0)
WRITE(WIFI_IO0_PIN, LOW);
#endif
delay(10);
pw_det_sta = (READ(MKS_TEST_POWER_LOSS_PIN) == HIGH);
pw_off_sta = (READ(MKS_TEST_PS_ON_PIN) == HIGH);
@ -169,7 +173,9 @@
void init_test_gpio() {
endstops.init();
SET_OUTPUT(WIFI_IO0_PIN);
#if PIN_EXISTS(WIFI_IO0)
SET_OUTPUT(WIFI_IO0_PIN);
#endif
#if PIN_EXISTS(MT_DET_1)
SET_INPUT_PULLUP(MT_DET_1_PIN);

View file

@ -1920,7 +1920,9 @@ void mks_esp_wifi_init() {
SET_OUTPUT(WIFI_RESET_PIN);
WIFI_SET();
SET_OUTPUT(WIFI_IO1_PIN);
SET_INPUT_PULLUP(WIFI_IO0_PIN);
#if PIN_EXISTS(WIFI_IO0)
SET_INPUT_PULLUP(WIFI_IO0_PIN);
#endif
WIFI_IO1_SET();
esp_state = TRANSFER_IDLE;

View file

@ -650,12 +650,14 @@ void resetWiFiForUpload(int begin_or_end) {
//#if 0
uint32_t start = getWifiTick();
if (begin_or_end == 0) {
SET_OUTPUT(WIFI_IO0_PIN);
WRITE(WIFI_IO0_PIN, LOW);
}
else
SET_INPUT_PULLUP(WIFI_IO0_PIN);
#if PIN_EXISTS(WIFI_IO0)
if (begin_or_end == 0) {
SET_OUTPUT(WIFI_IO0_PIN);
WRITE(WIFI_IO0_PIN, LOW);
}
else
SET_INPUT_PULLUP(WIFI_IO0_PIN);
#endif
WIFI_RESET();
while (getWifiTickDiff(start, getWifiTick()) < 500) { /* nada */ }

View file

@ -201,10 +201,14 @@
#define WIFI_IO1_PIN PC7
#define WIFI_RESET_PIN PE9
//
// MKS Testing for code in lcd/extui/mks_ui
//
#if ENABLED(MKS_TEST)
#define MKS_TEST_POWER_LOSS_PIN PA2 // PW_DET
#define MKS_TEST_PS_ON_PIN PB0 // PW_OFF
#endif
#else
//#define POWER_LOSS_PIN PA2 // PW_DET
//#define PS_ON_PIN PB2 // PW_OFF

View file

@ -228,10 +228,14 @@
#define WIFI_IO1_PIN PC7
#define WIFI_RESET_PIN PE9
//
// MKS Testing for code in lcd/extui/mks_ui
//
#if ENABLED(MKS_TEST)
#define MKS_TEST_POWER_LOSS_PIN PA2 // PW_DET
#define MKS_TEST_PS_ON_PIN PB2 // PW_OFF
#endif
#else
//#define POWER_LOSS_PIN PA2 // PW_DET
//#define PS_ON_PIN PB2 // PW_OFF

View file

@ -41,6 +41,15 @@
//
#define DISABLE_DEBUG
//
// Onboard I2C EEPROM
//
#define IIC_BL24CXX_EEPROM // Use I2C EEPROM onboard IC (AT24C04C, Size 4K, PageSize 16B)
#define MARLIN_EEPROM_SIZE 0x1000 // 4K
#define IIC_EEPROM_SDA PB7
#define IIC_EEPROM_SCL PB6
#define EEPROM_DEVICE_ADDRESS 0xA0
//
// SPI
//
@ -403,3 +412,13 @@
#define SPI_FLASH_MISO_PIN PB14
#define SPI_FLASH_MOSI_PIN PB15
#endif
//
// MKS WIFI pins
//
#if ENABLED(MKS_WIFI_MODULE)
#define WIFI_RESET_PIN PA5
#define WIFI_SERIAL_PORT 1 // USART1
#define WIFI_IO1_PIN PC7
#define WIFI_IO0_PIN -1 // N.C.
#endif

View file

@ -51,7 +51,7 @@
//
// MKS WIFI MODULE
//
//#define WIFI_SERIAL 1// USART1
//#define WIFI_SERIAL_PORT 1 // USART1
#if ENABLED(MKS_WIFI_MODULE)
#define WIFI_IO0_PIN PB14 // MKS ESP WIFI IO0 PIN
#define WIFI_IO1_PIN PB15 // MKS ESP WIFI IO1 PIN

View file

@ -217,9 +217,6 @@
#define KILL_PIN_STATE HIGH
#endif
// Random Info
#define USB_SERIAL -1 // USB Serial
/**
* ------ ------
* (BEEPER) PB2 | 1 2 | PE10 (BTN_ENC) (SPI1 MISO) PA6 | 1 2 | PA5 (SPI1 SCK)

View file

@ -195,25 +195,27 @@
#define KILL_PIN_STATE HIGH
#endif
// Random Info
#define USB_SERIAL -1 // USB Serial
#define WIFI_SERIAL 3 // USART3
#define MKS_WIFI_MODULE_SERIAL 1 // USART1
#define MKS_WIFI_MODULE_SPI 2 // SPI2
#ifndef SDCARD_CONNECTION
#define SDCARD_CONNECTION ONBOARD
#endif
// MKS WIFI MODULE
//
// MKS WiFi Module
//
#if ENABLED(MKS_WIFI_MODULE)
#define WIFI_IO0_PIN PC13
#define WIFI_IO1_PIN PC7
#define WIFI_RESET_PIN PE9
#define MKS_WIFI_MODULE_SERIAL 1 // USART1
#define MKS_WIFI_MODULE_SPI 2 // SPI2
#else
#define WIFI_SERIAL_PORT 3 // USART3
#endif
// MKS TEST
#if ENABLED(MKS_TEST)
//
// MKS Testing for code in lcd/extui/mks_ui
//
#if ALL(TFT_LVGL_UI, MKS_TEST)
#define MKS_TEST_POWER_LOSS_PIN PA13 // PW_DET
#define MKS_TEST_PS_ON_PIN PB2 // PW_OFF
#endif