Compare commits
10 Commits
main
...
1cfde391c1
| Author | SHA1 | Date | |
|---|---|---|---|
| 1cfde391c1 | |||
| 79766040ca | |||
| 81e5f0209f | |||
| ab7d74a3f5 | |||
| eaa3604b23 | |||
| b18da6ed34 | |||
| c4eb5ff35d | |||
| 6699e2e6bf | |||
| 1fa8b9382d | |||
| 25cd8e5364 |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -1,6 +0,0 @@
|
|||||||
.vscode
|
|
||||||
.DS_Store
|
|
||||||
build
|
|
||||||
sdkconfig.old
|
|
||||||
desktop.ini
|
|
||||||
.PVS-Studio
|
|
||||||
9
.gitmodules
vendored
9
.gitmodules
vendored
@@ -1,9 +0,0 @@
|
|||||||
[submodule "components/zh_pcf8574"]
|
|
||||||
path = components/zh_pcf8574
|
|
||||||
url = http://git.zh.com.ru/esp_components/zh_pcf8574
|
|
||||||
[submodule "components/zh_vector"]
|
|
||||||
path = components/zh_vector
|
|
||||||
url = http://git.zh.com.ru/esp_components/zh_vector
|
|
||||||
[submodule "components/zh_ota_server"]
|
|
||||||
path = components/zh_ota_server
|
|
||||||
url = http://git.zh.com.ru/esp_components/zh_ota_server
|
|
||||||
BIN
BOM_ATE0004.000.001.xlsx
Normal file
BIN
BOM_ATE0004.000.001.xlsx
Normal file
Binary file not shown.
BIN
BOM_ATE0004.000.001_ATE0004.000.001_2025-10-21.xlsx
Normal file
BIN
BOM_ATE0004.000.001_ATE0004.000.001_2025-10-21.xlsx
Normal file
Binary file not shown.
@@ -1,3 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
|
||||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
|
||||||
project(ate0004)
|
|
||||||
BIN
Gerber_ATE0004.000.001_2025-10-21.zip
Normal file
BIN
Gerber_ATE0004.000.001_2025-10-21.zip
Normal file
Binary file not shown.
22
README.md
22
README.md
@@ -1,21 +1,3 @@
|
|||||||
# Honeywell Retractable Landing Light CMM 33-42-07 P/N 45-0351-X Motor Test Box
|
# ate0004.000.000
|
||||||
|
|
||||||
## Tested on
|
Honeywell Retractable Landing Light CMM 33-42-07 P/N 45-0351-X Motor Test Box.
|
||||||
|
|
||||||
1. [ESP32 ESP-IDF v5.5.1](https://docs.espressif.com/projects/esp-idf/en/v5.5.1/esp32/index.html)
|
|
||||||
|
|
||||||
## SAST Tools
|
|
||||||
|
|
||||||
[PVS-Studio](https://pvs-studio.com/pvs-studio/?utm_source=website&utm_medium=github&utm_campaign=open_source) - static analyzer for C, C++, C#, and Java code.
|
|
||||||
|
|
||||||
## Build and flash
|
|
||||||
|
|
||||||
Run the following command to firmware build and flash module:
|
|
||||||
|
|
||||||
```text
|
|
||||||
cd your_projects_folder
|
|
||||||
git clone --recurse-submodules http://git.zh.com.ru/aerotech/ate0004
|
|
||||||
cd ate0004
|
|
||||||
idf.py build
|
|
||||||
idf.py flash
|
|
||||||
```
|
|
||||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
BIN
cad/ATE0004.000.001 _ Низ.stl
Normal file
BIN
cad/ATE0004.000.001 _ Низ.stl
Normal file
Binary file not shown.
BIN
cad/ATE0004.000.002 _ Перед.cdw
Normal file
BIN
cad/ATE0004.000.002 _ Перед.cdw
Normal file
Binary file not shown.
Binary file not shown.
BIN
cad/ATE0004.000.002 _ Перед.pdf
Normal file
BIN
cad/ATE0004.000.002 _ Перед.pdf
Normal file
Binary file not shown.
BIN
cad/ATE0004.000.002 _ Перед.stl
Normal file
BIN
cad/ATE0004.000.002 _ Перед.stl
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Submodule components/zh_ota_server deleted from c61e1eec45
Submodule components/zh_pcf8574 deleted from de9ece9c0d
Submodule components/zh_vector deleted from b487617d3a
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ds/ADP3338.pdf
Normal file
BIN
ds/ADP3338.pdf
Normal file
Binary file not shown.
BIN
ds/ESP32-WROOM-32E.pdf
Normal file
BIN
ds/ESP32-WROOM-32E.pdf
Normal file
Binary file not shown.
BIN
ds/PCA9306.pdf
Normal file
BIN
ds/PCA9306.pdf
Normal file
Binary file not shown.
BIN
ds/T491.pdf
Normal file
BIN
ds/T491.pdf
Normal file
Binary file not shown.
@@ -1 +0,0 @@
|
|||||||
idf_component_register(SRCS "ate0004.c" INCLUDE_DIRS "" REQUIRES zh_pcf8574 esp_wifi nvs_flash zh_ota_server)
|
|
||||||
175
main/ate0004.c
175
main/ate0004.c
@@ -1,175 +0,0 @@
|
|||||||
#include "ate0004.h"
|
|
||||||
|
|
||||||
static i2c_master_bus_handle_t _i2c_bus_handle = NULL;
|
|
||||||
static httpd_handle_t _webserver_handle = NULL;
|
|
||||||
|
|
||||||
static zh_pcf8574_handle_t _button_handle = {0};
|
|
||||||
static zh_pcf8574_handle_t _led_handle = {0};
|
|
||||||
static zh_pcf8574_handle_t _relay_handle = {0};
|
|
||||||
|
|
||||||
static bool _is_ts_enabled = true;
|
|
||||||
static bool _is_ret_enabled = false;
|
|
||||||
static bool _is_ext_enabled = false;
|
|
||||||
|
|
||||||
static void _zh_wifi_softap_init(void);
|
|
||||||
static void _zh_webserver_init(void);
|
|
||||||
static void _zh_gpio_init(void);
|
|
||||||
static void _zh_pcf8574_init(void);
|
|
||||||
static void _zh_pcf8574_event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data);
|
|
||||||
|
|
||||||
void app_main(void)
|
|
||||||
{
|
|
||||||
nvs_flash_init();
|
|
||||||
esp_event_loop_create_default();
|
|
||||||
_zh_wifi_softap_init();
|
|
||||||
_zh_webserver_init();
|
|
||||||
_zh_gpio_init();
|
|
||||||
gpio_set_level(TRIAC_GPIO, LOW);
|
|
||||||
_zh_pcf8574_init();
|
|
||||||
zh_pcf8574_write_gpio(&_led_handle, TS_LED_GREEN, LED_ON);
|
|
||||||
zh_pcf8574_write_gpio(&_led_handle, RET_LED_BLUE, LED_ON);
|
|
||||||
zh_pcf8574_write_gpio(&_led_handle, EXT_LED_BLUE, LED_ON);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void _zh_wifi_softap_init(void)
|
|
||||||
{
|
|
||||||
esp_netif_init();
|
|
||||||
esp_netif_create_default_wifi_ap();
|
|
||||||
wifi_init_config_t wifi_config = WIFI_INIT_CONFIG_DEFAULT();
|
|
||||||
esp_wifi_init(&wifi_config);
|
|
||||||
wifi_config_t ap_config = {
|
|
||||||
.ap = {
|
|
||||||
.ssid = WIFI_SSID,
|
|
||||||
.password = WIFI_PASS,
|
|
||||||
.max_connection = MAX_STA_CONNECTION,
|
|
||||||
.authmode = WIFI_AUTH_WPA2_PSK,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
esp_wifi_set_mode(WIFI_MODE_AP);
|
|
||||||
esp_wifi_set_config(WIFI_IF_AP, &ap_config);
|
|
||||||
esp_wifi_start();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void _zh_webserver_init(void)
|
|
||||||
{
|
|
||||||
httpd_config_t config = HTTPD_DEFAULT_CONFIG();
|
|
||||||
httpd_start(&_webserver_handle, &config);
|
|
||||||
zh_ota_server_init(_webserver_handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void _zh_gpio_init(void)
|
|
||||||
{
|
|
||||||
gpio_config_t triac_pin_config = {
|
|
||||||
.intr_type = GPIO_INTR_DISABLE,
|
|
||||||
.mode = GPIO_MODE_OUTPUT,
|
|
||||||
.pin_bit_mask = (1ULL << TRIAC_GPIO),
|
|
||||||
.pull_down_en = GPIO_PULLDOWN_DISABLE,
|
|
||||||
.pull_up_en = GPIO_PULLUP_DISABLE,
|
|
||||||
};
|
|
||||||
gpio_config(&triac_pin_config);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void _zh_pcf8574_init(void)
|
|
||||||
{
|
|
||||||
i2c_master_bus_config_t i2c_bus_config = {
|
|
||||||
.clk_source = I2C_CLK_SRC_DEFAULT,
|
|
||||||
.scl_io_num = GPIO_NUM_22,
|
|
||||||
.sda_io_num = GPIO_NUM_21,
|
|
||||||
.glitch_ignore_cnt = 7,
|
|
||||||
};
|
|
||||||
i2c_new_master_bus(&i2c_bus_config, &_i2c_bus_handle);
|
|
||||||
esp_event_handler_instance_register(ZH_PCF8574, ESP_EVENT_ANY_ID, &_zh_pcf8574_event_handler, NULL, NULL);
|
|
||||||
zh_pcf8574_init_config_t config = ZH_PCF8574_INIT_CONFIG_DEFAULT();
|
|
||||||
config.i2c_handle = _i2c_bus_handle;
|
|
||||||
config.i2c_address = LED_I2C_ADDRESS;
|
|
||||||
zh_pcf8574_init(&config, &_led_handle);
|
|
||||||
config.i2c_address = RELAY_I2C_ADDRESS;
|
|
||||||
zh_pcf8574_init(&config, &_relay_handle);
|
|
||||||
config.i2c_address = BUTTON_I2C_ADDRESS;
|
|
||||||
config.p0_gpio_work_mode = true;
|
|
||||||
config.p1_gpio_work_mode = true;
|
|
||||||
config.p2_gpio_work_mode = true;
|
|
||||||
config.interrupt_gpio = GPIO_NUM_17;
|
|
||||||
zh_pcf8574_init(&config, &_button_handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void _zh_pcf8574_event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data)
|
|
||||||
{
|
|
||||||
zh_pcf8574_event_on_isr_t *event = event_data;
|
|
||||||
switch (event->gpio_number)
|
|
||||||
{
|
|
||||||
case TS_BUTTON:
|
|
||||||
if (event->gpio_level == LOW && _is_ret_enabled == false && _is_ext_enabled == false)
|
|
||||||
{
|
|
||||||
if (_is_ts_enabled == true)
|
|
||||||
{
|
|
||||||
zh_pcf8574_write_gpio(&_led_handle, TS_LED_RED, LED_ON);
|
|
||||||
zh_pcf8574_write_gpio(&_led_handle, TS_LED_GREEN, LED_OFF);
|
|
||||||
zh_pcf8574_write_gpio(&_relay_handle, TS_RELAY, RELAY_ON);
|
|
||||||
_is_ts_enabled = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
zh_pcf8574_write_gpio(&_led_handle, TS_LED_RED, LED_OFF);
|
|
||||||
zh_pcf8574_write_gpio(&_led_handle, TS_LED_GREEN, LED_ON);
|
|
||||||
zh_pcf8574_write_gpio(&_relay_handle, TS_RELAY, RELAY_OFF);
|
|
||||||
_is_ts_enabled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case RET_BUTTON:
|
|
||||||
if (_is_ext_enabled == true)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (event->gpio_level == LOW)
|
|
||||||
{
|
|
||||||
_is_ret_enabled = true;
|
|
||||||
zh_pcf8574_write_gpio(&_led_handle, RET_LED_BLUE, LED_OFF);
|
|
||||||
zh_pcf8574_write_gpio(&_led_handle, RET_LED_GREEN, LED_ON);
|
|
||||||
zh_pcf8574_write_gpio(&_relay_handle, RET_RELAY, RELAY_ON);
|
|
||||||
zh_pcf8574_write_gpio(&_relay_handle, GROUND_RELAY, RELAY_ON);
|
|
||||||
vTaskDelay(20 / portTICK_PERIOD_MS);
|
|
||||||
gpio_set_level(TRIAC_GPIO, HIGH);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gpio_set_level(TRIAC_GPIO, LOW);
|
|
||||||
vTaskDelay(5 / portTICK_PERIOD_MS);
|
|
||||||
zh_pcf8574_write_gpio(&_led_handle, RET_LED_BLUE, LED_ON);
|
|
||||||
zh_pcf8574_write_gpio(&_led_handle, RET_LED_GREEN, LED_OFF);
|
|
||||||
zh_pcf8574_write_gpio(&_relay_handle, RET_RELAY, RELAY_OFF);
|
|
||||||
zh_pcf8574_write_gpio(&_relay_handle, GROUND_RELAY, RELAY_OFF);
|
|
||||||
_is_ret_enabled = false;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case EXT_BUTTON:
|
|
||||||
if (_is_ret_enabled == true)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (event->gpio_level == LOW)
|
|
||||||
{
|
|
||||||
_is_ext_enabled = true;
|
|
||||||
zh_pcf8574_write_gpio(&_led_handle, EXT_LED_BLUE, LED_OFF);
|
|
||||||
zh_pcf8574_write_gpio(&_led_handle, EXT_LED_GREEN, LED_ON);
|
|
||||||
zh_pcf8574_write_gpio(&_relay_handle, EXT_RELAY, RELAY_ON);
|
|
||||||
zh_pcf8574_write_gpio(&_relay_handle, GROUND_RELAY, RELAY_ON);
|
|
||||||
vTaskDelay(20 / portTICK_PERIOD_MS);
|
|
||||||
gpio_set_level(TRIAC_GPIO, HIGH);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gpio_set_level(TRIAC_GPIO, LOW);
|
|
||||||
vTaskDelay(5 / portTICK_PERIOD_MS);
|
|
||||||
zh_pcf8574_write_gpio(&_led_handle, EXT_LED_BLUE, LED_ON);
|
|
||||||
zh_pcf8574_write_gpio(&_led_handle, EXT_LED_GREEN, LED_OFF);
|
|
||||||
zh_pcf8574_write_gpio(&_relay_handle, EXT_RELAY, RELAY_OFF);
|
|
||||||
zh_pcf8574_write_gpio(&_relay_handle, GROUND_RELAY, RELAY_OFF);
|
|
||||||
_is_ext_enabled = false;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file ate0004.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "zh_pcf8574.h"
|
|
||||||
#include "nvs_flash.h"
|
|
||||||
#include "esp_wifi.h"
|
|
||||||
#include "zh_ota_server.h"
|
|
||||||
|
|
||||||
#define HIGH true
|
|
||||||
#define LOW false
|
|
||||||
|
|
||||||
#define LED_OFF LOW
|
|
||||||
#define LED_ON HIGH
|
|
||||||
|
|
||||||
#define RELAY_OFF LOW
|
|
||||||
#define RELAY_ON HIGH
|
|
||||||
|
|
||||||
#define TRIAC_GPIO GPIO_NUM_4
|
|
||||||
|
|
||||||
#define WIFI_SSID "ATE0004"
|
|
||||||
#define WIFI_PASS "repairlab"
|
|
||||||
#define WIFI_CHANNEL 1
|
|
||||||
#define MAX_STA_CONNECTION 4
|
|
||||||
|
|
||||||
#define BUTTON_I2C_ADDRESS 0x22 /*!< U7. */
|
|
||||||
#define LED_I2C_ADDRESS 0x21 /*!< U6. */
|
|
||||||
#define RELAY_I2C_ADDRESS 0x20 /*!< U5. */
|
|
||||||
|
|
||||||
#define GROUND_RELAY 0x00 /*!< Relay K1. RL1 pin on U5. */
|
|
||||||
#define TS_RELAY 0x03 /*!< Relay K4. RL4 pin on U5. */
|
|
||||||
#define RET_RELAY 0x02 /*!< Relay K3. RL3 pin on U5. */
|
|
||||||
#define EXT_RELAY 0x01 /*!< Relay K2. RL2 pin on 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 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"
|
|
||||||
{
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
BIN
ord/Gerber_ATE0003.000.001_v.1.zip
Normal file
BIN
ord/Gerber_ATE0003.000.001_v.1.zip
Normal file
Binary file not shown.
BIN
ord/Gerber_ATE0004.000.001_v.1.zip
Normal file
BIN
ord/Gerber_ATE0004.000.001_v.1.zip
Normal file
Binary file not shown.
BIN
ord/Информационная_карта_ООО_АЭРОТЭЧ.pdf
Normal file
BIN
ord/Информационная_карта_ООО_АЭРОТЭЧ.pdf
Normal file
Binary file not shown.
BIN
ord/бланк заказа филиал ЭК Мск.xlsx
Normal file
BIN
ord/бланк заказа филиал ЭК Мск.xlsx
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
pcb/PCB.jpeg
BIN
pcb/PCB.jpeg
Binary file not shown.
|
Before Width: | Height: | Size: 3.0 MiB |
@@ -1 +0,0 @@
|
|||||||
1.0.0
|
|
||||||
Reference in New Issue
Block a user