2.0.5 • Published 4 years ago

@johntalton/mb85 v2.0.5

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

Fujitsu MB85 FRAM

Simple wrapper around i2c (i2c-bus) impl. to provide basic buffer read/write command.

npm Version GitHub package.json version CI GitHub Downloads Per Month GitHub last commit

Devcie ID

The provided library is also provides a way of identifying a chip based on its assigned Id value.

This 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.

const i2c = require('i2c-bus')
const { I2CAddressedBus } = require('@johntalton/and-other-delights')
const { MB85RC, DEFAULT_MB85_ADDRESS } = require('@johntalton/mb85')

const busNumber = 1
const busAddress = DEFAULT_MB85_ADDRESS // 0x50

const bus1 = await i2c.openPromisified(busNumber)
const id = await bus1.deviceId()
const ab = new I2CAddressedBus(bus1, busAddress)
const fram = MB85RC.from(ab, id)

console.log('Fujitsu FRAM MB85', fram.busHuman, fram.densityHuman, fram.featuresHuman)
// Fujitsu FRAM MB85 RC 256K V