They say that is good to have same pictures in the post to make it more interesting. So, here is my config which helps me to learn the basics of ARM and get some experience with ASF.
Since I didn't find much about SAM4S, W5100 and SPI on the net, I decided to share my code here, it's free to use.
It has the following features:
- SPI interface init
- SPI handling on low level (sending/receiving bytes)
- w5100 register reading/writing
- w5100 TX/RX Memory writing/reading (data sending/receiving) including all the calculations needed for that
The driver uses ASF, so you will need the drivers and services which I specified earlier in one of my previous posts about SPI with ASF.
My driver is not a general driver, most likely it won't work out of the box on your board. It's customized on a way as I needed it, however, if you just start to implement something similar, my code could be a very good starting point for you. I tried to comment the less obvious parts, hopefully you will understand it.
You can download the files from here: SAM4 SPI w5100 driver
If you have any question do not hesitate to ask...
If you like my post and/or it was useful, please, leave some comment. If you don't, let me know that too. :-)