Skip to content

daknuett/avr-stdlib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AVR extra library

Yet Another AVR library

Configuration

  • Generate needed files using make init
  • run ./configure.sh

Usage

  • It uses Auto-make-rules => use
  • make file.elf to compile and link the c-file
  • make ifile.elf to flash your program on the avr
  • use the includes <pins.h> & co

Devices supported

  • atmega168: fully supported
  • atmega8: partially supported ( many librarys should be compatible)

Linking

  • as auto-rules are used, you will have to reconfigure the project using ./configure.sh to change the linked libs
  • to save flash space unused libarys shouldn't be linked
  • to save ram you can use usart in no interrupt mode and do not link some librarys

Device handling

  • You will have to define device specific preprocessor macros for <pins.h>:
  • on m8: __DEV_M8_
  • on m168: __DEV_M168_
  • The most part is configured by configure.sh

Functions

File Function Usage
lib/<device>/digital.c write_pin(char pin) write pin digital, pin is the PDIP pinnumber
lib/<device>/digital.c read_pin(char pin) read pin digital, pin is the PDIP pinnumber
lib/<device>/analog.c analog_write(char pin) write pin analog (PWM)(if supported), pin is the PDIP pinnumber
lib/<device>/analog.c analog_read(char pin) read pin analog (if supported), pin is the PDIP pinnumber
lib/pins.c analog_get(char pin) read pin analog with average (if supported), pin is the PDIP pinnumber
lib/pins.c get_pin(char pin) read pin digital with polling, pin is the PDIP pinnumber
... ... ...
To be finished: read the files include/*.h.

About

A few standard functions for Atmel's AVR8 family

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published