Hoping someone from the Spark team reads this.
I’ve started with Spark and I’m liking the platform. Also the bootloader seems VERY well written.
However, I’m looking at writing some fairly low level stuff on the platform and I have not been able to find any documentation of the APIs available within the platform. I’ve checked the documentation section quite extensively and have found nothing substantive. (Maybe I missed a link somewhere?) From what I can see the documentation section seems to be an excellent “getting started” set of material, but it seems to lack the real meat required to develop serious applications.
Hopefully what I’m looking for already exists and I just missed the link!
The primary doc for the firmware side is here:
Spark is mostly Arduino compatible and so there is a very large amount of Arduino code out there that either works directly on Spark or just needs minor porting to work on Spark. If you search for Arduino on github, over 27,000 repositories with more than 750,000 files come up, for instance.
The doc describes the public Arduino-compatible interface that most people use but you are certainly not limited to that. If you want to go lower, you will probably have to start reading the source and the datasheets for the chips used on the core, but it certainly is possible. The Spark team has been busy getting ready for the new Photon architecture and are almost done moving to a hardware abstraction layer approach which will eventually form yet another public interface at a much lower level.
Maybe if you told us what you are looking to do, we could give better advice.
Thanks for the reply! I’m actually looking at programming at a lower level in straight C++. I have mostly figured out the USB serial interface so that I can send out debugging messages.
The big thing that I need is documentation on the WiFi interface. Specifically TCP and UDP sockets. I’m looking at implementing a simple UPnP interface.
As I said, you need to read the datasheet etc. for the TI CC3000. The driver and socket level interface is mostly their code with a few tweaks from Spark.
Lots of folks have worked on UPnP stuff using the provided Arduino-compatible UDP and TCP objects.
If you just want to go around the Arduino-compatible interface, maybe you should look at the NuttX port for Spark.
Just to be clear for others reading here who may not be so ready to write their own–the USB serial interface already works great if you just say
Serial.begin(baudRate); so there is no need to roll you own.
Sorry, I’m not being clear!
I’m using the Serial class that is defined in the spark_wiring_usbserial.h. As I was typing that I realized that the wiring portion of the file name should have clued me in to the fact that this is an Arduino compatible implementation. So, I’d guess that the spark_wiring_udp and spark_wiring_tcp implementations are also Arduino compatible and I can find documentation on those around the web.
My appologies for the misunderstanding!