[ell-i-developers] Re: SPI working

  • From: Pekka Nikander <pekka.nikander@xxxxxx>
  • To: ell-i-developers@xxxxxxxxxxxxx
  • Date: Thu, 27 Feb 2014 18:14:33 +0200

> I just generated a pull request with the working version of the SPI API.

Excellent work!

> The setClock function works selecting the possible frequency that is lower or 
> equal to the requested frequency. Still, it needs improvement because of the 
> typecast. And it would be improved further if the SystemCoreClock was a 
> constant.

IIRC in C++ an enum can be lowered into an int.  Have you tried to declare 
wantedDivider as an SPIClockDivider?  See also this: 
http://stackoverflow.com/questions/1390703/enumerate-over-an-enum-in-c

It is possible that there is no very nice solution.

> With that as base, I am proceeding to generate the library for the Ethernet 
> Controller in the library folder, as I expect that to be the right place.

Please go ahead.  We'll see then if we integrate that to the CoAP library (see 
the WIP coap implementation) or have it as a separate library.  Please don't 
name it as "Ethernet", however, as that is the Arduino Ethernet (really TCP and 
UDP) library.

--Pekka


Other related posts: