Compare commits
18 Commits
ae9860aec7
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| 4b5db1d472 | |||
| 4c313d7e9a | |||
| 1a24f57025 | |||
| 501c6f5b95 | |||
| 26bd041b02 | |||
| effcee1cbb | |||
| 3e68e40b32 | |||
| fd12bd513e | |||
| a04fe393d7 | |||
| 43f5329f63 | |||
| 14ba98bb08 | |||
| ab64f0d9c0 | |||
| dcffb5d5da | |||
| d5430fc77b | |||
| 3b0666e53b | |||
| 0fe4438133 | |||
| a65651dde8 | |||
| 0f36507765 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,4 +1,6 @@
|
|||||||
build
|
|
||||||
.vscode
|
.vscode
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
build
|
||||||
sdkconfig.old
|
sdkconfig.old
|
||||||
|
desktop.ini
|
||||||
|
.PVS-Studio
|
||||||
7
.gitmodules
vendored
7
.gitmodules
vendored
@@ -1,6 +1,9 @@
|
|||||||
[submodule "components/zh_pcf8574"]
|
[submodule "components/zh_pcf8574"]
|
||||||
path = components/zh_pcf8574
|
path = components/zh_pcf8574
|
||||||
url = http://git.zh.com.ru/alexey.zholtikov/zh_pcf8574
|
url = http://git.zh.com.ru/esp_components/zh_pcf8574
|
||||||
[submodule "components/zh_vector"]
|
[submodule "components/zh_vector"]
|
||||||
path = components/zh_vector
|
path = components/zh_vector
|
||||||
url = http://git.zh.com.ru/alexey.zholtikov/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
|
||||||
|
|||||||
0
CMakeLists.txt
Executable file → Normal file
0
CMakeLists.txt
Executable file → Normal file
22
README.md
22
README.md
@@ -1,3 +1,21 @@
|
|||||||
# ate0004.000.000
|
# Honeywell Retractable Landing Light CMM 33-42-07 P/N 45-0351-X Motor Test Box
|
||||||
|
|
||||||
Honeywell Retractable Landing Light CMM 33-42-07 P/N 45-0351-X Motor Test Box.
|
## Tested on
|
||||||
|
|
||||||
|
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
|
||||||
|
```
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
cad/ATE0004.007.000 СБ _ KLS5-254.a3d
Normal file
BIN
cad/ATE0004.007.000 СБ _ KLS5-254.a3d
Normal file
Binary file not shown.
Binary file not shown.
1
components/zh_ota_server
Submodule
1
components/zh_ota_server
Submodule
Submodule components/zh_ota_server added at c61e1eec45
Submodule components/zh_pcf8574 updated: c9365e40ba...de9ece9c0d
BIN
doc/ATE0004 Руководство по эксплуатации.docx
Normal file
BIN
doc/ATE0004 Руководство по эксплуатации.docx
Normal file
Binary file not shown.
BIN
doc/Счет-договор № 15675307 от 06.08.2025.pdf
Normal file
BIN
doc/Счет-договор № 15675307 от 06.08.2025.pdf
Normal file
Binary file not shown.
BIN
doc/Счет-договор № 15803420 от 01.09.2025.pdf
Normal file
BIN
doc/Счет-договор № 15803420 от 01.09.2025.pdf
Normal file
Binary file not shown.
BIN
doc/Счет-договор № 16037717 от 14.10.2025.pdf
Normal file
BIN
doc/Счет-договор № 16037717 от 14.10.2025.pdf
Normal file
Binary file not shown.
BIN
doc/Счет-договор № 19875 от 23.10.2025.pdf
Normal file
BIN
doc/Счет-договор № 19875 от 23.10.2025.pdf
Normal file
Binary file not shown.
BIN
ds/ADP3338.pdf
BIN
ds/ADP3338.pdf
Binary file not shown.
Binary file not shown.
BIN
ds/PCA9306.pdf
BIN
ds/PCA9306.pdf
Binary file not shown.
BIN
ds/T491.pdf
BIN
ds/T491.pdf
Binary file not shown.
2
main/CMakeLists.txt
Executable file → Normal file
2
main/CMakeLists.txt
Executable file → Normal file
@@ -1 +1 @@
|
|||||||
idf_component_register(SRCS "main.c" INCLUDE_DIRS "" REQUIRES zh_pcf8574)
|
idf_component_register(SRCS "ate0004.c" INCLUDE_DIRS "" REQUIRES zh_pcf8574 esp_wifi nvs_flash zh_ota_server)
|
||||||
175
main/ate0004.c
Normal file
175
main/ate0004.c
Normal file
@@ -0,0 +1,175 @@
|
|||||||
|
#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;
|
||||||
|
}
|
||||||
|
}
|
||||||
55
main/ate0004.h
Normal file
55
main/ate0004.h
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
/**
|
||||||
|
* @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
|
||||||
93
main/main.c
93
main/main.c
@@ -1,93 +0,0 @@
|
|||||||
#include "zh_pcf8574.h"
|
|
||||||
|
|
||||||
#define I2C_PORT (I2C_NUM_MAX - 1)
|
|
||||||
|
|
||||||
#ifndef CONFIG_IDF_TARGET_ESP8266
|
|
||||||
i2c_master_bus_handle_t i2c_bus_handle = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
zh_pcf8574_handle_t pcf8574_handle = {0};
|
|
||||||
|
|
||||||
void zh_pcf8574_event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data); // Required only if used input GPIO interrupts.
|
|
||||||
|
|
||||||
void print_gpio_status(const char *message, uint8_t reg)
|
|
||||||
{
|
|
||||||
printf("%s", message);
|
|
||||||
for (uint8_t i = 0; i < 8; ++i)
|
|
||||||
{
|
|
||||||
printf("%c", (reg & 0x80) ? '1' : '0');
|
|
||||||
reg <<= 1;
|
|
||||||
}
|
|
||||||
printf(".\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
void app_main(void)
|
|
||||||
{
|
|
||||||
esp_log_level_set("zh_pcf8574", ESP_LOG_NONE); // For ESP8266 first enable "Component config -> Log output -> Enable log set level" via menuconfig.
|
|
||||||
esp_log_level_set("zh_vector", ESP_LOG_NONE); // For ESP8266 first enable "Component config -> Log output -> Enable log set level" via menuconfig.
|
|
||||||
#ifdef CONFIG_IDF_TARGET_ESP8266
|
|
||||||
i2c_config_t i2c_config = {
|
|
||||||
.mode = I2C_MODE_MASTER,
|
|
||||||
.sda_io_num = GPIO_NUM_4, // In accordance with used chip.
|
|
||||||
.sda_pullup_en = GPIO_PULLUP_ENABLE,
|
|
||||||
.scl_io_num = GPIO_NUM_5, // In accordance with used chip.
|
|
||||||
.scl_pullup_en = GPIO_PULLUP_ENABLE,
|
|
||||||
};
|
|
||||||
i2c_driver_install(I2C_PORT, i2c_config.mode);
|
|
||||||
i2c_param_config(I2C_PORT, &i2c_config);
|
|
||||||
#else
|
|
||||||
i2c_master_bus_config_t i2c_bus_config = {
|
|
||||||
.clk_source = I2C_CLK_SRC_DEFAULT,
|
|
||||||
.i2c_port = I2C_PORT,
|
|
||||||
.scl_io_num = GPIO_NUM_22, // In accordance with used chip.
|
|
||||||
.sda_io_num = GPIO_NUM_21, // In accordance with used chip.
|
|
||||||
.glitch_ignore_cnt = 7,
|
|
||||||
.flags.enable_internal_pullup = true,
|
|
||||||
};
|
|
||||||
i2c_new_master_bus(&i2c_bus_config, &i2c_bus_handle);
|
|
||||||
#endif
|
|
||||||
esp_event_loop_create_default(); // Required only if used input GPIO interrupts.
|
|
||||||
#ifdef CONFIG_IDF_TARGET_ESP8266
|
|
||||||
esp_event_handler_register(ZH_PCF8574, ESP_EVENT_ANY_ID, &zh_pcf8574_event_handler, NULL); // Required only if used input GPIO interrupts.
|
|
||||||
#else
|
|
||||||
esp_event_handler_instance_register(ZH_PCF8574, ESP_EVENT_ANY_ID, &zh_pcf8574_event_handler, NULL, NULL); // Required only if used input GPIO interrupts.
|
|
||||||
#endif
|
|
||||||
zh_pcf8574_init_config_t pcf8574_init_config = ZH_PCF8574_INIT_CONFIG_DEFAULT();
|
|
||||||
#ifdef CONFIG_IDF_TARGET_ESP8266
|
|
||||||
pcf8574_init_config.i2c_port = I2C_PORT;
|
|
||||||
#else
|
|
||||||
pcf8574_init_config.i2c_handle = i2c_bus_handle;
|
|
||||||
#endif
|
|
||||||
pcf8574_init_config.i2c_address = 0x38;
|
|
||||||
pcf8574_init_config.p0_gpio_work_mode = true; // Required only for input GPIO.
|
|
||||||
pcf8574_init_config.interrupt_gpio = GPIO_NUM_14; // Required only if used input GPIO interrupts.
|
|
||||||
zh_pcf8574_init(&pcf8574_init_config, &pcf8574_handle);
|
|
||||||
uint8_t reg = 0;
|
|
||||||
zh_pcf8574_read(&pcf8574_handle, ®);
|
|
||||||
print_gpio_status("GPIO status: ", reg);
|
|
||||||
printf("Set P7 to 1, P1 to 1 and P0 to 0.\n");
|
|
||||||
zh_pcf8574_write(&pcf8574_handle, 0b10000010); // GPIO P0 will not be changed because it is operating in input mode.
|
|
||||||
zh_pcf8574_read(&pcf8574_handle, ®);
|
|
||||||
print_gpio_status("GPIO status: ", reg);
|
|
||||||
printf("Sets P0 to 0.\n");
|
|
||||||
zh_pcf8574_write_gpio(&pcf8574_handle, 0, false); // GPIO P0 will not be changed because it is operating in input mode.
|
|
||||||
bool gpio = 0;
|
|
||||||
zh_pcf8574_read_gpio(&pcf8574_handle, 0, &gpio);
|
|
||||||
printf("P0 status: %d.\n", gpio);
|
|
||||||
printf("Set P1 to 0.\n");
|
|
||||||
zh_pcf8574_write_gpio(&pcf8574_handle, 1, false);
|
|
||||||
zh_pcf8574_read_gpio(&pcf8574_handle, 1, &gpio);
|
|
||||||
printf("P1 status: %d.\n", gpio);
|
|
||||||
zh_pcf8574_read(&pcf8574_handle, ®);
|
|
||||||
print_gpio_status("GPIO status: ", reg);
|
|
||||||
printf("Reset all GPIO.\n");
|
|
||||||
zh_pcf8574_reset(&pcf8574_handle);
|
|
||||||
zh_pcf8574_read(&pcf8574_handle, ®);
|
|
||||||
print_gpio_status("GPIO status: ", reg);
|
|
||||||
}
|
|
||||||
|
|
||||||
void zh_pcf8574_event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data) // Required only if used input GPIO interrupts.
|
|
||||||
{
|
|
||||||
zh_pcf8574_event_on_isr_t *event = event_data;
|
|
||||||
printf("Interrupt happened on device address 0x%02X on GPIO number %d at level %d.\n", event->i2c_address, event->gpio_number, event->gpio_level);
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
BIN
pcb/BOM_ATE0004.000.001_v.1.xlsx
Normal file
BIN
pcb/BOM_ATE0004.000.001_v.1.xlsx
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
pcb/PCB.jpeg
Normal file
BIN
pcb/PCB.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.0 MiB |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
64
sdkconfig
64
sdkconfig
@@ -254,7 +254,7 @@ CONFIG_IDF_TOOLCHAIN_GCC=y
|
|||||||
CONFIG_IDF_TARGET_ARCH_XTENSA=y
|
CONFIG_IDF_TARGET_ARCH_XTENSA=y
|
||||||
CONFIG_IDF_TARGET_ARCH="xtensa"
|
CONFIG_IDF_TARGET_ARCH="xtensa"
|
||||||
CONFIG_IDF_TARGET="esp32"
|
CONFIG_IDF_TARGET="esp32"
|
||||||
CONFIG_IDF_INIT_VERSION="$IDF_INIT_VERSION"
|
CONFIG_IDF_INIT_VERSION="5.5.1"
|
||||||
CONFIG_IDF_TARGET_ESP32=y
|
CONFIG_IDF_TARGET_ESP32=y
|
||||||
CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000
|
CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000
|
||||||
|
|
||||||
@@ -286,7 +286,8 @@ CONFIG_BOOTLOADER_PROJECT_VER=1
|
|||||||
#
|
#
|
||||||
# Application Rollback
|
# Application Rollback
|
||||||
#
|
#
|
||||||
# CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE is not set
|
CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y
|
||||||
|
# CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK is not set
|
||||||
# end of Application Rollback
|
# end of Application Rollback
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -295,9 +296,9 @@ CONFIG_BOOTLOADER_PROJECT_VER=1
|
|||||||
# end of Recovery Bootloader and Rollback
|
# end of Recovery Bootloader and Rollback
|
||||||
|
|
||||||
CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x1000
|
CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x1000
|
||||||
CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y
|
# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE is not set
|
||||||
# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set
|
# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set
|
||||||
# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set
|
CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF=y
|
||||||
# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set
|
# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -306,12 +307,12 @@ CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y
|
|||||||
CONFIG_BOOTLOADER_LOG_VERSION_1=y
|
CONFIG_BOOTLOADER_LOG_VERSION_1=y
|
||||||
CONFIG_BOOTLOADER_LOG_VERSION=1
|
CONFIG_BOOTLOADER_LOG_VERSION=1
|
||||||
# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set
|
# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set
|
||||||
# CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set
|
CONFIG_BOOTLOADER_LOG_LEVEL_ERROR=y
|
||||||
# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set
|
# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set
|
||||||
CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y
|
# CONFIG_BOOTLOADER_LOG_LEVEL_INFO is not set
|
||||||
# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set
|
# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set
|
||||||
# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set
|
# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set
|
||||||
CONFIG_BOOTLOADER_LOG_LEVEL=3
|
CONFIG_BOOTLOADER_LOG_LEVEL=1
|
||||||
|
|
||||||
#
|
#
|
||||||
# Format
|
# Format
|
||||||
@@ -401,13 +402,13 @@ CONFIG_ESPTOOLPY_FLASHFREQ_40M=y
|
|||||||
CONFIG_ESPTOOLPY_FLASHFREQ="40m"
|
CONFIG_ESPTOOLPY_FLASHFREQ="40m"
|
||||||
# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
|
# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
|
||||||
# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
|
# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
|
||||||
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
|
# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set
|
||||||
# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set
|
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y
|
||||||
# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
|
# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
|
||||||
# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set
|
# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set
|
||||||
# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set
|
# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set
|
||||||
# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set
|
# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set
|
||||||
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
|
CONFIG_ESPTOOLPY_FLASHSIZE="8MB"
|
||||||
# CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE is not set
|
# CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE is not set
|
||||||
CONFIG_ESPTOOLPY_BEFORE_RESET=y
|
CONFIG_ESPTOOLPY_BEFORE_RESET=y
|
||||||
# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set
|
# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set
|
||||||
@@ -432,12 +433,21 @@ CONFIG_PARTITION_TABLE_OFFSET=0x8000
|
|||||||
CONFIG_PARTITION_TABLE_MD5=y
|
CONFIG_PARTITION_TABLE_MD5=y
|
||||||
# end of Partition Table
|
# end of Partition Table
|
||||||
|
|
||||||
|
#
|
||||||
|
# OTA websocket update
|
||||||
|
#
|
||||||
|
CONFIG_OTA_DEFAULT_URI="/ota"
|
||||||
|
CONFIG_OTA_DEFAULT_WS_URI="/ota/ws"
|
||||||
|
CONFIG_OTA_CHUNK_SIZE=8192
|
||||||
|
# CONFIG_OTA_PRE_ENCRYPTED_MODE is not set
|
||||||
|
# end of OTA websocket update
|
||||||
|
|
||||||
#
|
#
|
||||||
# Compiler options
|
# Compiler options
|
||||||
#
|
#
|
||||||
CONFIG_COMPILER_OPTIMIZATION_DEBUG=y
|
# CONFIG_COMPILER_OPTIMIZATION_DEBUG is not set
|
||||||
# CONFIG_COMPILER_OPTIMIZATION_SIZE is not set
|
# CONFIG_COMPILER_OPTIMIZATION_SIZE is not set
|
||||||
# CONFIG_COMPILER_OPTIMIZATION_PERF is not set
|
CONFIG_COMPILER_OPTIMIZATION_PERF=y
|
||||||
# CONFIG_COMPILER_OPTIMIZATION_NONE is not set
|
# CONFIG_COMPILER_OPTIMIZATION_NONE is not set
|
||||||
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y
|
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y
|
||||||
# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set
|
# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set
|
||||||
@@ -666,7 +676,7 @@ CONFIG_DAC_DMA_AUTO_16BIT_ALIGN=y
|
|||||||
# ESP-Driver:GPIO Configurations
|
# ESP-Driver:GPIO Configurations
|
||||||
#
|
#
|
||||||
# CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL is not set
|
# CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL is not set
|
||||||
# CONFIG_GPIO_CTRL_FUNC_IN_IRAM is not set
|
CONFIG_GPIO_CTRL_FUNC_IN_IRAM=y
|
||||||
# end of ESP-Driver:GPIO Configurations
|
# end of ESP-Driver:GPIO Configurations
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -843,7 +853,7 @@ CONFIG_HTTPD_MAX_URI_LEN=512
|
|||||||
CONFIG_HTTPD_ERR_RESP_NO_DELAY=y
|
CONFIG_HTTPD_ERR_RESP_NO_DELAY=y
|
||||||
CONFIG_HTTPD_PURGE_BUF_LEN=32
|
CONFIG_HTTPD_PURGE_BUF_LEN=32
|
||||||
# CONFIG_HTTPD_LOG_PURGE_DATA is not set
|
# CONFIG_HTTPD_LOG_PURGE_DATA is not set
|
||||||
# CONFIG_HTTPD_WS_SUPPORT is not set
|
CONFIG_HTTPD_WS_SUPPORT=y
|
||||||
# CONFIG_HTTPD_QUEUE_WORK_BLOCKING is not set
|
# CONFIG_HTTPD_QUEUE_WORK_BLOCKING is not set
|
||||||
CONFIG_HTTPD_SERVER_EVENT_POST_TIMEOUT=2000
|
CONFIG_HTTPD_SERVER_EVENT_POST_TIMEOUT=2000
|
||||||
# end of HTTP Server
|
# end of HTTP Server
|
||||||
@@ -1321,7 +1331,6 @@ CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=1
|
|||||||
#
|
#
|
||||||
# Port
|
# Port
|
||||||
#
|
#
|
||||||
CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=y
|
|
||||||
# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set
|
# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set
|
||||||
CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS=y
|
CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS=y
|
||||||
# CONFIG_FREERTOS_TASK_PRE_DELETION_HOOK is not set
|
# CONFIG_FREERTOS_TASK_PRE_DELETION_HOOK is not set
|
||||||
@@ -1389,16 +1398,18 @@ CONFIG_LOG_VERSION=1
|
|||||||
# Log Level
|
# Log Level
|
||||||
#
|
#
|
||||||
# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set
|
# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set
|
||||||
# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set
|
CONFIG_LOG_DEFAULT_LEVEL_ERROR=y
|
||||||
# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set
|
# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set
|
||||||
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
|
# CONFIG_LOG_DEFAULT_LEVEL_INFO is not set
|
||||||
# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set
|
# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set
|
||||||
# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set
|
# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set
|
||||||
CONFIG_LOG_DEFAULT_LEVEL=3
|
CONFIG_LOG_DEFAULT_LEVEL=1
|
||||||
CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y
|
CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y
|
||||||
|
# CONFIG_LOG_MAXIMUM_LEVEL_WARN is not set
|
||||||
|
# CONFIG_LOG_MAXIMUM_LEVEL_INFO is not set
|
||||||
# CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set
|
# CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set
|
||||||
# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set
|
# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set
|
||||||
CONFIG_LOG_MAXIMUM_LEVEL=3
|
CONFIG_LOG_MAXIMUM_LEVEL=1
|
||||||
|
|
||||||
#
|
#
|
||||||
# Level Settings
|
# Level Settings
|
||||||
@@ -2020,23 +2031,24 @@ CONFIG_WIFI_PROV_STA_ALL_CHANNEL_SCAN=y
|
|||||||
# CONFIG_ESP32_NO_BLOBS is not set
|
# CONFIG_ESP32_NO_BLOBS is not set
|
||||||
# CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set
|
# CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set
|
||||||
# CONFIG_ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set
|
# CONFIG_ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set
|
||||||
# CONFIG_APP_ROLLBACK_ENABLE is not set
|
CONFIG_APP_ROLLBACK_ENABLE=y
|
||||||
|
# CONFIG_APP_ANTI_ROLLBACK is not set
|
||||||
# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set
|
# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set
|
||||||
# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set
|
CONFIG_LOG_BOOTLOADER_LEVEL_ERROR=y
|
||||||
# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set
|
# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set
|
||||||
CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y
|
# CONFIG_LOG_BOOTLOADER_LEVEL_INFO is not set
|
||||||
# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set
|
# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set
|
||||||
# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set
|
# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set
|
||||||
CONFIG_LOG_BOOTLOADER_LEVEL=3
|
CONFIG_LOG_BOOTLOADER_LEVEL=1
|
||||||
# CONFIG_FLASH_ENCRYPTION_ENABLED is not set
|
# CONFIG_FLASH_ENCRYPTION_ENABLED is not set
|
||||||
# CONFIG_FLASHMODE_QIO is not set
|
# CONFIG_FLASHMODE_QIO is not set
|
||||||
# CONFIG_FLASHMODE_QOUT is not set
|
# CONFIG_FLASHMODE_QOUT is not set
|
||||||
CONFIG_FLASHMODE_DIO=y
|
CONFIG_FLASHMODE_DIO=y
|
||||||
# CONFIG_FLASHMODE_DOUT is not set
|
# CONFIG_FLASHMODE_DOUT is not set
|
||||||
CONFIG_MONITOR_BAUD=115200
|
CONFIG_MONITOR_BAUD=115200
|
||||||
CONFIG_OPTIMIZATION_LEVEL_DEBUG=y
|
# CONFIG_OPTIMIZATION_LEVEL_DEBUG is not set
|
||||||
CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG=y
|
# CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set
|
||||||
CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y
|
# CONFIG_COMPILER_OPTIMIZATION_DEFAULT is not set
|
||||||
# CONFIG_OPTIMIZATION_LEVEL_RELEASE is not set
|
# CONFIG_OPTIMIZATION_LEVEL_RELEASE is not set
|
||||||
# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set
|
# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set
|
||||||
CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y
|
CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y
|
||||||
|
|||||||
Reference in New Issue
Block a user