Add FRAM driver

This commit is contained in:
Michal Moskal
2016-04-05 17:25:45 -07:00
parent 7e1248b8dc
commit 65d48f4b02
3 changed files with 82 additions and 0 deletions

14
libs/i2c-fram/ftest.ts Normal file
View File

@@ -0,0 +1,14 @@
i2c_fram.writeByte(100, 42)
i2c_fram.writeByte(101, 108)
function toBuf(arr: number[]) {
let buf = pins.createBuffer(arr.length)
for (let i = 0; i < arr.length; ++i)
buf[i] = arr[i]
return buf
}
i2c_fram.writeBuffer(98, toBuf([1,2,3,4,5,6,7]))
console.log("100:" + i2c_fram.readByte(100))
console.log("101:" + i2c_fram.readByte(101))