{"id":22665037,"url":"https://github.com/smfsw/arm_i2c_drivers","last_synced_at":"2026-03-05T02:01:18.621Z","repository":{"id":159708958,"uuid":"90299707","full_name":"SMFSW/arm_i2c_drivers","owner":"SMFSW","description":"ARM I2C Drivers for various components (requires 'sarmfsw' \u0026 'HARMcksL')","archived":false,"fork":false,"pushed_at":"2026-01-01T23:15:07.000Z","size":136438,"stargazers_count":13,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-02T06:04:12.260Z","etag":null,"topics":["arm","hal","i2c","i2c-sensors","sensors","slaves","storage"],"latest_commit_sha":null,"homepage":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-05-04T19:02:50.000Z","updated_at":"2026-01-01T23:15:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"fbbb4faf-7597-4a26-9322-7d73954142ad","html_url":"https://github.com/SMFSW/arm_i2c_drivers","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/SMFSW/arm_i2c_drivers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMFSW%2Farm_i2c_drivers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMFSW%2Farm_i2c_drivers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMFSW%2Farm_i2c_drivers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMFSW%2Farm_i2c_drivers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SMFSW","download_url":"https://codeload.github.com/SMFSW/arm_i2c_drivers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMFSW%2Farm_i2c_drivers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30106124,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T01:39:18.192Z","status":"online","status_checked_at":"2026-03-05T02:00:06.710Z","response_time":93,"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":["arm","hal","i2c","i2c-sensors","sensors","slaves","storage"],"created_at":"2024-12-09T13:18:50.769Z","updated_at":"2026-03-05T02:01:18.616Z","avatar_url":"https://github.com/SMFSW.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ARM I2C drivers\n\n[![author](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/SMFSW/a9a2b2a02fda1b33461d53ddfe69d649/raw/auth_SMFSW.json)](https://github.com/SMFSW)\n![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/SMFSW/a9a2b2a02fda1b33461d53ddfe69d649/raw/i2c_drivers_status_badge.json)\n[![license](https://img.shields.io/badge/License-MIT-darkred.svg)](LICENSE)\n[![CodeFactor](https://www.codefactor.io/repository/github/smfsw/arm_i2c_drivers/badge)](https://www.codefactor.io/repository/github/smfsw/arm_i2c_drivers)\n\n![platform](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/SMFSW/a9a2b2a02fda1b33461d53ddfe69d649/raw/platform_STM32.json)\n\n[![doxy](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/SMFSW/a9a2b2a02fda1b33461d53ddfe69d649/raw/tool_DOXY.json)](https://smfsw.github.io/arm_i2c_drivers)\n[![re_note](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/SMFSW/a9a2b2a02fda1b33461d53ddfe69d649/raw/tool_RN.json)](ReleaseNotes.md)\n\n![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/SMFSW/a9a2b2a02fda1b33461d53ddfe69d649/raw/i2c_drivers_custom_repo_badge.json)\n\nARM I2C Drivers for various components\n\n## Requires\n\n- sarmfsw\n  - [sarmfsw](https://github.com/SMFSW/sarmfsw)\n\n- HARMcksL (following used components(s))\n  - [HARMcksL](https://github.com/SMFSW/HARMcksL)\n\n## Usage\n\n- define `I2C_$CPNT$` in a file called globals.h with the I2C instance you want it to be tied to (no neeed to declare instance in case of multiple devices)\n- define `I2C_$CPNT$_NB` with number of devices to enable multiple devices\n- define `$CPNT$_BASE_ADDR` with base device address if in the need to override default address defined in header\n- use `$CPNT$_Init(idx, hi2c, devAddress)` for every device with its index, proper instance and I2C address\n  - I2CMEM type is generic and needs 2 more parameters: storage size and write buffer size (can be set to 0 for FRAM)\n- use `$CPNT$_Init_Single()` once in case of single device using defaults\n  - I2CMEM type is generic and needs 2 parameters: storage size and write buffer size (can be set to 0 for FRAM)\n- start using `$CPNT$_funcs()`\n\n## Remarks\n\n- define `VERBOSE` in compiler options to printf infos from component handlers\n- define `NO_WARN_I2C_DRIVERS` at project level to disable possible warning messages when multiple devices declared which may have same address\n- Components with a xxx_proc file can access `I2C_slave` instance through `CPNT-\u003ecfg.slave_inst`.\nPlease keep in mind some components are somewhat custom and needs to be accesses through `CPNT-\u003ecfg.slave_inst_xxx` instead if needed.\n\n## Supported devices\n\n### EEPROM / FRAM:\n\n- **I2CMEM**: Any EEPROM / FRAM\n  - **STATUS**: DONE\n  - Use I2CMEM when compatibility between EEPROM/FRAM is needed\n  - Check [I2CMEM_ex.h](I2CMEM_ex.h) for a few components init aliases\n  - In case FRAM is only useful, you may use legacy FM24C or MB85RC256V components, or set buf_size to I2CMEM_WBUF_NONE at init\n  - Transaction timeout set to 500ms:\n    - There shouldn't be any timeout reached for these components, otherwise refer to MB85RC256V comment\n\n- **FM24C**: 4/16-Kbit (512/2K * 8) Serial I2C F-RAM\n  - **STATUS**: DONE\n  - I2C_Drivers legacy FRAM component, consider switching to I2CMEM for new designs\n  - Use FM24C for I2C addresses banked components (with 8b internal address):\n    - Tested on:\n      - FM24C16B\n      - FM24C04B\n      - BR24T04FVM\n  - Transaction timeout set to 500ms:\n    - There shouldn't be any timeout reached for these components, otherwise refer to MB85RC256V comment\n\n- **MB85RC256V**: 256-Kbit (32K * 8) I2C Memory FRAM\n  - **STATUS**: DONE\n  - I2C_Drivers legacy FRAM component, consider switching to I2CMEM for new designs\n  - Use MB85RC256V for 16b internal addresses components:\n    - Tested on:\n      - MB85RC256V\n      - FM24CL64B\n  - Transaction timeout set to 500ms:\n    - For bigger size components, in case timeout is reached, read/write transactions may be split in multiple calls (refreshing watchdog if in use).\n    - Set a longer timeout by calling I2C_set_slave_timeout in init sequence is another way to address such a need\n\n### OTHER:\n\n- **ADS1115**: Ultra-Small, Low-Power, 16-Bit Analog-to-Digital Converter with Internal Reference\n  - **STATUS**: DONE\n\n- **AMG88**: Infrared Array Sensor (Grid-EYE)\n  - **STATUS**: DONE (TODO: recognition)\n\n- **APDS9930**: Digital Proximity and Ambient Light Sensor\n  - **STATUS**: DONE\n\n- **APDS9960**: Digital Proximity, Ambient Light, RGB and Gesture Sensor\n  - **STATUS**: DONE (TODO: GESTURES TO TEST/SWITCH, DISABLED YET)\n\n- **AT42QT1244**: 24-key QMatrix FMEA IEC/EN/UL60730 Touch Sensor\n  - **STATUS**: DONE\n\n- **BMP180**: Digital pressure sensor\n  - **STATUS**: DONE\n\n- **DRV2605L**: 2 to 5.2V Haptic Driver for LRA and ERM With Effect Library and Smart-Loop Architecture\n  - **STATUS**: DONE\n\n- **DS-GPM.S**: 99 Channel Positioning System (GPS + GLONASS) Shield\n  - **STATUS**: DONE\n\n- **MCP4725**: 12-Bit Digital-to-Analog Converter with EEPROM Memory\n  - **STATUS**: DONE\n\n- **MCP9808**: +/-0.5C Maximum Accuracy Digital Temperature Sensor\n  - **STATUS**: DONE\n\n- **MTCH6102**: Low-Power Projected Capacitive Touch Controller\n  - **STATUS**: DONE\n\n- **NCA9595**: Low-voltage 16-bit I²C and SMBus I/O expander\n  - **STATUS**: DONE\n\n- **PCA9532**: 16-bit I2C-bus LED dimmer\n  - **STATUS**: DONE\n\n- **PCA9624**: 8-bit Fm+ I2C-bus 100mA 40V LED driver\n  - **STATUS**: DONE\n\n- **PCA9685**: 16-channel, 12-bit PWM Fm+ I2C-bus LED controller\n  - **STATUS**: DONE\n\n- **PCA9952**: 16-channel Fm+ I2C-bus 57 mA constant current LED driver (compatible with PCA9955)\n  - **STATUS**: DONE\n\n- **PCA9956**: 24-channel Fm+ I2C-bus 57 mA/20 V constant current LED driver\n  - **STATUS**: DONE\n\n- **PCF8523**: Real-Time Clock (RTC) and calendar\n  - **STATUS**: DONE (TODO: handle clkout and alarms)\n\n- **S11059**: I2C interface-compatible color sensor\n  - **STATUS**: DONE\n\n- **TCS3400**: Color light-to-digital converter\n  - **STATUS**: DONE (TODO: auto-integration \u0026 persistence in the works)\n\n- **TCS3472**: Color light-to-digital converter with IR filter\n  - **STATUS**: DONE (TODO: auto-integration \u0026 persistence in the works)\n\n- **TMP1075**: Temperature Sensor With I2C and SMBus Interface in Industry Standard LM75 Form Factor and Pinout\n  - **STATUS**: In progress\n\n- **TSL2591**: Very-high sensitivity light-to-digital converter\n  - **STATUS**: DONE (TODO: auto-integration \u0026 persistence in the works)\n\n## Multiple component type on single project (singleton components excluded)\n\n- If multiple component type are used on the same MCU device:\n  - A for loop can be used passing I2C_$CPNT$ if all components are tied to the same i2C instance (physical bus)\n  - In case same multiple same component type are used on different physical busses, please pass each instance to $CPNT$_Init\n    - note: formerly, I2C_$CPNT$ was used to determine device type enabling (and its instance); as long as enabled with former I2C_$CPNT$, init function can be called using other params\n\n## Following peripherals (?)\n\n- Capacitive (MPR121)\n- OLED\n- Clock Generator (SI5351 with help of [etherkit](https://github.com/etherkit/Si5351Arduino))\n- Accelerometer/Gyro (GY521 MPU6050 with help of [jrowberg](https://github.com/jrowberg/i2cdevlib/))\n- ...\n\nYou may also:\n\n- contribute with more devices using templates in subfolder\n  - if in doubt, `multiple` template implementation is recommended\n- raise issue on github to ask for particular devices\n\n## Limitations\n\n- Compatibility with interrupt driven R/W transactions (when possible \u0026 usefull, yet already tested manually on some components)\n\n## TODO\n\n- Any RTOS compatibility (blocking transactions doesn't match with RTOS task timings)\n- (FreeRTOS) compatibility using R/W functions using interrupts with callbacks (when possible)\n\n## Misc\n\nFeel free to share your thoughts @ xgarmanboziax@gmail.com about:\n\n- issues encountered (might also raise issue on github directly)\n- optimizations\n- improvements \u0026 new functionalities\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmfsw%2Farm_i2c_drivers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmfsw%2Farm_i2c_drivers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmfsw%2Farm_i2c_drivers/lists"}