# API Documentation

**URL:** <https://community.particle.io/t/api-documentation/8729>\
**Category:** Firmware\
**Created:** [December 11, 2014, 3:27am UTC](https://community.particle.io/t/api-documentation/8729 "2014-12-11T03:27:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sailing\_Nut](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@Sailing\_Nut](https://community.particle.io/u/Sailing_Nut)\
**Post date:** [December 11, 2014, 3:27am UTC](https://community.particle.io/t/api-documentation/8729/1 "2014-12-11T03:27:18Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [December 11, 2014, 5:02am UTC](https://community.particle.io/t/api-documentation/8729/2 "2014-12-11T05:02:32Z")

</div>

Hi @Sailing_Nut

The primary doc for the firmware side is here:

[http://docs.spark.io/firmware/](http://docs.spark.io/firmware/)

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.

---

<div class="post-metadata">

**Author:** ![Sailing\_Nut](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@Sailing\_Nut](https://community.particle.io/u/Sailing_Nut)\
**Post date:** [December 11, 2014, 1:06pm UTC](https://community.particle.io/t/api-documentation/8729/3 "2014-12-11T13:06:25Z")

</div>

@bko

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.

Thanks again!

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [December 11, 2014, 2:18pm UTC](https://community.particle.io/t/api-documentation/8729/4 "2014-12-11T14:18:13Z")

</div>

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.

[http://www.ti.com/product/cc3000](http://www.ti.com/product/cc3000)

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.

---

<div class="post-metadata">

**Author:** ![Sailing\_Nut](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@Sailing\_Nut](https://community.particle.io/u/Sailing_Nut)\
**Post date:** [December 11, 2014, 3:51pm UTC](https://community.particle.io/t/api-documentation/8729/5 "2014-12-11T15:51:45Z")

</div>

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!
