Compare commits
12 Commits
main
...
ae9860aec7
| Author | SHA1 | Date | |
|---|---|---|---|
| ae9860aec7 | |||
| 724fda0889 | |||
| 1cfde391c1 | |||
| 79766040ca | |||
| 81e5f0209f | |||
| ab7d74a3f5 | |||
| eaa3604b23 | |||
| b18da6ed34 | |||
| c4eb5ff35d | |||
| 6699e2e6bf | |||
| 1fa8b9382d | |||
| 25cd8e5364 |
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
build
|
||||||
|
.vscode
|
||||||
|
.DS_Store
|
||||||
|
sdkconfig.old
|
||||||
6
.gitmodules
vendored
Normal file
6
.gitmodules
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[submodule "components/zh_pcf8574"]
|
||||||
|
path = components/zh_pcf8574
|
||||||
|
url = http://git.zh.com.ru/alexey.zholtikov/zh_pcf8574
|
||||||
|
[submodule "components/zh_vector"]
|
||||||
|
path = components/zh_vector
|
||||||
|
url = http://git.zh.com.ru/alexey.zholtikov/zh_vector
|
||||||
3
CMakeLists.txt
Executable file
3
CMakeLists.txt
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||||
|
project(ate0004)
|
||||||
BIN
cad/ATE0004.000.00 СБ _ Корпус.a3d
Normal file
BIN
cad/ATE0004.000.00 СБ _ Корпус.a3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.000.001 _ Низ.m3d
Normal file
BIN
cad/ATE0004.000.001 _ Низ.m3d
Normal file
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.
BIN
cad/ATE0004.000.002 _ Перед.m3d
Normal file
BIN
cad/ATE0004.000.002 _ Перед.m3d
Normal file
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.
BIN
cad/ATE0004.000.003 _ Зад.m3d
Normal file
BIN
cad/ATE0004.000.003 _ Зад.m3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.000.004 _ Верх.m3d
Normal file
BIN
cad/ATE0004.000.004 _ Верх.m3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.000.005 _ Ножка.m3d
Normal file
BIN
cad/ATE0004.000.005 _ Ножка.m3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.000.006 _ Кнопка.m3d
Normal file
BIN
cad/ATE0004.000.006 _ Кнопка.m3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.000.007 _ KLS5-254.m3d
Normal file
BIN
cad/ATE0004.000.007 _ KLS5-254.m3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.001.000 СБ _ DUWI 26840.a3d
Normal file
BIN
cad/ATE0004.001.000 СБ _ DUWI 26840.a3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.001.001 _ Кнопка.m3d
Normal file
BIN
cad/ATE0004.001.001 _ Кнопка.m3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.001.002 _ Корпус.m3d
Normal file
BIN
cad/ATE0004.001.002 _ Корпус.m3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.002.000 СБ _ BANANA BLACK.a3d
Normal file
BIN
cad/ATE0004.002.000 СБ _ BANANA BLACK.a3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.002.001 _ Ось.m3d
Normal file
BIN
cad/ATE0004.002.001 _ Ось.m3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.002.002 _ Корпус.m3d
Normal file
BIN
cad/ATE0004.002.002 _ Корпус.m3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.003.000 СБ _ BANANA BLUE.a3d
Normal file
BIN
cad/ATE0004.003.000 СБ _ BANANA BLUE.a3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.003.001 _ Ось.m3d
Normal file
BIN
cad/ATE0004.003.001 _ Ось.m3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.003.002 _ Корпус.m3d
Normal file
BIN
cad/ATE0004.003.002 _ Корпус.m3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.004.000 СБ _ BANANA GREEN.a3d
Normal file
BIN
cad/ATE0004.004.000 СБ _ BANANA GREEN.a3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.004.001 _ Ось.m3d
Normal file
BIN
cad/ATE0004.004.001 _ Ось.m3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.004.002 _ Корпус.m3d
Normal file
BIN
cad/ATE0004.004.002 _ Корпус.m3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.005.000 СБ _ BANANA YELLOW.a3d
Normal file
BIN
cad/ATE0004.005.000 СБ _ BANANA YELLOW.a3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.005.001 _ Ось.m3d
Normal file
BIN
cad/ATE0004.005.001 _ Ось.m3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.005.002 _ Корпус.m3d
Normal file
BIN
cad/ATE0004.005.002 _ Корпус.m3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.006.000 СБ _ BANANA RED.a3d
Normal file
BIN
cad/ATE0004.006.000 СБ _ BANANA RED.a3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.006.001 _ Ось.m3d
Normal file
BIN
cad/ATE0004.006.001 _ Ось.m3d
Normal file
Binary file not shown.
BIN
cad/ATE0004.006.002 _ Корпус.m3d
Normal file
BIN
cad/ATE0004.006.002 _ Корпус.m3d
Normal file
Binary file not shown.
1
components/zh_pcf8574
Submodule
1
components/zh_pcf8574
Submodule
Submodule components/zh_pcf8574 added at c9365e40ba
1
components/zh_vector
Submodule
1
components/zh_vector
Submodule
Submodule components/zh_vector added at b487617d3a
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
main/CMakeLists.txt
Executable file
1
main/CMakeLists.txt
Executable file
@@ -0,0 +1 @@
|
|||||||
|
idf_component_register(SRCS "main.c" INCLUDE_DIRS "" REQUIRES zh_pcf8574)
|
||||||
93
main/main.c
Executable file
93
main/main.c
Executable file
@@ -0,0 +1,93 @@
|
|||||||
|
#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);
|
||||||
|
}
|
||||||
BIN
pcb/BOM_ATE0004.000.001.xlsx
Normal file
BIN
pcb/BOM_ATE0004.000.001.xlsx
Normal file
Binary file not shown.
BIN
pcb/BOM_ATE0004.000.001_ATE0004.000.001_2025-10-21.xlsx
Normal file
BIN
pcb/BOM_ATE0004.000.001_ATE0004.000.001_2025-10-21.xlsx
Normal file
Binary file not shown.
BIN
pcb/Gerber_ATE0003.000.001_v.1.zip
Normal file
BIN
pcb/Gerber_ATE0003.000.001_v.1.zip
Normal file
Binary file not shown.
BIN
pcb/Gerber_ATE0004.000.001_2025-10-21.zip
Normal file
BIN
pcb/Gerber_ATE0004.000.001_2025-10-21.zip
Normal file
Binary file not shown.
BIN
pcb/Gerber_ATE0004.000.001_v.1.zip
Normal file
BIN
pcb/Gerber_ATE0004.000.001_v.1.zip
Normal file
Binary file not shown.
26740
pcb/SCH_ATE0004.000.001_2025-10-21.pdf
Normal file
26740
pcb/SCH_ATE0004.000.001_2025-10-21.pdf
Normal file
File diff suppressed because it is too large
Load Diff
BIN
pcb/Информационная_карта_ООО_АЭРОТЭЧ.pdf
Normal file
BIN
pcb/Информационная_карта_ООО_АЭРОТЭЧ.pdf
Normal file
Binary file not shown.
BIN
pcb/бланк заказа филиал ЭК Мск.xlsx
Normal file
BIN
pcb/бланк заказа филиал ЭК Мск.xlsx
Normal file
Binary file not shown.
1
version.txt
Normal file
1
version.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
1.0.0
|
||||||
Reference in New Issue
Block a user