{"id":20046053,"url":"https://github.com/johntalton/mb85","last_synced_at":"2025-03-02T07:47:29.874Z","repository":{"id":33959477,"uuid":"130179929","full_name":"johntalton/mb85","owner":"johntalton","description":"Basic interface for Fujitsu MB85 FRAM chips for NodeJS","archived":false,"fork":false,"pushed_at":"2024-07-01T02:56:47.000Z","size":51,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-12T20:11:31.056Z","etag":null,"topics":["fram","fujitsu","mb85"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/johntalton.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":"2018-04-19T08:00:41.000Z","updated_at":"2022-12-20T22:51:21.000Z","dependencies_parsed_at":"2024-11-13T11:20:45.256Z","dependency_job_id":"edf8c087-c1e1-4755-ae67-a066e3ec6ac9","html_url":"https://github.com/johntalton/mb85","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johntalton%2Fmb85","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johntalton%2Fmb85/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johntalton%2Fmb85/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johntalton%2Fmb85/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johntalton","download_url":"https://codeload.github.com/johntalton/mb85/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241476436,"owners_count":19968916,"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":["fram","fujitsu","mb85"],"created_at":"2024-11-13T11:20:38.319Z","updated_at":"2025-03-02T07:47:29.844Z","avatar_url":"https://github.com/johntalton.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fujitsu MB85 FRAM \r\n\r\nSimple wrapper around I²C (i2c-bus) implementation to provide read / write capability.\r\n\r\n[![npm Version](https://img.shields.io/npm/v/@johntalton/mb85.svg)](https://www.npmjs.com/package/@johntalton/mb85)\r\n![GitHub package.json version](https://img.shields.io/github/package-json/v/johntalton/mb85)\r\n![CI](https://github.com/johntalton/mb85/workflows/CI/badge.svg?branch=master\u0026event=push)\r\n![CodeQL](https://github.com/johntalton/mb85/workflows/CodeQL/badge.svg)\r\n![GitHub](https://img.shields.io/github/license/johntalton/mb85)\r\n[![Downloads Per Month](https://img.shields.io/npm/dm/@johntalton/mb85.svg)](https://www.npmjs.com/package/@johntalton/mb85)\r\n![GitHub last commit](https://img.shields.io/github/last-commit/johntalton/mb85)\r\n[![Package Quality](https://npm.packagequality.com/shield/%40johntalton%2Fmb85.svg)](https://packagequality.com/#?package=@johntalton/mb85)\r\n\r\n## API\r\nConstruction is achived via the statis `from` and `fromId` methods of `MB85RC`. \r\n```javascript\r\nconst id = ... // detected via I²C, or user specified \r\nconst fram = MB85RC.fromId(bus, id)\r\n```\r\n\r\n#### Feature string\r\nThe feature set exposed as the Fujitsu product codes.\r\n\r\n#### `size` \r\nThe density expressed as numeric value.\r\n\r\n#### `densityHuman`\r\nThe density expressed as prodcut code string (example: '1M', '512K', ect)\r\n\r\n#### `busHuman`\r\nThe bus as product code string ('RC' for I²C)\r\n\r\n#### `read(offset, length)`\r\nDirect access to read at an offset for desired length.\r\nRetruning a `Promise` that resolves to a Buffer.\r\n\r\n#### `write(offset, buffer)`\r\nDirect write to an offset given a buffer of desired length to be writen.\r\nReturning a `Promise` that resolves when completed.\r\n\r\n## Devcie ID\r\nThe provided library is also provides a way of identifying a chip based on its assigned Id value.\r\n\r\nThis can be passed in, however, it becomes more usefull with the bus level `deviceId` call.  This uses a bus level discovery not supported by most chips.  By using this method, the chips feature inforamtion can detected.\r\n\r\n```javascript\r\nconst i2c = require('i2c-bus')\r\nconst { I2CAddressedBus } = require('@johntalton/and-other-delights')\r\nconst { MB85RC, DEFAULT_MB85_ADDRESS } = require('@johntalton/mb85')\r\n\r\nconst busNumber = 1\r\nconst busAddress = DEFAULT_MB85_ADDRESS // 0x50\r\n\r\nconst bus1 = await i2c.openPromisified(busNumber)\r\nconst id = await bus1.deviceId()\r\nconst ab = new I2CAddressedBus(bus1, busAddress)\r\nconst fram = MB85RC.fromId(ab, id)\r\n\r\nconsole.log('Fujitsu FRAM MB85', fram.busHuman, fram.densityHuman, fram.featuresHuman)\r\n// Fujitsu FRAM MB85 RC 256K V\r\n\r\n```\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohntalton%2Fmb85","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohntalton%2Fmb85","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohntalton%2Fmb85/lists"}