refactor: 完成R8裸机lwIP移植并更新文档
This commit is contained in:
@@ -1,63 +1,27 @@
|
||||
/**
|
||||
* @file ethernetif.h
|
||||
* @brief Ethernet interface header for CH390 + LwIP + FreeRTOS
|
||||
* @brief CH390 Ethernet interface for lwIP NO_SYS mode.
|
||||
*/
|
||||
|
||||
#ifndef __ETHERNETIF_H__
|
||||
#define __ETHERNETIF_H__
|
||||
|
||||
#include "lwip/netif.h"
|
||||
#include "lwip/err.h"
|
||||
#include "lwip/netif.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Ethernet interface state structure */
|
||||
struct ethernetif {
|
||||
uint16_t rx_len;
|
||||
uint8_t rx_status;
|
||||
uint8_t rx_status;
|
||||
};
|
||||
|
||||
/* Global network interface */
|
||||
extern struct netif ch390_netif;
|
||||
|
||||
/**
|
||||
* @brief Initialize the ethernet interface
|
||||
* @param netif Network interface structure
|
||||
* @return ERR_OK on success
|
||||
*/
|
||||
err_t ethernetif_init(struct netif *netif);
|
||||
|
||||
/**
|
||||
* @brief Process received ethernet packets
|
||||
* @param netif Network interface structure
|
||||
* @note Call this from the LwIP task when packets are available
|
||||
*/
|
||||
void ethernetif_input(struct netif *netif);
|
||||
|
||||
/**
|
||||
* @brief Initialize LwIP network interface with static IP
|
||||
* @param ipaddr IP address
|
||||
* @param netmask Network mask
|
||||
* @param gw Gateway address
|
||||
*/
|
||||
void lwip_netif_init(const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw);
|
||||
|
||||
/**
|
||||
* @brief Check and handle CH390 interrupt status
|
||||
* @note Call this from the LwIP task periodically or on interrupt
|
||||
*/
|
||||
void ethernetif_check_link(void);
|
||||
|
||||
/**
|
||||
* @brief Process all pending RX packets
|
||||
* @note Call this from the LwIP task when RX interrupt occurs
|
||||
*/
|
||||
void ethernetif_poll(void);
|
||||
void ethernetif_set_irq_pending(void);
|
||||
uint8_t ethernetif_is_irq_pending(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ETHERNETIF_H__ */
|
||||
|
||||
Reference in New Issue
Block a user