File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ const Address = 0x29 //0x52
77const (
88 CHIP_ID = 0xEACC
99 SOFT_RESET = 0x0000
10+ I2C_SLAVE_DEVICE_ADDRESS = 0x0001
1011 OSC_MEASURED_FAST_OSC_FREQUENCY = 0x0006
1112 VHV_CONFIG_TIMEOUT_MACROP_LOOP_BOUND = 0x0008
1213 VHV_CONFIG_INIT = 0x000B
Original file line number Diff line number Diff line change @@ -133,6 +133,17 @@ func (d *Device) Configure(use2v8Mode bool) bool {
133133 return true
134134}
135135
136+ // SetAddress sets the I2C address which this device listens to.
137+ func (d * Device ) SetAddress (address uint8 ) {
138+ d .writeReg (I2C_SLAVE_DEVICE_ADDRESS , address )
139+ d .Address = uint16 (address )
140+ }
141+
142+ // GetAddress returns the I2C address which this device listens to.
143+ func (d * Device ) GetAddress () uint8 {
144+ return uint8 (d .Address )
145+ }
146+
136147// SetTimeout configures the timeout
137148func (d * Device ) SetTimeout (timeout uint32 ) {
138149 d .timeout = timeout
You can’t perform that action at this time.
0 commit comments