@Test public void setMultitouchInputMax_throwsIfTooLarge() throws IOException { mExpectedException.expect(IllegalArgumentException.class); mDriver.setMultitouchInputMax(CONFIGURATION.maxTouch + 1); }
public void setMultitouchInputMax(int count) throws IOException { if (count < 1 || count > mChipConfiguration.maxTouch) { throw new IllegalArgumentException("Multitouch count must be between 1 and " + mChipConfiguration.maxTouch); } byte value = mDevice.readRegByte(REG_MTOUCH_CFG); value = BitwiseUtil.setBit(value, 7); count = (count - 1) << 2; value = BitwiseUtil.applyBitRange(value, count, 0x0C); mDevice.writeRegByte(REG_MTOUCH_CFG, value); }
Cap1xxx implements AutoCloseable { public void setMultitouchInputMax(int count) throws IOException { if (count < 1 || count > mChipConfiguration.maxTouch) { throw new IllegalArgumentException("Multitouch count must be between 1 and " + mChipConfiguration.maxTouch); } byte value = mDevice.readRegByte(REG_MTOUCH_CFG); value = BitwiseUtil.setBit(value, 7); count = (count - 1) << 2; value = BitwiseUtil.applyBitRange(value, count, 0x0C); mDevice.writeRegByte(REG_MTOUCH_CFG, value); } }
Cap1xxx implements AutoCloseable { public void setMultitouchInputMax(int count) throws IOException { if (count < 1 || count > mChipConfiguration.maxTouch) { throw new IllegalArgumentException("Multitouch count must be between 1 and " + mChipConfiguration.maxTouch); } byte value = mDevice.readRegByte(REG_MTOUCH_CFG); value = BitwiseUtil.setBit(value, 7); count = (count - 1) << 2; value = BitwiseUtil.applyBitRange(value, count, 0x0C); mDevice.writeRegByte(REG_MTOUCH_CFG, value); } @Deprecated  Cap1xxx(Context context, String i2cName, String alertName, Configuration chip);  Cap1xxx(String i2cName, String alertName, Configuration chip); @Deprecated  Cap1xxx(Context context, String i2cName, String alertName, Configuration chip,
            Handler handler);  Cap1xxx(String i2cName, String alertName, Configuration chip, Handler handler);  Cap1xxx(String i2cName, int i2cAddress, String alertName, Configuration chip, Handler handler); @VisibleForTesting  Cap1xxx(I2cDevice i2cDevice, Gpio alertPin, Configuration chip); }
Cap1xxx implements AutoCloseable { public void setMultitouchInputMax(int count) throws IOException { if (count < 1 || count > mChipConfiguration.maxTouch) { throw new IllegalArgumentException("Multitouch count must be between 1 and " + mChipConfiguration.maxTouch); } byte value = mDevice.readRegByte(REG_MTOUCH_CFG); value = BitwiseUtil.setBit(value, 7); count = (count - 1) << 2; value = BitwiseUtil.applyBitRange(value, count, 0x0C); mDevice.writeRegByte(REG_MTOUCH_CFG, value); } @Deprecated  Cap1xxx(Context context, String i2cName, String alertName, Configuration chip);  Cap1xxx(String i2cName, String alertName, Configuration chip); @Deprecated  Cap1xxx(Context context, String i2cName, String alertName, Configuration chip,
            Handler handler);  Cap1xxx(String i2cName, String alertName, Configuration chip, Handler handler);  Cap1xxx(String i2cName, int i2cAddress, String alertName, Configuration chip, Handler handler); @VisibleForTesting  Cap1xxx(I2cDevice i2cDevice, Gpio alertPin, Configuration chip); void setOnCapTouchListener(OnCapTouchListener listener); void setRepeatRate(@RepeatRate int rate); void setSensitivity(@Sensitivity int sensitivity); void setLedFade(@LedFade int ledFade); void setLedBrightness(float ledBrightness); void setMultitouchInputMax(int count); boolean readInterruptFlag(); boolean readInterruptFlag(boolean clear); void clearInterruptFlag(); boolean readInputChannel(int channel); boolean readLedState(int ledIndex); void setLedState(int ledIndex, boolean state); int getInputChannelCount(); int getMaximumTouchPoints(); int getLedCount(); @Override void close(); void setInputsEnabled(boolean enable); void setInterruptsEnabled(boolean enable); void setRepeatEnabled(boolean enable); void setLedInputLinkEnabled(boolean enable); }
Cap1xxx implements AutoCloseable { public void setMultitouchInputMax(int count) throws IOException { if (count < 1 || count > mChipConfiguration.maxTouch) { throw new IllegalArgumentException("Multitouch count must be between 1 and " + mChipConfiguration.maxTouch); } byte value = mDevice.readRegByte(REG_MTOUCH_CFG); value = BitwiseUtil.setBit(value, 7); count = (count - 1) << 2; value = BitwiseUtil.applyBitRange(value, count, 0x0C); mDevice.writeRegByte(REG_MTOUCH_CFG, value); } @Deprecated  Cap1xxx(Context context, String i2cName, String alertName, Configuration chip);  Cap1xxx(String i2cName, String alertName, Configuration chip); @Deprecated  Cap1xxx(Context context, String i2cName, String alertName, Configuration chip,
            Handler handler);  Cap1xxx(String i2cName, String alertName, Configuration chip, Handler handler);  Cap1xxx(String i2cName, int i2cAddress, String alertName, Configuration chip, Handler handler); @VisibleForTesting  Cap1xxx(I2cDevice i2cDevice, Gpio alertPin, Configuration chip); void setOnCapTouchListener(OnCapTouchListener listener); void setRepeatRate(@RepeatRate int rate); void setSensitivity(@Sensitivity int sensitivity); void setLedFade(@LedFade int ledFade); void setLedBrightness(float ledBrightness); void setMultitouchInputMax(int count); boolean readInterruptFlag(); boolean readInterruptFlag(boolean clear); void clearInterruptFlag(); boolean readInputChannel(int channel); boolean readLedState(int ledIndex); void setLedState(int ledIndex, boolean state); int getInputChannelCount(); int getMaximumTouchPoints(); int getLedCount(); @Override void close(); void setInputsEnabled(boolean enable); void setInterruptsEnabled(boolean enable); void setRepeatEnabled(boolean enable); void setLedInputLinkEnabled(boolean enable); static final int DEFAULT_I2C_ADDRESS; static final int REPEAT_DISABLE; static final int REPEAT_FAST; static final int REPEAT_NORMAL; static final int REPEAT_SLOW; static final int SENSITIVITY_HIGH; static final int SENSITIVITY_NORMAL; static final int SENSITIVITY_LOW; static final int LED_FADE_INSTANT; static final int LED_FADE_FAST; static final int LED_FADE_SLOW; }