{"id":21038603,"url":"https://github.com/irdcat/avr-ssd1306","last_synced_at":"2025-05-15T15:33:52.068Z","repository":{"id":189191635,"uuid":"143462170","full_name":"irdcat/avr-ssd1306","owner":"irdcat","description":"SSD1306 OLED display driver library for AVR microcontrollers written in C++14, and experiment of using templates on MCU.","archived":false,"fork":false,"pushed_at":"2019-02-08T20:28:00.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-08-18T18:09:23.349Z","etag":null,"topics":["avr","cpp14","oled-display-ssd1306"],"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/irdcat.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,"governance":null}},"created_at":"2018-08-03T18:47:25.000Z","updated_at":"2023-08-18T18:09:26.994Z","dependencies_parsed_at":"2023-08-18T18:25:32.023Z","dependency_job_id":null,"html_url":"https://github.com/irdcat/avr-ssd1306","commit_stats":null,"previous_names":["irdcat/avr-ssd1306"],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irdcat%2Favr-ssd1306","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irdcat%2Favr-ssd1306/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irdcat%2Favr-ssd1306/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irdcat%2Favr-ssd1306/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/irdcat","download_url":"https://codeload.github.com/irdcat/avr-ssd1306/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225361664,"owners_count":17462280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","cpp14","oled-display-ssd1306"],"created_at":"2024-11-19T13:33:33.479Z","updated_at":"2024-11-19T13:33:34.577Z","avatar_url":"https://github.com/irdcat.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SSD1306 AVR Library\n\nSSD1306 driver library for AVR microcontrollers. SSD1306 is a single-chip CMOS OLED/PLED driver with controller for organic / polymer light emitting\ndiode dot-matrix graphic display system. It consists of 128 segments and 64commons. This IC is designed for Common Cathode type OLED panel. \n\nThis project is more of an experiment of using c++ templates on a small microcontroller, such as avr, than a library, that focuses on optimization. The only goal was to provide easy to use interface.\n\n### Supported communication interfaces\n\n- [x] 4-wire SPI\n- [ ] 3-wire SPI\n- [ ] I2C\n\n### Usage\n\nLibrary usage example:\n```C++\n#include \u003cssd1306/display.hpp\u003e\n#include \"ports.hpp\" // Include custom IO implementation\n\nint main()\n{\n\t/* Set correct data direction values of the used ports */\n\tauto display = ssd1306::initDisplay128x64(port_c.p0, port_c.p1, port_c.p2, port_c.p3, port_c.p4);\n\n\twhile(1)\n\t{\n\t\tdisplay.clear();\n\t\t/* Draw something */\n\t\tdisplay.display();\n\t}\n\n\treturn 0;\n}\n```\n\nLibrary needs custom implementation of I/O pin manipulation. Pin must be a class, and overload assignment operator.\nLibrary allows template class pin implementations. Pins are passed to display instance by reference. \nExample pin implementation: \n\n```C++\n#include \u003cstdint.h\u003e\n\nusing reg8 = volatile uint8_t \nusing u8 = uint8_t;\n\nstruct Pin\n{\n\treg8 \u0026 ddrReg;\n\treg8 \u0026 pinReg;\n\treg8 \u0026 portReg;\n\tu8 pos;\n\n\tPin(reg8 \u0026 _ddr, reg8 \u0026 _pin, reg8 \u0026 _port, u8 _pos)\n\t\t: ddrReg(_ddr)\n\t\t, pinReg(_pin)\n\t\t, portReg(_port)\n\t\t, pos(_pos)\n\t{\n\t}\n\n\tvoid setup(bool output) \n\t{\n\t\tddrReg = (ddrReg \u0026 ~(1 \u003c\u003c pos)) | (output \u003c\u003c pos); \n\t}\n\n\ttemplate \u003ctypename T\u003e\n\tPin \u0026 operator=(T value) \n\t{ \n\t\tportReg = (portReg \u0026 ~(1 \u003c\u003c pos)) | (!!value \u003c\u003c pos); \n\t}\n\n\toperator bool() const \n\t{\n\t\treturn pinReg \u0026 (1 \u003c\u003c pos);\n\t}\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firdcat%2Favr-ssd1306","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firdcat%2Favr-ssd1306","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firdcat%2Favr-ssd1306/lists"}