This commit is contained in:
2025-11-14 14:11:03 +03:00
parent 6257045e11
commit bb13b7b3b6
4 changed files with 83 additions and 42 deletions

View File

@@ -1,6 +1,8 @@
#pragma once
#include "zh_pcf8574.h"
#include "nvs_flash.h"
#include "esp_wifi.h"
#define HIGH true
#define LOW false
@@ -13,25 +15,30 @@
#define TRIAC_GPIO GPIO_NUM_4
#define BUTTON_I2C_ADDRESS 0x22 // U7.
#define LED_I2C_ADDRESS 0x21 // U6.
#define RELAY_I2C_ADDRESS 0x20 // U5.
#define WIFI_SSID "ATE0004"
#define WIFI_PASS "repairlab"
#define WIFI_CHANNEL 1
#define MAX_STA_CONNECTION 4
#define GROUND_RELAY 0x00 // Relay K1. RL1 pin on U5.
#define TS_RELAY 0x04 // Relay K4. RL4 pin on U5.
#define RET_RELAY 0x03 // Relay K3. RL3 pin on U5.
#define EXT_RELAY 0x02 // Relay K2. RL2 pin on U5.
#define BUTTON_I2C_ADDRESS 0x22 /*!< U7. */
#define LED_I2C_ADDRESS 0x21 /*!< U6. */
#define RELAY_I2C_ADDRESS 0x20 /*!< U5. */
#define TS_BUTTON 0x00 // Connector BT1. B1-0 on U7.
#define RET_BUTTON 0x01 // Connector BT2. B2-1 on U7.
#define EXT_BUTTON 0x02 // Connector BT3. B3-2 on U7.
#define GROUND_RELAY 0x00 /*!< Relay K1. RL1 pin on U5. */
#define TS_RELAY 0x04 /*!< Relay K4. RL4 pin on U5. */
#define RET_RELAY 0x03 /*!< Relay K3. RL3 pin on U5. */
#define EXT_RELAY 0x02 /*!< Relay K2. RL2 pin on U5. */
#define TS_LED_RED 0x00 // Connector LE1. 2 PIN. L1-0 pin on U6.
#define TS_LED_GREEN 0x01 // Connector LE1. 1 PIN. L1-1 pin on U6.
#define RET_LED_BLUE 0x02 // Connector LE2. 2 PIN. L2-2 pin on U6.
#define RET_LED_GREEN 0x03 // Connector LE2. 1 PIN. L2-3 pin on U6.
#define EXT_LED_BLUE 0x04 // Connector LE3. 2 PIN. L3-4 pin on U6.
#define EXT_LED_GREEN 0x05 // Connector LE3. 1 PIN. L3-5 pin on U6.
#define TS_BUTTON 0x00 /*!< Connector BT1. B1-0 on U7. */
#define RET_BUTTON 0x01 /*!< Connector BT2. B2-1 on U7. */
#define EXT_BUTTON 0x02 /*!< Connector BT3. B3-2 on U7. */
#define TS_LED_RED 0x00 /*!< Connector LE1. 2 PIN. L1-0 pin on U6. */
#define TS_LED_GREEN 0x01 /*!< Connector LE1. 1 PIN. L1-1 pin on U6. */
#define RET_LED_BLUE 0x02 /*!< Connector LE2. 2 PIN. L2-2 pin on U6. */
#define RET_LED_GREEN 0x03 /*!< Connector LE2. 1 PIN. L2-3 pin on U6. */
#define EXT_LED_BLUE 0x04 /*!< Connector LE3. 2 PIN. L3-4 pin on U6. */
#define EXT_LED_GREEN 0x05 /*!< Connector LE3. 1 PIN. L3-5 pin on U6. */
#ifdef __cplusplus
extern "C"