第一次提交:完成了网关的单路485数据采集,还有以太网链接和MQTT配置,实现数据上报和命令下发,差一个断网储存

This commit is contained in:
Wang Beihong
2026-02-01 18:31:06 +08:00
commit b284cb4953
35 changed files with 4338 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
#include <stdio.h>
#include "esp_eth.h"
#include "esp_eth_driver.h"
#include "esp_eth_mac_ch390.h"
#include "esp_eth_phy_ch390.h"
#include "esp_netif.h"
#include "esp_event.h"
#include "driver/spi_master.h"
#include "esp_log.h"
#include "driver/gpio.h"
#define ETH_CS_GPIO (GPIO_NUM_10)
#define ETH_MOSI_GPIO (GPIO_NUM_12)
#define ETH_MISO_GPIO (GPIO_NUM_13)
#define ETH_SCLK_GPIO (GPIO_NUM_11)
#define ETH_INT_GPIO (GPIO_NUM_14)
#define SPI_HOST SPI2_HOST
#define SPI_CLOCK_MHZ 10
void eth_init(void);