I have just started working with Arduino; so, forgive my ignorance.
I am trying to do some atypical things over Ethernet. When I dig through the code, I can find the higher level library routines; but, I always dead end at a function like "W5100.writeSnDHAR" or some such.
I have performed complete searches of the entire "arduino" folder to no avail.
Where is the source code/documentation for these low level routines?
Which library are you using ?
Thanks, but I have already looked in those files. I have "grep'ed" the entire arduino folder and its subfolders.
It is possible that there is something fundamental about C++ that I don't understand - my experience is mostly in C.
I can't find the source/documentation for many of the low level routines for example:
writeSnRX_SIZE(i, SSIZE >> 10);
writeSnTX_SIZE(i, SSIZE >> 10);
It looks to me as though the stuff you're missing is in the .h file. You won't find it using grep though because there are a series of macro expansions creating those functions.
__SOCKET_REGISTER8(SnMR, 0x0000) // Mode
Generates writeSnMR(s, protocol);
I haven't seen the ##name construct before, but it seems pretty clear that that's what's doing it.
If you REALLY want to understand how the W5100 library works, read the W5100 datasheet. The library is a very "thin" wrapper around the (very limited) chip functionality. The vast majority of the W5100 functionality is hard-wired into the chip itself.
which says, in part:
"It is often useful to merge two tokens into one while expanding macros. This is called token pasting or token concatenation. The ‘##’ preprocessing operator performs token pasting."
This would be really tricky to search for using grep.
Thanks, all. I did not even know that kind of macro functionality was possible. I was guessing that it was linking to a binary library or something. Now I have a path forward.