To use this file copy and paste this:
// #URL-lib "http://pin1.org/forthlib/flb/I2C/bvsys.flb" into BV Terminal 3
or here to download.
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// BVSYS -
// All of the I2C devices 'BV'xx share a set of common system
// commands for changing the device address, inspecting the
// EEPROM etc. This library contains those commands rather
// than repeating them in each of the individual libraries.
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// REQUIRES:
// #URL-lib "http://pin1.org/forthlib/flb/General/soft1.flb" sid=0
// #URL-lib "http://pin1.org/forthlib/flb/General/pinsel.flb" sid=101
// #URL-Lib "http://pin1.org/forthlib/flb/I2C/i2c.flb" sid=103
// CONSTANTS:
// This variable is used to hold the I2C address of the device
// it is a variable so that it can be changed outside this
// library, the downside is that it MUST be initialised before
// using the library
integer device
Full Contents of File
integer  device 
       
: a55  device  s  &55  sb  device  1+  rs  rn  1  =  rn  2  =  and  rl  3  =  and  p  ;
: a90 
    device  s  &90  sb  sb  device  1+  rs 
    1-  for  rn  next 
    rl  p  ;
   
: a91
    device  s  &91  sb  sb
    depth  for  sb  next
    p  ;
   
: a93  device  s  &93  sb  device  1+  rs  rl  p  ; 
: a94  device  s  &94  sb  p  ; 
: a95  device  s  &95  sb  p  ; 
: a96  device  s  &96  sb  &55  sb  &aa  sb  p  ; 
: a99  device  s  &99  sb  dup  sb  &55  sb  &aa  sb  device  sb  =>  device  p  ;
: aa0  device  s  &a0  sb  device  1+  rs
                rn  .  ."  ."  rl  emit  p  ;
: bv-init  =>  device  i2-init  a55  ;
: i2cslow  100000  i2speed  ; 
: i2cfull  400000  i2speed  ;