Class SCI18IS600
- java.lang.Object
-
- org.deepjava.runtime.mpc555.driver.SCI18IS600
-
public class SCI18IS600 extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
REG_GPIO_CFG
static int
REG_GPIO_VAL
static int
REG_I2C_STAT
-
Constructor Summary
Constructors Constructor Description SCI18IS600(int resetPinNum)
create new SCI18SI600 Note thatQSPI.init()
needs to be called beforehand
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
I2CBusy()
check if I2C bus is busy blockingboolean
I2COk()
check if I2C bus is idle blockingboolean
I2CWrite(int addr, int[] data)
write data to I2C bus non-blockingvoid
I2CWriteBlocking(int addr, int[] data)
write data to I2C bus blocks until transfer is doneboolean
I2CWriteRead(int addr, int[] writeData, int[] buffer)
write to I2C bus, then read first write all data in writeData to I2C bus, then read recBuffer.length bytes into readBuffer note that all values are transmitted as bytesvoid
I2CWriteReadBlocking(int addr, int[] writeData, int[] recBuffer)
write to I2C bus, then read first write all data in writeData to I2C bus, then read recBuffer.length bytes into readBuffer note that all values are transmitted as bytes blocks until transaction is donevoid
printI2CStatus()
print current I2C bus status to stdout blockingvoid
printState()
print current state of the internal state machinevoid
readBufferBlocking(int[] buffer)
read SCI18SI600 I2C receive buffer blocks until transfer is doneint
readRegBlocking(int regAddr)
read SCI18IS600 register blocks until tranfser is donevoid
writeRegBlocking(int regAddr, int value)
write to SCI18IS600 register blocks until transfer is done
-
-
-
Field Detail
-
REG_I2C_STAT
public static final int REG_I2C_STAT
- See Also:
- Constant Field Values
-
REG_GPIO_CFG
public static final int REG_GPIO_CFG
- See Also:
- Constant Field Values
-
REG_GPIO_VAL
public static final int REG_GPIO_VAL
- See Also:
- Constant Field Values
-
-
Method Detail
-
writeRegBlocking
public void writeRegBlocking(int regAddr, int value)
write to SCI18IS600 register blocks until transfer is done- Parameters:
regAddr
- register addressvalue
- value to write
-
readRegBlocking
public int readRegBlocking(int regAddr)
read SCI18IS600 register blocks until tranfser is done- Parameters:
regAddr
- register address- Returns:
- value in register
-
I2CWriteReadBlocking
public void I2CWriteReadBlocking(int addr, int[] writeData, int[] recBuffer)
write to I2C bus, then read first write all data in writeData to I2C bus, then read recBuffer.length bytes into readBuffer note that all values are transmitted as bytes blocks until transaction is done- Parameters:
addr
- I2C slave address (7bits, without R/W bit)writeData
- data to writerecBuffer
- buffer for receive data
-
I2CWriteRead
public boolean I2CWriteRead(int addr, int[] writeData, int[] buffer)
write to I2C bus, then read first write all data in writeData to I2C bus, then read recBuffer.length bytes into readBuffer note that all values are transmitted as bytes- Parameters:
addr
- I2C slave address (7bits, without R/W bit)writeData
- data to writebuffer
- buffer for data to be received in- Returns:
- true if transfer is done, false if still in progress
-
I2CWriteBlocking
public void I2CWriteBlocking(int addr, int[] data)
write data to I2C bus blocks until transfer is done- Parameters:
addr
- I2C slave address (7bit, without R/W bit)data
- data to write
-
I2CWrite
public boolean I2CWrite(int addr, int[] data)
write data to I2C bus non-blocking- Parameters:
addr
- I2C slave address (7bit, without R/W bit)data
- data to write- Returns:
- true if transfer is done, false if still in progress
-
readBufferBlocking
public void readBufferBlocking(int[] buffer)
read SCI18SI600 I2C receive buffer blocks until transfer is done- Parameters:
buffer
- buffer to return data in
-
I2COk
public boolean I2COk()
check if I2C bus is idle blocking- Returns:
- true if idle, false if busy or error
-
I2CBusy
public boolean I2CBusy()
check if I2C bus is busy blocking- Returns:
- true if busy, false if idle or error
-
printI2CStatus
public void printI2CStatus()
print current I2C bus status to stdout blocking
-
printState
public void printState()
print current state of the internal state machine
-
-