Class SCI18IS600


  • public class SCI18IS600
    extends Object
    • Constructor Summary

      Constructors 
      Constructor Description
      SCI18IS600​(int resetPinNum)
      create new SCI18SI600 Note that QSPI.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 blocking
      boolean I2COk()
      check if I2C bus is idle blocking
      boolean I2CWrite​(int addr, int[] data)
      write data to I2C bus non-blocking
      void I2CWriteBlocking​(int addr, int[] data)
      write data to I2C bus blocks until transfer is done
      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
      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
      void printI2CStatus()
      print current I2C bus status to stdout blocking
      void printState()
      print current state of the internal state machine
      void readBufferBlocking​(int[] buffer)
      read SCI18SI600 I2C receive buffer blocks until transfer is done
      int readRegBlocking​(int regAddr)
      read SCI18IS600 register blocks until tranfser is done
      void writeRegBlocking​(int regAddr, int value)
      write to SCI18IS600 register blocks until transfer is done
    • Constructor Detail

      • SCI18IS600

        public SCI18IS600​(int resetPinNum)
        create new SCI18SI600 Note that QSPI.init() needs to be called beforehand
        Parameters:
        resetPinNum - MPIOSM_DIO pin number connected to SCI18SI600 reset pin
    • Method Detail

      • writeRegBlocking

        public void writeRegBlocking​(int regAddr,
                                     int value)
        write to SCI18IS600 register blocks until transfer is done
        Parameters:
        regAddr - register address
        value - 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 write
        recBuffer - 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 write
        buffer - 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