Skip to content

AVR registers, interrupts, progmem and peripheral support in nim!

License

Notifications You must be signed in to change notification settings

Abathargh/avr_io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

avr_io - nim register bindings and utilities for AVR microcontrollers

This library provides a series of bindings for memory-mapped registers, peripherals, and many other functionalities related to AVR microcontrollers.

Any project using this library must use avr-gcc as its C backend.

NOTE: the contents of the library are highly experimental, they are not recomended for use in production code, APIs may break at any time!

Requirements

This library uses features that are bugged on the current nim releases (2.0.x). Their specific fixes will be merged into the devel branch starting from nim 2.2.x. This means that up until nim 2.2.x releases, using some of the avr_io feature requires a nim devel installation.

If you use choosenim just execute:

choosenim update devel

Support

The nim modules that offer IO register mappings and ISR definitions are generated using the chips' datasheets as a reference.

The library currently supports the following chips:

  • ATMega16U4
  • ATMega32U4
  • ATMega328P
  • ATMega640
  • ATMega644
  • ATMega1280
  • ATMega1281
  • ATMega2560
  • ATMega2561

Install

nimble install avr_io

Documentation

There are three main documentation sources for this project:

  • The wiki hosted within the avr_io github page.
  • The examples contained within the examples directory, that hosts a series of nimble projects ready to use and to be consulted, going quite thoroughly in detail on how to use the library.
  • The in-comment documentation.

You can generate the documentation for this module and its submodules by running the following command from the root directory of the project:

nim doc --project --index:on -d:USING_ATMEGA328P --outdir:docs src/avr_io.nim

Note that you have to specify the microcontroller you are using, like when setting up the library.

License

This library is licensed under the BSD 3-Clause "New" or "Revised" License.