how to develop a generic peripheral driver

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

i am wondering is there any pattern or guidelines to design hardware abstract layer that  provides a generic multi instance simple set of APIs (application programming interfaces) to interact with the upper layer (application, libraries and stacks).

 

or at least how to make a generic driver like this ?

http://asf.atmel.com/docs/latest/mega/html/group__mega__adc__group.html

salmon fish

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

Start by defining your terms:

  • generic
  • multi instance
  • simple

 

mhezzet wrote:
like this ? http://asf.atmel.com/docs/latest...

Have you studied how they've done it?

 

And looked at how others do it; eg, Arduino, mbed, Raspberry Pi  ... 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For examples see Atmel's ASF, Atmel's Start but perhaps most importantly Arduino. All these present a hardware adaption layer so that at the highest level the API interface is generic irrespective of whether the underlying silicon is any model of AVR or even ARM. Do note that they all pay the usual price for offering such utility (i.e. inefficiency)

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

Hmm ... "writing essay help" ... ?

 

frown

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...