Files
2026-08-24 10:03:24 +08:00

48 lines
1.0 KiB
C

/*
* Copyright (c) 2021-2022 Amlogic, Inc. All rights reserved.
*
* SPDX-License-Identifier: MIT
*/
#ifndef __ETH_H__
#define __ETH_H__
#include <stdint.h>
#include <stdbool.h>
#if defined(CONFIG_ETHERNET_CFG)
#include <eth_cfg.h>
#endif /* CONFIG_ETHERNET_CFG */
#ifdef __cplusplus
extern "C" {
#endif
/* ETH Wakeup Reason */
#define ETH_WAKEUP_UNUSED 0x00
#define ETH_WAKEUP_MAGIC 0x01
#define ETH_WAKEUP_MDNS 0x02
#define ETH_WAKEUP_PORT 0x03
extern void vETHInit(void);
extern void vETHDeint(void);
extern void vETHEnableIrq(void);
extern bool xETHIsExternalPhy(void);
extern void vETHMailboxCallback(void);
extern void vETHWakeup(uint8_t reason, bool isr);
/* @binding DATA_TYPE_WKUP_REASON */
extern uint8_t ethWakeupReason;
/* @binding DATA_TYPE_WKUP_SRC */
extern uint32_t ethWakeupSrc;
#if defined(CONFIG_SOC_T5) || defined(CONFIG_SOC_T5D) || \
defined(CONFIG_SOC_T5W) || defined(CONFIG_SOC_TXHD2)
#define ETH_T5_APPLY_WORKAROUND
#endif /* SOC_T5 / SOC_T5D / SOC_T5W / SOC_TXHD2 */
#ifdef __cplusplus
}
#endif
#endif /* __ETH_H__ */