Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:45

0001 #ifndef FEC_H
0002 #define FEC_H
0003 
0004 #include <arch/sys_arch.h>
0005 #include <lwip/netif.h>
0006 #include <stdbool.h>
0007 
0008 struct if_config {
0009     u8_t flags;
0010     u8_t hwaddr_len;
0011     u16_t mtu;
0012     u8_t hwaddr[NETIF_MAX_HWADDR_LEN];
0013     sys_thread_t net_task;
0014     void(*phy_init)(void);
0015     u8_t name[2];
0016 };
0017 
0018 extern err_t mcf5225xif_init(struct netif *);
0019 extern void handle_rx_frame(struct netif*);
0020 
0021 extern void smi_init(u32_t);
0022 extern void smi_write(u8_t,u8_t,u16_t);
0023 extern u16_t smi_read(u8_t,u8_t);
0024 
0025 #define MAX_FRAME_LEN       1518
0026 #define MTU_SIZE  (MAX_FRAME_LEN-18)
0027 #define MSCR_MII_SPEED(clk)  ((clk/5000000+1)<<1)
0028 #define PHY_ADDR            1
0029 #define PHY_REG_ID1     2   
0030 #define PHY_REG_ID2     3   
0031 
0032 #endif /* FEC_H */