{"id":22665047,"url":"https://github.com/smfsw/wirewrapper","last_synced_at":"2026-04-28T08:36:17.680Z","repository":{"id":159708976,"uuid":"79852824","full_name":"SMFSW/WireWrapper","owner":"SMFSW","description":"Arduino Wrapper for Wire library (for SAM, ESP8266...)","archived":false,"fork":false,"pushed_at":"2025-04-30T21:37:48.000Z","size":516,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-30T22:33:45.746Z","etag":null,"topics":["arduino","arduino-library","i2c-bus","wire-library"],"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/SMFSW.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-23T22:02:25.000Z","updated_at":"2025-04-30T21:37:51.000Z","dependencies_parsed_at":"2023-07-13T13:46:07.305Z","dependency_job_id":null,"html_url":"https://github.com/SMFSW/WireWrapper","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/SMFSW/WireWrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMFSW%2FWireWrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMFSW%2FWireWrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMFSW%2FWireWrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMFSW%2FWireWrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SMFSW","download_url":"https://codeload.github.com/SMFSW/WireWrapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMFSW%2FWireWrapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32373512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"online","status_checked_at":"2026-04-28T02:00:07.250Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["arduino","arduino-library","i2c-bus","wire-library"],"created_at":"2024-12-09T13:18:57.268Z","updated_at":"2026-04-28T08:36:17.507Z","avatar_url":"https://github.com/SMFSW.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WireWrapper [![Build Status](https://travis-ci.com/SMFSW/WireWrapper.svg?branch=master)](https://travis-ci.com/SMFSW/WireWrapper)\n\nArduino Wrapper for Wire library (for SAM, ESP8266...)\n\nA wrapper for Wire library meant to be put in place of cI2C library on SAM, ESP8266... targets\n\n## Library choice\n\n* cI2C library implements I2C bus for AVR targets (Uno, Nano, Mega...)\n  * you may prefer this one when:\n    * working on AVR targets\n    * interrupts are not needed\n* WireWrapper implements I2C bus for every platform that includes Wire library\n  * you would have to use this one when:\n    * working on non-AVR targets\n    * portability is needed (using Wire library)\n\nNo refactoring is required when switching between **cI2C** \u0026 **WireWrapper** libs;\nBoth libs share same Typedefs, Functions \u0026 Parameters.\n\n## Notes\n\n* WireWrapper is designed to act as bus Master (Slave mode will be considered in future releases)\n* WireWrapper is set to work on targets with Wire library (AVR, TINY, SAM, ESP8266...)\n  * for AVR targets, you may use **cI2C** instead (plain c low-level Wire replacement)\n\n## Usage\n\nThis library is intended to be able to work with multiple slaves connected on the same I2C bus.\nThus, the I2C bus and Slaves are defined separately.\n\n* On one hand, I2C bus has to be initialized with appropriate speed:\n  * use `I2C_init(speed)`: speed can be chosen from `I2C_SPEED` enum for convenience, or passing an integer as parameter\n* On the other hand, Slave(s) have to be defined and initialized too:\n  * use `I2C_SLAVE` typedef to declare slaves structs\n  * use `I2C_slave_init(pSlave, addr, regsize)`\n    * `pSlave`: pointer to the slave struct to initialize\n    * `addr`: slave I2C address (don't shift addr, lib takes care of that)\n    * `regsize`: width of internal slave registers (to be chosen from `I2C_INT_SIZE`)\n  * in case you need to use custom R/W procedures for a particular slave:\n    * use `I2C_slave_set_rw_func(pSlave, pFunc, rw)`\n      * `pSlave`: pointer to the slave declaration to initialize\n      * `pFunc`: pointer to the Read or Write bypass function\n      * `rw`: can be chosen from `I2C_RW` enum (wr=0, rd=1)\n\nAfter all inits are done, the lib can basically be used this way:\n* `I2C_read(pSlave, regaddr, pData, bytes)`\n  * `pSlave`: pointer to the slave struct to read from\n  * `regaddr`: start address to read from\n  * `pData`: pointer to the place where datas read will be stored\n  * `bytes`: number of bytes to read from slave\n  * returns `true` if read is ok, `false` otherwise\n* `I2C_write(pSlave, regaddr, pData, bytes)`\n  * `pSlave`: pointer to the slave struct to write to\n  * `regaddr`: start address to write to\n  * `pData`: pointer to the block of datas to write to slave\n  * `bytes`: number of bytes to write to slave\n  * returns `true` if write is ok, `false` otherwise\n\n## Examples included\n\nfollowing examples should work with any I2C EEPROM/FRAM with address 0x50\n(yet function to get Chip ID are device dependent (and will probably only work on FUJITSU devices))\n* [wirewrapper_master_write.ino](examples/wirewrapper_master_write/wirewrapper_master_write.ino): Write some bytes to FRAM and compare them with what's read afterwards\n* [wirewrapper_master_read.ino](examples/wirewrapper_master_read/wirewrapper_master_read.ino): Read some bytes in FRAM\n* [wirewrapper_advanced.ino](examples/wirewrapper_advanced/wirewrapper_advanced.ino): Redirecting slave write \u0026 read functions (to custom functions following typedef)\n\n## Documentation\n\nDoxygen doc can be generated using \"Doxyfile\".\n\nSee [generated documentation](https://smfsw.github.io/WireWrapper/)\n\n## Release Notes\n\nSee [release notes](ReleaseNotes.md)\n\n## See also\n\n**cI2C**\n* [cI2C github](https://github.com/SMFSW/cI2C) - C implementation of this library\n\n**WireWrapper**\n* [WireWrapper github](https://github.com/SMFSW/WireWrapper) - Cpp implementation using Wire Wrapper\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmfsw%2Fwirewrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmfsw%2Fwirewrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmfsw%2Fwirewrapper/lists"}