Updated docs

This commit is contained in:
Adam Greenwood-Byrne 2021-11-07 21:26:31 +00:00
parent b859bf1a1b
commit 53a8837fab
5 changed files with 11 additions and 3 deletions

View file

@ -32,4 +32,4 @@ Click on the picture below to watch a quick video of the game in action.
PS: Sorry for the bad audio quality - the game itself sounds great in real life, I promise! PS: Sorry for the bad audio quality - the game itself sounds great in real life, I promise!
[Go to part12-wgt>](../part12-wgt) [Go to part12-wgt >](../part12-wgt)

View file

@ -51,4 +51,4 @@ _Do have a go at building some of the samples (hint: wgt20 and wgt60 are super f
I'm going to move on from here now so we can continue to make progress on the OS itself. I'm going to move on from here now so we can continue to make progress on the OS itself.
[Go to part13-interrupts>](../part13-interrupts) [Go to part13-interrupts >](../part13-interrupts)

View file

@ -150,3 +150,5 @@ Then we update the screen to show our progress!
_And... hey presto! You're handling two system timer interrupts like a pro!_ _And... hey presto! You're handling two system timer interrupts like a pro!_
![Timers firing on all cylinders on the Raspberry Pi 4](images/13-interrupts-running.jpg) ![Timers firing on all cylinders on the Raspberry Pi 4](images/13-interrupts-running.jpg)
[Go to part14-spi-ethernet >](../part14-spi-ethernet)

View file

@ -192,6 +192,12 @@ if (ENC_RestoreTXBuffer(&handle, sizeof(ARP)) == 0) {
} }
``` ```
`ENC_RestoreTXBuffer()` simply prepares the transmit buffer and return 0 if successful. `ENC_WriteBuffer()` sends the packet to the ENC28J60 over the SPI. We then set the transmit buffer length in the driver flags and call `ENC_Transmit()` to tell the ENC to send the packet across the network. `ENC_RestoreTXBuffer()` simply prepares the transmit buffer and returns 0 if successful. `ENC_WriteBuffer()` sends the packet to the ENC28J60 over the SPI. We then set the transmit buffer length in the driver flags and call `ENC_Transmit()` to tell the ENC to send the packet across the network.
You'll see that the `arp_test()` function sends our first ARP this way. We tell it the IP of our router (192.168.0.1 in my case), but we don't know its MAC address - that's what we want to find out. Once the ARP is sent, `arp_test()` then waits for received Ethernet packets, checks whether they're for us and, if they come from the router's IP address (therefore likely to be the ARP response to our request), we print out the router's MAC address. You'll see that the `arp_test()` function sends our first ARP this way. We tell it the IP of our router (192.168.0.1 in my case), but we don't know its MAC address - that's what we want to find out. Once the ARP is sent, `arp_test()` then waits for received Ethernet packets, checks whether they're for us and, if they come from the router's IP address (therefore likely to be the ARP response to our request), we print out the router's MAC address.
This fulfils design requirement 3, and therefore we're done!
_Imagine how happy I was when I finally saw my router's MAC address appear on-screen - a sign of life, and proof that my OS is networking!_
![ARP response](images/14-spi-ethernet-arp.jpg)

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB