mirror of
https://github.com/espressif/esp-idf.git
synced 2026-06-04 20:26:38 +03:00
Add internal EMAC support for ESP32-S31, including: - HAL/LL layer: emac_ll, emac_hal, emac_clk, emac_periph for S31 - SOC layer: register structs, soc_caps, peripherals linker script, interrupt definitions - MAC driver: clock source configuration via Kconfig, GPIO/DMA adaptations, PHY register defs for clause-45 MDIO - Ethernet examples updated for S31 (basic, build-test-rules, PTP readme) - Refactored existing ESP32/ESP32-P4 EMAC code for shared patterns (emac_clk extraction, struct alignment, periph descriptor cleanup)
45 lines
824 B
C
45 lines
824 B
C
/*
|
|
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#pragma once
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include "soc/soc_caps.h"
|
|
#include "soc/clk_tree_defs.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#if SOC_EMAC_SUPPORTED
|
|
|
|
typedef struct {
|
|
soc_module_clk_t clk_id;
|
|
int32_t step_hz;
|
|
int16_t max_steps;
|
|
const char *clk_name;
|
|
} emac_clk_info_t;
|
|
|
|
typedef struct {
|
|
size_t clk_count;
|
|
const emac_clk_info_t **clk_src;
|
|
} emac_clk_internal_info_t;
|
|
|
|
typedef struct {
|
|
soc_module_clk_t derived_clk_id;
|
|
size_t clk_count;
|
|
const emac_clk_info_t **clk_src;
|
|
} emac_clk_phy_ref_info_t;
|
|
|
|
extern const emac_clk_internal_info_t emac_clk_internal;
|
|
extern const emac_clk_phy_ref_info_t emac_clk_phy_ref;
|
|
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|