当前位置:网站首页>About reconnection of STM32 using lan8720a plug-in network cable

About reconnection of STM32 using lan8720a plug-in network cable

2022-06-25 14:02:00 Full stack programmer webmaster

Hello everyone , I meet you again , I'm your friend, Quan Jun .

About STM32 Use LAN8720A Plug in and reconnect the network cable

In fact, when doing this function, we must be calm , Don't think it's too complicated , See more DATASHEET, Of course, there will be some problems later , So after stepping through the pit , It's been almost a year , It can also be regarded as going back and making a record . 1. About LAN8720 Interpretation of the manual By looking up lan8720 Data collection :

Yellow part , In register mapping, the first register is the basic status register , Then we look up this register and find ,

In the register bit2 It says , When detecting the insertion of network cable, this bit is 1, Otherwise 0. If you know this, it's easy to do , We can judge the access status of the network cable according to this status bit , Then decide whether to operate on Ethernet .

2. Program realization In my program planning, I mainly involve functions : 1. This function is put into While In circulation , Or in the interrupt function of a time base :

2. The function is placed in Net_Rest_Connect Function

3.Net_Rest_Connect function

Here, after judging the connection to the network cable , Initialize the protocol stack and TCP Initialization of the server .

4. Attach project link :https://download.csdn.net/download/tiange1996/85045262

Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/151704.html Link to the original text :https://javaforall.cn

原网站

版权声明
本文为[Full stack programmer webmaster]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206251315423695.html