{"id":21969639,"url":"https://github.com/cinderblock/avr","last_synced_at":"2026-02-09T21:33:41.028Z","repository":{"id":61686925,"uuid":"52512372","full_name":"cinderblock/AVR","owner":"cinderblock","description":"C++ AVR Library","archived":false,"fork":false,"pushed_at":"2022-10-20T10:03:02.000Z","size":438,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-10T12:32:18.141Z","etag":null,"topics":["avr","dshot"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cinderblock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-25T09:23:05.000Z","updated_at":"2022-11-09T01:06:43.000Z","dependencies_parsed_at":"2023-01-20T05:40:18.627Z","dependency_job_id":null,"html_url":"https://github.com/cinderblock/AVR","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cinderblock/AVR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cinderblock%2FAVR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cinderblock%2FAVR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cinderblock%2FAVR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cinderblock%2FAVR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cinderblock","download_url":"https://codeload.github.com/cinderblock/AVR/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cinderblock%2FAVR/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29281968,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T19:05:41.198Z","status":"ssl_error","status_checked_at":"2026-02-09T19:05:37.449Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["avr","dshot"],"created_at":"2024-11-29T14:23:02.769Z","updated_at":"2026-02-09T21:33:41.013Z","avatar_url":"https://github.com/cinderblock.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Standardized C++ AVR Library\n\nThis library aims to provide a high performance C++ library for dealing with AVR hardware in an abstract manner. Initial support geared towards 8-bit AVRs.\n\n## Work In Progress\n\nWhile I have high hopes for this project, it's nowhere near the standardized library that it could be. It currently only works for some hardware on a few chips.\n\nIt also needs some help in certain placed for performance. Eventually, most functions will compile down to the equivalent single AVR instructions where possible. This for instance is not yet done with `IOpin.h`.\n\n## Recommended Usage\n\n- Use a git submodule to load a version of AVR++ into a project. Since we have yet to standardize basically anything, semantic versioning is useless for now. Instead, using submodules enables easily trying new features with the safety of getting\n- Add the submodule folder to your Includes (`-I`) directories. _Note: Point to the main submodule directory._\n- Include the header files as necessary: `#include \"AVR++/USART.h\"`\n- Compile the needed .cpp files and link them into your final build.\n\n## Modules\n\n### [`IOpin.hpp`](AVR++/IOpin.hpp)\n\nA header only library for dealing with I/O pins.\nExports a `IOpin\u003cport, pin\u003e` class that can be used to abstract away the details of dealing with a single IO pin in a high performance manner.\nAll set/clear/toggle operations are done in a single instruction.\nUnfortunately, this means that the pin number must be known at compile time and they aren't interchangeable classes that can be parameters as you might expect.\n\n```C++\ntemplate \u003cPorts port, unsigned pin\u003e class IOpin {\n  inline static void output();        // Set pin to output\n  inline static void input();         // Set pin to input\n  inline static void enablePullUp();  // Enable pull-up resistor\n  inline static void disablePullUp(); // Disable pull-up resistor\n  inline static void setPullUp(bool); // Set pull-up resistor\n  inline static void set();           // Set pin high\n  inline static void clr();           // Set pin low\n  inline static void tgl();           // Toggle pin via hardware\n  inline static void set(bool);       // Set pin to value\n\n  inline static bool isHigh();          // Check if pin is high\n  inline static bool isDriveHigh();     // Check if we're driving the pin high\n  inline static bool isOutputEnabled(); // Check if pin is output\n}\n```\n\nUsage:\n\n```C++\n#include \u003cAVR++/IOpin.hpp\u003e\nusing MyPin = IOpin\u003cPorts::B, 0\u003e;\nvoid setup() {\n  MyPin::init();\n  MyPin::output();\n  MyPin::set();\n  // ...\n}\n```\n\nThere are also more advance child classes that automatically deal with many common use cases:\n\n- **`Output\u003cPort, Pin, inverted = false, startOn = false\u003e`** - A mode that gives logical meaning to `on()` and `off()`.\n  `inverted` will automatically invert normal logic and map `on()` to `clr()` (LOW).\n  Useful to abstract away the hardware implementation of the logical function of a pin.\n  It also automatically sets the pin to output mode and initial stat on startup, before `main()`.\n- **`WeakOutput\u003cPort, Pin, inverted = false, startOn = false\u003e`** - A mode like `Output` that leaves the pin as an **Input**.\n  Uses the internal pull-up resistor to drive the pin high.\n- **`OpenDrain\u003cPort, Pin, activeLow, pullUp\u003e`** - A mode that allows the pin to be driven low, but not high.\n  `activeLow` will invert the logic and map `on()` to `clr()` (LOW).\n  `pullUp` will enable the internal pull-up resistor when not driving low.\n\n### [`USART.hpp`](AVR++/USART.hpp)\n\nA library for dealing with the USART hardware.\n\n_TODO: Fill in details here._\n\n### [`SPI.hpp`](AVR++/SPI.hpp)\n\nA header only library for dealing with the SPI hardware.\n\n_TODO: Fill in details here._\n\n### [`Atomic.hpp`](AVR++/Atomic.hpp)\n\nA header only library for dealing with Atomic operations.\nMakes it easy to wrap any type with interrupt safe operations and accessors.\n\n_TODO: Fill in details here._\n\n### [`ADC.hpp`](AVR++/ADC.hpp)\n\nA header only library for dealing with the ADC hardware.\n\n_TODO: Fill in details here._\n\n### [`basicTypes.hpp`](AVR++/basicTypes.hpp), [`bigTypes.hpp`](AVR++/bigTypes.hpp), [`bitTypes.hpp`](AVR++/bitTypes.hpp), \u0026 [`AVRTypes.hpp`](AVR++/AVRTypes.hpp)\n\nHeader only libraries for dealing with various sized variables in a clean way.\n\n_TODO: Fill in details here._\n\n### [`WDT.hpp`](AVR++/WDT.hpp)\n\nA header only library for dealing with the Watchdog hardware.\n\n_TODO: Fill in details here._\n\n### [`PulsedOutput.hpp`](AVR++/PulsedOutput.hpp)\n\nA library to bit-bang out pulsed signals on IOpins.\nUseful for high speed single-wire protocols like WS2812 and DShot.\n\n### [`WS2812.hpp`](AVR++/WS2812.hpp)\n\nA library to bit-bang out streams of bytes intended to be used with WS2812 (and relate) LEDs.\n\n### [`DShot.hpp`](AVR++/DShot.hpp)\n\nA library to bit-bang out DShot packets for use with modern inexpensive BLDC ESCs.\n\n### [`BDShot.hpp`](AVR++/BDShot.hpp)\n\nA library to add Bidirectional support to DShot packets to allow for reading back telemetry data from ESCs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcinderblock%2Favr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcinderblock%2Favr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcinderblock%2Favr/lists"}