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!
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
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
nimble install avr_io
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.
This library is licensed under the BSD 3-Clause "New" or "Revised" License.