-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathI2cTransfer.java
More file actions
33 lines (28 loc) · 1.04 KB
/
I2cTransfer.java
File metadata and controls
33 lines (28 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package org.usfirst.FTC5866.library;
/**
* Created by Olavi Kamppari on 10/22/2015.
*/
public class I2cTransfer {
static final byte
READ_MODE = 0x00 - 128, // MSB = 1
WRITE_MODE = 0x00; // MSB = 0
public byte mode;
public byte regNumber;
public byte regCount;
public long regValue; // Write up to 8 bytes
public boolean isLowFirst; // true = Low Byte first, false = Low Byte last
public I2cTransfer (byte regNumber, byte regCount){
this.mode = READ_MODE;
this.regNumber = regNumber;
this.regCount = regCount;
this.regValue = 0;
this.isLowFirst = false;
}
public I2cTransfer (byte regNumber, byte regCount, long regValue, boolean isLowFirst){
this.mode = WRITE_MODE;
this.regNumber = regNumber;
this.regCount = regCount;
this.regValue = regValue;
this.isLowFirst = isLowFirst;
}
}