From b8362b13905adf46a1fb51df47bb69ec672ac3ae Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Wed, 22 Oct 2014 20:08:20 +0100 Subject: [PATCH] hard-reset feature complete --- examples/net_dhcp/net_dhcp.cpp | 20 +++++------ examples/net_dns/net_dns.cpp | 23 ++++++------- examples/net_ftp_server/net_ftp_server.cpp | 27 +++++++-------- examples/net_llip/net_llip.cpp | 30 ++++++++--------- examples/net_ping_client/net_ping_client.cpp | 21 +++++------- examples/net_tcp_client/net_tcp_client.cpp | 10 +++--- examples/net_tcp_server/net_tcp_server.cpp | 11 +++---- examples/net_udp_receive/net_udp_receive.cpp | 22 ++++++------- .../net_udp_receive_async.cpp | 15 ++++----- examples/net_udp_send/net_udp_send.cpp | 33 +++++++++---------- examples/net_web_client/net_web_client.cpp | 6 ++-- examples/net_web_pframe/net_web_pframe.cpp | 16 ++++----- examples/net_web_server/net_web_server.cpp | 26 +++++++-------- lib/include/net/datalink/mac/Mac.h | 2 +- lib/include/net/physical/PhyBase.h | 4 +-- lib/include/net/physical/PhyHardReset.h | 12 ++++--- 16 files changed, 128 insertions(+), 150 deletions(-) diff --git a/examples/net_dhcp/net_dhcp.cpp b/examples/net_dhcp/net_dhcp.cpp index d9a74f98..b45cb0f7 100644 --- a/examples/net_dhcp/net_dhcp.cpp +++ b/examples/net_dhcp/net_dhcp.cpp @@ -15,13 +15,11 @@ using namespace stm32plus::net; /** - * This examples demonstrates the use of the DHCP client to - * fetch your IP address, subnet mask, default gateway and - * DNS servers. + * This examples demonstrates the use of the DHCP client to fetch your IP address, subnet mask, + * default gateway and DNS servers. * - * A DHCP lease is time limited. Half way through the lease time - * you will receive a notification event informing you that the - * DHCP client is going to automatically renew the lease. An error + * A DHCP lease is time limited. Half way through the lease time you will receive a notification + * event informing you that the DHCP client is going to automatically renew the lease. An error * notification will be raised if the renewal fails. * * The results and any errors are sent to USART3 (57000/8/N/1). @@ -40,11 +38,10 @@ using namespace stm32plus::net; * PHYSICAL: | DP83848C | * +----------------------------- * - * This example is also tested using the KSZ8051MLL in MII mode - * instead of the DP83848C/RMII. The KSZ8051MLL test was performed - * on the STM32F107. The DP83848C was tested on the STM32F407. To - * reconfigure this demo for the F107 using remapped MAC pins connected - * to the KSZ8051MLL change the physical and datalink layers thus: + * This example is also tested using the KSZ8051MLL in MII mode instead of the DP83848C/RMII. The + * KSZ8051MLL test was performed on the STM32F107. The DP83848C was tested on the STM32F407. To + * reconfigure this demo for the F107 using remapped MAC pins connected to the KSZ8051MLL change the + * physical and datalink layers thus: * * typedef PhysicalLayer MyPhysicalLayer; * typedef DatalinkLayer MyDatalinkLayer; @@ -52,6 +49,7 @@ using namespace stm32plus::net; * Tested on devices: * STM32F107VCT6 * STM32F407VGT6 + * STM32F407ZGT6 */ class NetDhcpClientTest { diff --git a/examples/net_dns/net_dns.cpp b/examples/net_dns/net_dns.cpp index 0481ad5f..53dcf109 100644 --- a/examples/net_dns/net_dns.cpp +++ b/examples/net_dns/net_dns.cpp @@ -15,16 +15,13 @@ using namespace stm32plus::net; /** - * This examples demonstrates the use of the DNS client to - * look up a host name on the internet. In this example we will - * look up "www.google.co.uk". After obtaining an IP address and - * our DNS servers via DHCP this example will perform the DNS lookup. + * This examples demonstrates the use of the DNS client to look up a host name on the internet. + * In this example we will look up "www.google.co.uk". After obtaining an IP address and our DNS + * servers via DHCP this example will perform the DNS lookup. * - * The results of the DNS query and any errors are sent to - * USART3 configured as 57600/8/N/1. + * The results of the DNS query and any errors are sent to USART3 configured as 57600/8/N/1. * - * DHCP lease renewal is not considered here - see the DHCP example for the - * correct procedure. + * DHCP lease renewal is not considered here - see the DHCP example for the correct procedure. * * Here's how the network stack for this example is configured: * @@ -40,11 +37,10 @@ using namespace stm32plus::net; * PHYSICAL: | DP83848C | * +----------------------------- * - * This example is also tested using the KSZ8051MLL in MII mode - * instead of the DP83848C/RMII. The KSZ8051MLL test was performed - * on the STM32F107. The DP83848C was tested on the STM32F407. To - * reconfigure this demo for the F107 using remapped MAC pins connected - * to the KSZ8051MLL change the physical and datalink layers thus: + * This example is also tested using the KSZ8051MLL in MII mode instead of the DP83848C/RMII. + * The KSZ8051MLL test was performed on the STM32F107. The DP83848C was tested on the STM32F407. + * To reconfigure this demo for the F107 using remapped MAC pins connected to the KSZ8051MLL change + * the physical and datalink layers thus: * * typedef PhysicalLayer MyPhysicalLayer; * typedef DatalinkLayer MyDatalinkLayer; @@ -52,6 +48,7 @@ using namespace stm32plus::net; * Tested on devices: * STM32F107VCT6 * STM32F407VGT6 + * STM32F407ZGT6 */ diff --git a/examples/net_ftp_server/net_ftp_server.cpp b/examples/net_ftp_server/net_ftp_server.cpp index 8a279621..de104875 100644 --- a/examples/net_ftp_server/net_ftp_server.cpp +++ b/examples/net_ftp_server/net_ftp_server.cpp @@ -19,21 +19,18 @@ using namespace stm32plus::net; /** - * This demo brings together a number of the stm32plus components, namely - * the network stack, the RTC, the SD card and the FAT16/32 filesystem - * to build a simple ftp server that listens on port 21. + * This demo brings together a number of the stm32plus components, namely the network stack, + * the RTC, the SD card and the FAT16/32 filesystem to build a simple ftp server that listens + * on port 21. * - * The server supports authenticated and (optionally) anonymous connections. - * It requires you to create a top-level directory on your SD card called - * "ftp" and that "ftp" directory must contain a text file called "server.ini". - * An example "server.ini" file is included in the same directory as this - * example. Every option is explained in detail in the example server.ini, - * please do read it. + * The server supports authenticated and (optionally) anonymous connections. It requires you to + * create a top-level directory on your SD card called "ftp" and that "ftp" directory must contain + * a text file called "server.ini". An example "server.ini" file is included in the same directory + * as this example. Every option is explained in detail in the example server.ini, please do read it. * - * Only passive mode is supported by this server. I have tested this server - * against cygwin/linux command line clients as well as IE10, Firefox 13 and - * Chrome 28. The Windows 7 command line ftp client is not supported due to - * its lack of passive mode support. + * Only passive mode is supported by this server. I have tested this server against cygwin/linux + * command line clients as well as IE10, Firefox 13 and Chrome 28. The Windows 7 command line ftp + * client is not supported due to its lack of passive mode support. * * +----------------------------+ * APPLICATION: | DhcpClient | @@ -47,8 +44,8 @@ using namespace stm32plus::net; * PHYSICAL: | DP83848C | * +----------------------------+ * - * This example is only compatible with the F4 because it requires the SDIO - * peripheral to communicate with the SD card. + * This example is only compatible with the F4 because it requires the SDIO peripheral to communicate + * with the SD card. * * Tested on devices: * STM32F407VGT6 diff --git a/examples/net_llip/net_llip.cpp b/examples/net_llip/net_llip.cpp index 23e0e535..164005a1 100644 --- a/examples/net_llip/net_llip.cpp +++ b/examples/net_llip/net_llip.cpp @@ -15,24 +15,21 @@ using namespace stm32plus::net; /** - * This examples demonstrates the use of the Link Local IP client - * to automatically select an unused IP address from the "link local" - * class B network: 169.254/16. Link-local addresses can be used - * in a scenario where a DHCP server is not available, such as when - * a number of computers are directly connected to each other. + * This examples demonstrates the use of the Link Local IP client to automatically select an unused + * IP address from the "link local" class B network: 169.254/16. Link-local addresses can be used + * in a scenario where a DHCP server is not available, such as when a number of computers are directly + * connected to each other. * - * If an address collision is detected while the stack is running then - * a new address will be automatically generated and broadcast to the - * stack modules. You can simulate this condition by using the linux - * NPING utility to hand-craft a colliding ARP packet. For example, if - * you have been assigned 169.254.232.52: + * If an address collision is detected while the stack is running then a new address will be + * automatically generated and broadcast to the stack modules. You can simulate this condition by using + * the linux NPING utility to hand-craft a colliding ARP packet. For example, if you have been assigned + * 169.254.232.52: * * $ nping 169.254.232.52 --arp --arp-type arp-request --arp-sender-mac \ * 00:0a:34:30:fe:ae --arp-sender-ip 169.254.232.52 --arp-target-mac \ * 00:00:00:00:00:00 --arp-target-ip 169.254.232.52 * - * You can then use tcpdump or wireshark to observe this module searching - * for a new address. + * You can then use tcpdump or wireshark to observe this module searching for a new address. * * The results and any errors are sent to USART3 (57000/8/N/1). * @@ -50,11 +47,10 @@ using namespace stm32plus::net; * PHYSICAL: | DP83848C | * +----------------------------- * - * This example is also tested using the KSZ8051MLL in MII mode - * instead of the DP83848C/RMII. The KSZ8051MLL test was performed - * on the STM32F107. The DP83848C was tested on the STM32F407. To - * reconfigure this demo for the F107 using remapped MAC pins connected - * to the KSZ8051MLL change the physical and datalink layers thus: + * This example is also tested using the KSZ8051MLL in MII mode instead of the DP83848C/RMII. + * The KSZ8051MLL test was performed on the STM32F107. The DP83848C was tested on the STM32F407. To + * reconfigure this demo for the F107 using remapped MAC pins connected to the KSZ8051MLL change + * the physical and datalink layers thus: * * typedef PhysicalLayer MyPhysicalLayer; * typedef DatalinkLayer MyDatalinkLayer; diff --git a/examples/net_ping_client/net_ping_client.cpp b/examples/net_ping_client/net_ping_client.cpp index ee2d7dba..123b5e5d 100644 --- a/examples/net_ping_client/net_ping_client.cpp +++ b/examples/net_ping_client/net_ping_client.cpp @@ -16,14 +16,12 @@ using namespace stm32plus::net; /** - * This example demonstrates the ICMP transport by sending periodic - * echo requests (pings) to a hardcoded IP address (change it to suit your - * network). + * This example demonstrates the ICMP transport by sending periodic echo requests (pings) to a + * hardcoded IP address (change it to suit your network). * - * This network stack is about as simple as it gets. We don't even - * use DHCP for client configuration so you'll need to be connected to a - * network that understands that you have the static IP address configured - * in this example. + * This network stack is about as simple as it gets. We don't even use DHCP for client configuration + * so you'll need to be connected to a network that understands that you have the static IP address + * configured in this example. * * Here's how the network stack for this example is configured: * @@ -39,11 +37,10 @@ using namespace stm32plus::net; * PHYSICAL: | DP83848C | * +----------------------------- * - * This example is also tested using the KSZ8051MLL in MII mode - * instead of the DP83848C/RMII. The KSZ8051MLL test was performed - * on the STM32F107. The DP83848C was tested on the STM32F407. To - * reconfigure this demo for the F107 using remapped MAC pins connected - * to the KSZ8051MLL change the physical and datalink layers thus: + * This example is also tested using the KSZ8051MLL in MII mode instead of the DP83848C/RMII. The + * KSZ8051MLL test was performed on the STM32F107. The DP83848C was tested on the STM32F407. To + * reconfigure this demo for the F107 using remapped MAC pins connected to the KSZ8051MLL change the + * physical and datalink layers thus: * * typedef PhysicalLayer MyPhysicalLayer; * typedef DatalinkLayer MyDatalinkLayer; diff --git a/examples/net_tcp_client/net_tcp_client.cpp b/examples/net_tcp_client/net_tcp_client.cpp index c5a5edbd..045b060d 100644 --- a/examples/net_tcp_client/net_tcp_client.cpp +++ b/examples/net_tcp_client/net_tcp_client.cpp @@ -15,11 +15,11 @@ using namespace stm32plus::net; /** - * This example demonstrates a TCP 'echo' client. It will attempt to connect to a server - * on a remote computer and send it a line of text. The server will read that line of text - * and then send it back in reverse. An example server, written in perl, is included in - * this example code directory. It can be run directly on Linux or Linux-alike systems - * such as cygwin or msys on Windows. The reversed string will be sent to the USART. + * This example demonstrates a TCP 'echo' client. It will attempt to connect to a server on a remote + * computer and send it a line of text. The server will read that line of text and then send it back + * in reverse. An example server, written in perl, is included in this example code directory. + * It can be run directly on Linux or Linux-alike systems such as cygwin or msys on Windows. The + * reversed string will be sent to the USART. * * I use Usart3, remap-2 with settings 57000/8/N/1. * diff --git a/examples/net_tcp_server/net_tcp_server.cpp b/examples/net_tcp_server/net_tcp_server.cpp index fd33acd5..a2a93832 100644 --- a/examples/net_tcp_server/net_tcp_server.cpp +++ b/examples/net_tcp_server/net_tcp_server.cpp @@ -15,12 +15,11 @@ using namespace stm32plus::net; /** - * This example demonstrates a TCP 'echo' server. Telnet to this server and type lines of - * text at it to see them echo'd back. Maximum 100 characters per line, please. Multiple - * simultaneous connections are supported up to the configured maximum per server. The - * 'TcpConnectionArray' class takes care of the connection multiplexing for you. All you need - * to do to run a server is subclass TcpConnection and implement the handleRead(), handleWrite() - * and handleClose() methods as demonstrated below. + * This example demonstrates a TCP 'echo' server. Telnet to this server and type lines of text at it + * to see them echo'd back. Maximum 100 characters per line, please. Multiple simultaneous connections + * are supported up to the configured maximum per server. The 'TcpConnectionArray' class takes care of + * the connection multiplexing for you. All you need to do to run a server is subclass TcpConnection + * and implement the handleRead(), handleWrite() and handleClose() methods as demonstrated below. * * +----------------------------+ * APPLICATION: | DhcpClient | diff --git a/examples/net_udp_receive/net_udp_receive.cpp b/examples/net_udp_receive/net_udp_receive.cpp index 192c3624..b1c426cd 100644 --- a/examples/net_udp_receive/net_udp_receive.cpp +++ b/examples/net_udp_receive/net_udp_receive.cpp @@ -15,26 +15,24 @@ using namespace stm32plus::net; /** - * This example demonstrates how to receive UDP packets from a remote host. - * After obtaining an IP address via DHCP this example will wait for UDP - * datagrams to arrive on port 12345. When a datagram arrives it will print - * the first 10 bytes to USART #3. + * This example demonstrates how to receive UDP packets from a remote host. After obtaining an IP + * address via DHCP this example will wait for UDP datagrams to arrive on port 12345. When a datagram + * arrives it will print the first 10 bytes to USART #3. * - * For testing I recommend the Linux NPING utility that allows you to create - * hand-crafted network packets to send to your device. For example, here's how - * to send a byte sequence of 1..10 to your device on 192.168.1.5 using nping: + * For testing I recommend the Linux NPING utility that allows you to create hand-crafted network + * packets to send to your device. For example, here's how to send a byte sequence of 1..10 to your + * device on 192.168.1.5 using nping: * * nping --udp 192.168.1.10 -p 12345 --data 0102030405060708090a * - * The ICMP protocol is included to demonstrate how you'll get a "port - * unreachable" error if you try to hit a port other than 12345. This feature - * can be individually controlled or ICMP can be left out entirely. + * The ICMP protocol is included to demonstrate how you'll get a "port unreachable" error if you try + * to hit a port other than 12345. This feature can be individually controlled or ICMP can be left out + * entirely. * * If there are any errors then they are output to a USART which for me is * USART3 57600/8/N/1 * - * DHCP lease renewal is not considered here - see the DHCP example for the - * correct procedure. + * DHCP lease renewal is not considered here - see the DHCP example for the correct procedure. * * Here's how the network stack for this example is configured: * diff --git a/examples/net_udp_receive_async/net_udp_receive_async.cpp b/examples/net_udp_receive_async/net_udp_receive_async.cpp index decf0b3a..d4b4f377 100644 --- a/examples/net_udp_receive_async/net_udp_receive_async.cpp +++ b/examples/net_udp_receive_async/net_udp_receive_async.cpp @@ -15,15 +15,14 @@ using namespace stm32plus::net; /** - * This example demonstrates how to receive UDP packets from a remote host. - * After obtaining an IP address via DHCP this example will wait for UDP - * datagrams to arrive on port 12345. When a datagram arrives it will print - * the first 10 bytes to USART #3. The reception is done asynchronously via - * a subscription to an event provided by the network stack's UDP module. + * This example demonstrates how to receive UDP packets from a remote host. After obtaining an IP + * address via DHCP this example will wait for UDP datagrams to arrive on port 12345. When a + * datagram arrives it will print the first 10 bytes to USART #3. The reception is done + * asynchronously via a subscription to an event provided by the network stack's UDP module. * - * For testing I recommend the Linux NPING utility that allows you to create - * hand-crafted network packets to send to your device. For example, here's how - * to send a byte sequence of 1..10 to your device on 192.168.1.5 using nping: + * For testing I recommend the Linux NPING utility that allows you to create hand-crafted + * network packets to send to your device. For example, here's how to send a byte sequence of + * 1..10 to your device on 192.168.1.5 using nping: * * nping --udp 192.168.1.5 -p 12345 --data 0102030405060708090a * diff --git a/examples/net_udp_send/net_udp_send.cpp b/examples/net_udp_send/net_udp_send.cpp index 6493fbc7..970a9e52 100644 --- a/examples/net_udp_send/net_udp_send.cpp +++ b/examples/net_udp_send/net_udp_send.cpp @@ -15,19 +15,17 @@ using namespace stm32plus::net; /** - * This example demonstrates how to send UDP packets to a remote host. After - * obtaining an IP address via DHCP this example will send three 2Kb UDP packets - * to a remote host every 5 seconds. The target IP address is hardcoded into - * this example code and you can change it to fit your network configuration. + * This example demonstrates how to send UDP packets to a remote host. After obtaining an IP + * address via DHCP this example will send three 2Kb UDP packets to a remote host every 5 seconds. + * The target IP address is hardcoded into this example code and you can change it to fit your + * network configuration. * - * I recommend either tcpdump (linux) or wireshark (windows) for observing the - * incoming packets. The requisite wireshark filter is "udp.dstport==12345" + * I recommend either tcpdump (linux) or wireshark (windows) for observing the incoming packets. + * The requisite wireshark filter is "udp.dstport==12345" * - * If there are any errors then they are output to a USART which for me is - * USART3 57600/8/N/1 + * If there are any errors then they are output to a USART which for me is USART3 57600/8/N/1 * - * DHCP lease renewal is not considered here - see the DHCP example for the - * correct procedure. + * DHCP lease renewal is not considered here - see the DHCP example for the correct procedure. * * Here's how the network stack for this example is configured: * @@ -43,11 +41,10 @@ using namespace stm32plus::net; * PHYSICAL: | DP83848C | * +----------------------------- * - * This example is also tested using the KSZ8051MLL in MII mode - * instead of the DP83848C/RMII. The KSZ8051MLL test was performed - * on the STM32F107. The DP83848C was tested on the STM32F407. To - * reconfigure this demo for the F107 using remapped MAC pins connected - * to the KSZ8051MLL change the physical and datalink layers thus: + * This example is also tested using the KSZ8051MLL in MII mode instead of the DP83848C/RMII. + * The KSZ8051MLL test was performed on the STM32F107. The DP83848C was tested on the STM32F407. + * To reconfigure this demo for the F107 using remapped MAC pins connected to the KSZ8051MLL change + * the physical and datalink layers thus: * * typedef PhysicalLayer MyPhysicalLayer; * typedef DatalinkLayer MyDatalinkLayer; @@ -65,8 +62,8 @@ class NetUdpSendTest { * Types that define the network stack */ - typedef PhysicalLayer MyPhysicalLayer; - typedef DatalinkLayer MyDatalinkLayer; + typedef PhysicalLayer MyPhysicalLayer; + typedef DatalinkLayer MyDatalinkLayer; typedef NetworkLayer MyNetworkLayer; typedef TransportLayer MyTransportLayer; typedef ApplicationLayer MyApplicationLayer; @@ -144,7 +141,7 @@ class NetUdpSendTest { // IP multicast senders are supported so feel free to use the multicast host group // range if that's what you want. - IpAddress ipAddress("192.168.1.2"); + IpAddress ipAddress("192.168.1.12"); // Set up a buffer full of a test pattern. The buffer is 50 bytes in size and as such is // guaranteed to easily fit within the ethernet MTU size. diff --git a/examples/net_web_client/net_web_client.cpp b/examples/net_web_client/net_web_client.cpp index e9161392..de7f8573 100644 --- a/examples/net_web_client/net_web_client.cpp +++ b/examples/net_web_client/net_web_client.cpp @@ -16,9 +16,9 @@ using namespace stm32plus::net; /** - * This example shows how to use the HttpClientConnection to retrieve an HTTP resource. - * In this example we will connect to http://www.st.com and ask for the root document. - * We will write the response to the USART. + * This example shows how to use the HttpClientConnection to retrieve an HTTP resource. In this example + * we will connect to http://www.st.com and ask for the root document. We will write the response to + * the USART. * * I use USART3, remap-2 with settings 57000/8/N/1. * diff --git a/examples/net_web_pframe/net_web_pframe.cpp b/examples/net_web_pframe/net_web_pframe.cpp index c01059d5..3a948111 100644 --- a/examples/net_web_pframe/net_web_pframe.cpp +++ b/examples/net_web_pframe/net_web_pframe.cpp @@ -21,14 +21,12 @@ extern uint32_t ErrorPixels,ErrorPixelsSize; /** - * This example demonstrates a cycling 'picture frame' of JPEG images - * downloaded from the internet and displayed on the attached LCD - * screen. The images are pre-sized to fit the QVGA screen and are - * located in a directory on my website. + * This example demonstrates a cycling 'picture frame' of JPEG images downloaded from the internet and + * displayed on the attached LCD screen. The images are pre-sized to fit the QVGA screen and are located + * in a directory on my website. * - * The examples works by reading an 'index' text file from the web - * site which tells it how many images there are and what their URLs - * are. The example then goes into a loop retrieving each JPEG image + * The examples works by reading an 'index' text file from the web site which tells it how many images + * there are and what their URLs are. The example then goes into a loop retrieving each JPEG image * and displaying it on the LCD. * * +----------------------------+ @@ -43,8 +41,8 @@ extern uint32_t ErrorPixels,ErrorPixelsSize; * PHYSICAL: | DP83848C | * +----------------------------+ * - * This is example is only compatible with the F4 because it - * requires the FSMC peripheral to drive the LCD. + * This is example is only compatible with the F4 because it requires the FSMC peripheral to drive + * the LCD. * * Tested on devices: * STM32F407VGT6 diff --git a/examples/net_web_server/net_web_server.cpp b/examples/net_web_server/net_web_server.cpp index 6f32f7ac..adbd1639 100644 --- a/examples/net_web_server/net_web_server.cpp +++ b/examples/net_web_server/net_web_server.cpp @@ -17,16 +17,14 @@ using namespace stm32plus::net; /** - * This demo brings together a number of the stm32plus components, namely - * the network stack, the RTC, the SD card and the FAT16/32 filesystem - * to build a simple web server that listens on port 80. + * This demo brings together a number of the stm32plus components, namely the network stack, the RTC, + * the SD card and the FAT16/32 filesystem to build a simple web server that listens on port 80. * - * Files are served starting from the root directory on the SD card. HTTP GET - * is the only action supported. A number of content-type mappings are supported - * and may be extended by amending MyHttpConnection.h accordingly. The client URI - * must match a physical file on the card. e.g. http://yourserver/foo/bar.html - * expects to find a file called /foo/bar.html on the SD card. The server supports - * HTTP/1.1 persistent connections. + * Files are served starting from the root directory on the SD card. HTTP GET is the only action + * supported. A number of content-type mappings are supported and may be extended by amending + * MyHttpConnection.h accordingly. The client URI must match a physical file on the card. e.g. + * http://yourserver/foo/bar.html expects to find a file called /foo/bar.html on the SD card. The + * server supports HTTP/1.1 persistent connections. * * +----------------------------+ * APPLICATION: | DhcpClient | @@ -40,12 +38,12 @@ using namespace stm32plus::net; * PHYSICAL: | DP83848C | * +----------------------------+ * - * This example is only compatible with the F4 because it requires the SDIO - * peripheral to be able to talk to the SD card. + * This example is only compatible with the F4 because it requires the SDIO peripheral to be able + * to talk to the SD card. * - * An example website is included in the 'www' subdirectory of this card. To use, - * copy 'www' to the root directory of your SD card, run this example and then - * retrieve it from your web browser at "http:///www/index.html" + * An example website is included in the 'www' subdirectory of this card. To use, copy 'www' to the + * root directory of your SD card, run this example and then retrieve it from your web browser at + * "http:///www/index.html" * * Tested on devices: * STM32F407VGT6 diff --git a/lib/include/net/datalink/mac/Mac.h b/lib/include/net/datalink/mac/Mac.h index 7c6d8702..77318066 100644 --- a/lib/include/net/datalink/mac/Mac.h +++ b/lib/include/net/datalink/mac/Mac.h @@ -246,7 +246,7 @@ namespace stm32plus { // reset the PHY - if(!this->phyReset()) + if(!this->phySoftReset()) return false; if(params.ETH_AutoNegotiation!=ETH_AutoNegotiation_Disable) { diff --git a/lib/include/net/physical/PhyBase.h b/lib/include/net/physical/PhyBase.h index 9f81325c..82e8b444 100644 --- a/lib/include/net/physical/PhyBase.h +++ b/lib/include/net/physical/PhyBase.h @@ -108,7 +108,7 @@ namespace stm32plus { bool phySetRegisterBits(uint16_t regNumber,uint16_t bits) const; bool phyClearRegisterBits(uint16_t regNumber,uint16_t bits) const; - bool phyReset() const; + bool phySoftReset() const; void phyPostConfigurationDelay() const; bool phyWaitForLink() const; @@ -167,7 +167,7 @@ namespace stm32plus { * @return true if it worked */ - inline bool PhyBase::phyReset() const { + inline bool PhyBase::phySoftReset() const { // write the reset bit diff --git a/lib/include/net/physical/PhyHardReset.h b/lib/include/net/physical/PhyHardReset.h index 5b7b37a8..99d3e95c 100755 --- a/lib/include/net/physical/PhyHardReset.h +++ b/lib/include/net/physical/PhyHardReset.h @@ -12,10 +12,14 @@ namespace stm32plus { namespace net { /* - * Provides optional support for issuing a hard reset to the PHY via - * a GPIO pin. The PHY itself must support phyHardReset() and phyInitialiseReset() - * methods. The TResetGpio template parameter should be one of the GpioPinMap.h types - * e.g. gpio::PB14 + * Provides optional support for issuing a hard reset to the PHY via its own active-low + * reset pin. This is the most reliable method of resetting the PHY even if it's hung hard. + * + * Here's an example of how to include this feature in the physical layer of your network + * stack. In this example PB14 is connected to the PHY reset pin. + * + * template using MyPhyHardReset=PhyHardReset; + * typedef PhysicalLayer MyPhysicalLayer; */ template