ms-iot / BusProviders

Repository for Windows IoT Core Bus Provider Libraries
MIT License
40 stars 44 forks source link

Lightning Providers Arduino Dependency = Only Runs On Arduino? #13

Closed CodeChief closed 8 years ago

CodeChief commented 8 years ago

Do these drivers run on normal RasPi2 IoT Core machines without any Arduino? The way it's presented on the IoT download page (download link with big Arduino logo) and NuGet dependency suggests not.

MahmoudGSaleh commented 8 years ago

The providers will run on Raspberry Pi2 or MBM with Windows IOT Core only. They won't run on an Arduino nor they're designed to communicate with one. The main goal of the providers is to interface with a new Direct memory mapped driver that provide a huge boost in the performance of bus controllers, including GPIO, SPI and I2c on Raspberry Pi 2 or MBM.

Note, there are two other open-source libraries targeting Arduino devices:

CodeChief commented 8 years ago

First thanks for the quick and detailed response, but unless I am mistaken it is does not appear to be the case:

  1. The documentation states the Ardino SDK is required.
  2. The only public release, the NuGet 1.0.0-alpha package, requires the Arduino SDK and only includes the C++ and AVR/Arduino headers (no built component/assemblies/libraries).

Please release a separate NuGet package with a UWP wrapper, providing ARM support (for Raspberry Pi) and Intel support (for MBM) and no Arduino dependency. I'd also recommend putting the documentation/download links in the relevant RasPi2 and MBM sections (it is currently under Arduino/wiring components and states Arduino SDK is required).

image

image

So currently it appears it only works as an include in C++ IoT core or Arduino. Is that the intent with this library; that we have to make our own UWP component wrappers for high level language/common usage? That is not clear in the documentation.

MahmoudGSaleh commented 8 years ago

Thanks for your suggestions!

Agree, the docs need more clarification in that regards. We are working on fixing it!

The dependency on the Arduino SDK, or more specifically on the Microsoft.IoT.SDKFromArduino NuGet package, is needed because the Microsoft.IoT.Lightning Nuget package references some of its declarations from Arduino.h. That enables support for the same structures and functions defined in the Arduino Language Reference (hence the Arduino logo), but for use on an IOT Core device rather than an Arduino.

In the future, we may able to refactor the code to eliminate the need of that dependency.

It's also worth noting, the Arduino constructs/functions defined in Microsoft.IoT.Lightning library are used in a new VS project template to enable makers to create Arduino Wiring sketches that runs on Raspberry Pi2 or MBM. The VS extension with the project templates can be downloaded from here.

capture0

capture3

And, you are correct, the intent of the Microsoft.IoT.Lightning library is to be used as source code included in higher level components, such as the library these comments belong to, Microsoft.IoT.Lightning.Providers.

However, binary nuget packages for both, Microsoft.IoT.Lightning.Providers and Microsoft.IoT.Lightning.Providersis will certainly be much easier to include in a project. Again, thanks for the suggestion!

CodeChief commented 8 years ago

OK, all clear now, thanks :-)