AVR / ATMega / ATTiny / ARDUINO Ultimate Drivers Pack

Go To Last Post
16 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I used to spend a lot of time looking for drivers that actually work. And usually I want the drivers to compile using bare bones avr-gcc without arduino dependencies. So it's usually a good google search for drivers whenever I want to use some new piece of hardware.

 

So I have put together a pack of drivers that I have been using myself, along with many new drivers written by Davide Gironi who wrote very good drivers for things like the NRF24L01 radio module and many other devices that are included in this driver pack. The benefit of this driver pack is that we can have all of them in one place.

 

How to use:

 

Most of the drivers are standalone libraries with their own set of functions. They do not depend on any other drivers in the pack - but some do. And some drivers use the same registers and timers - so you would have to be careful when combining drivers like the software pwm driver (which uses TIMER0) with any other code that uses the same timer. More work will be put into making the drivers fully compatible as I go along and notice the incompatibilities.

 

Building the library:

 

Just run "cmake . && make" to build libdrivers.a. Or just include the relevant .c and .h file into your own project.

 

DOWNLOAD

 

https://github.com/mkschreder/av...

LibK - device driver support for flash based microcontrollers: GitHub project

http://oskit.se - join me on my quest to become a better programmer

Last Edited: Fri. Sep 26, 2014 - 01:13 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can you really rely on folks having cmake installed?

 

I use it all the time so I do but I'm not sure a standard sort of "build-essentials" install is going to have it.

 

As it is identifying gcc why not just get it to generate the GNU Makefile and post that?

 

Also it appears to be making an assumption that avr-gcc in in /usr/bin - personally I have mine in /usr/local/avr

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

cmake is nice. But if you don't have cmake then no problem. Just copy the relevant driver for whatever device and include it into your own project makefile. That works for most drivers. There are only few exceptions of things that have dependencies - like many drivers depend on i2c. But just copy all dependencies and compile your app as you normally would.
 

Edit: i fixed the issue with avr-gcc path.

LibK - device driver support for flash based microcontrollers: GitHub project

http://oskit.se - join me on my quest to become a better programmer

Last Edited: Fri. Sep 26, 2014 - 03:58 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So are these arduino libraries (ie things that call the arduino core functions as a HAL), or arduino-like libraries for non-arduino development environments?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Strictly speaking these are not arduino libraries (this topic was moved from atmega forum here) but I use several of these drivers on my arduino all the time. So they work on the arduino.

But these are standalone drivers. They are designed to make the hardware work regardless of whether you use them on an arduino or on a different atmega board. They do not call arduino hal - because they are designed to work on any atmega board not just the arduino. Also many of them are completely standalone libraries meaning that you can take the .c and the .h file, copy it to your project and it will compile as part of your project.

LibK - device driver support for flash based microcontrollers: GitHub project

http://oskit.se - join me on my quest to become a better programmer

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

they are designed to work on any atmega board

But not non-avr chips.  Fair enough.

 

Released under GPLv3.

Oh.  For "open source use only."  Well, that's too bad.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'll never for the life of me understand why "open" programmers choose such a limited license? Why not something like FreeBSD? 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Because whatever it is that we publish "for free" is designed to make you learn - not to make you make money. So stop whining about the license.

 

"Open source use" also does not necessarily mean that no money can be made. Hardware can be made, hardware can be sold, things can be sold - even though they are open source - to the people who have no idea that compilers even exist.

 

And of course why should I even care how you use it? Once it is out there, published for learning, proof of concept, whatever, nobody can really know how it is being used. Whatever I post, I post because it's fun to post it. Once it is posted, it's free for all. But licensing is still GPL because it is for learning purposes primarily - it is to show you that "here is the code that works" then you probably go "aha! that's what I have been missing in my own code!" and you add it and your code is working as well. Then you submit a patch and we all go "aha! that's what we should have done that we didn't do!" and we all end up sharing our knowledge and experience. Win win!

LibK - device driver support for flash based microcontrollers: GitHub project

http://oskit.se - join me on my quest to become a better programmer

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
I'll never for the life of me understand why "open" programmers choose such a limited license?
So one can pay the rent.

What is the legal foundation behind the dual licensing model?

http://www.state-machine.com/licensing/faq.php#IsItLegal

On Selling Exceptions to the GNU GPL

by Richard Stallman — Published on Jan 07, 2010

https://www.fsf.org/blogs/rms/selling-exceptions

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Why not something like FreeBSD?
Inferno Embedded uses a BSD copyright in their

Flame Runtime

by alastair on Thu, 26/12/2013

https://infernoembedded.com/products/flame-runtime

Inferno Embedded recommends use of Eclipse.

"Dare to be naïve." - Buckminster Fuller

Last Edited: Sun. Oct 5, 2014 - 04:35 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Licensing:

 

- Stuff that is proof of concept, educational, supporting real products etc. (like android): GPL.

- Packaged libraries that are released with intention to be widely used everywhere: BSD or ZLIB (like zip library)

- Open source server software that has a business model behind it: Affero GPL (like openerp)

 

IMHO, the license usually broadcasts an "intention" of how the programmer intends that the library will be used.

LibK - device driver support for flash based microcontrollers: GitHub project

http://oskit.se - join me on my quest to become a better programmer

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

designed to make you learn - not to make you make money.

I don't think you're understanding the objections to GPL in embedded libraries... If I wanted to use your ADC library in amongst 120k of other code that did impressive and commercially valuable things, I would have to make ALL of that code Open Source.  Yes, I could still sell the devices...  Depending on my employer, I might not even be permitted to LOOK at your code, for fear of "contaminating" the company's proprietary code...

 

Whatever.  As things are, I may never write any proprietary code again, so it's a bit moot.

 

nobody can really know how it is being used.

Strangely, there are both people and companies that believe in obeying license agreements, regardless of how unlikely they are to be caught not doing so.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Again, when ID software releases their source code for their game engines, I don't think their intention is that you're gonna be using it in your next commercial game. But it's old code anyway, so probably not very good fit for a huge commercial success today. But the amount you can learn from it is staggering. And also the amount of fun you can have with it is quite amazing as well. :)

 

If your boss is unhappy, use open source code to get the first prototype running, then refactor your app and rewrite the open source parts as your own versions of the same thing that are a better fit for the rest of your application.

LibK - device driver support for flash based microcontrollers: GitHub project

http://oskit.se - join me on my quest to become a better programmer

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't think you're understanding the objections to GPL in embedded libraries... If I wanted to use your ADC library in amongst 120k of other code that did impressive and commercially valuable things, I would have to make ALL of that code Open Source. 

+1 - exactly.

 

GPL guarantees that no one will ever consider using your library code in any kind of commercial product. Perhaps that's exactly what you are looking for but I can't help thinking that a lot of people think "open source = GPL" so they just tag something "open" as GPL not realising that this is a total barrier to it being used in a commercial environment. Of course some people do this deliberately with a dual licence approach. Make it available for "prototyping" etc but if someone chooses to use it in the next iPlayer then they have to come and negotiate terms to break away from GPL.

 

Personally I just put stuff I'm happy to share under FreeBSD (or just "Beerware") so that anyone can do pretty much whatever they like with it as I'm happy to share.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is there an OSSW license that insists that changes to the library code be published (which seems like what the OP is after), but allows the rest of a project to remain propritary, isn't viral, and lacks LGPL's "linkable" requirement?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

GitHub have a great page explaining all the various licences...

 

http://choosealicense.com/