@Test public void enablePsSmartPersistence() throws IOException { Vcnl4200 vcnl4200 = new Vcnl4200(mI2c); Mockito.reset(mI2c); vcnl4200.enablePsSmartPersistence(true); Mockito.verify(mI2c).writeRegWord(eq(Vcnl4200.REGISTER_PS_CONF_3_MS), eq((short) Vcnl4200.PS_SMART_PERSISTENCE_ENABLE)); vcnl4200.enablePsSmartPersistence(false); Mockito.verify(mI2c).writeRegWord(eq(Vcnl4200.REGISTER_PS_CONF_3_MS), eq((short) Vcnl4200.PS_SMART_PERSISTENCE_DISABLE)); }
public void enablePsSmartPersistence(boolean enable) throws IOException, IllegalStateException { setPsConf3Ms(PS_SMART_PERSISTENCE_MASK, (enable) ? PS_SMART_PERSISTENCE_ENABLE : PS_SMART_PERSISTENCE_DISABLE); }
Vcnl4200 implements AutoCloseable { public void enablePsSmartPersistence(boolean enable) throws IOException, IllegalStateException { setPsConf3Ms(PS_SMART_PERSISTENCE_MASK, (enable) ? PS_SMART_PERSISTENCE_ENABLE : PS_SMART_PERSISTENCE_DISABLE); } }
Vcnl4200 implements AutoCloseable { public void enablePsSmartPersistence(boolean enable) throws IOException, IllegalStateException { setPsConf3Ms(PS_SMART_PERSISTENCE_MASK, (enable) ? PS_SMART_PERSISTENCE_ENABLE : PS_SMART_PERSISTENCE_DISABLE); } Vcnl4200(String bus, Configuration configuration);  Vcnl4200(String bus);   Vcnl4200(I2cDevice device, Configuration configuration);   Vcnl4200(I2cDevice device); }
Vcnl4200 implements AutoCloseable { public void enablePsSmartPersistence(boolean enable) throws IOException, IllegalStateException { setPsConf3Ms(PS_SMART_PERSISTENCE_MASK, (enable) ? PS_SMART_PERSISTENCE_ENABLE : PS_SMART_PERSISTENCE_DISABLE); } Vcnl4200(String bus, Configuration configuration);  Vcnl4200(String bus);   Vcnl4200(I2cDevice device, Configuration configuration);   Vcnl4200(I2cDevice device); void applyConfiguration(Configuration configuration); int getDeviceId(); float getAlsData(); float getCurrentAlsResolution(); float getCurrentAlsMaxRange(); int getCurrentPsMaxRange(); int getPsData(); int getWhiteData(); InterruptStatus getInterruptStatus(); void setAlsIntegrationTime(@AlsIntegrationTime int integrationTime); void setAlsInterruptSwitch(@AlsInterruptSwitch int interruptSwitch); void setAlsInterruptPersistence(@AlsInterruptPersistence int interruptPersistence); void enableAlsInterrupt(boolean enable); void enableAlsPower(boolean enable); void setAlsInterruptThresholds(float lowThreshold, float highThreshold); void setPsIredDutyCycle(@PsIredDutyCycle int dutyCycle); void setPsInterruptPersistence(@PsInterruptPersistence int interruptPersistence); void setPsIntegrationTime(@PsIntegrationTime int integrationTime); void enablePsPower(boolean enable); void setPsOutputResolution(@PsOutputResolution int outputResolution); void setPsInterruptConfiguration(@PsInterruptConfiguration int interruptConfiguration); void setPsMultiPulseNumbers(@PsMultiPulseNumbers int multiPulseNumbers); void enablePsSmartPersistence(boolean enable); void enablePsActiveForceMode(boolean enable); int getOnDemandPsData(); void setPsSunlightImmunity(@PsSunlightImmunity int sunlightImmunity); void enablePsCancellationFunction(boolean enable); void setPsOperationMode(@PsOperationMode int operationMode); void setPsSunlightCapability(@PsSunlightCapability int sunlightCapability); void setPsSunlightProtectMode(@PsSunlightProtectMode int sunlightProtectMode); void setPsLedCurrent(@PsLedCurrent int ledCurrent); void setPsCancellationLevel(short cancellationLevel); void setPsInterruptThresholds(int lowThreshold, int highThreshold); @Override void close(); }
Vcnl4200 implements AutoCloseable { public void enablePsSmartPersistence(boolean enable) throws IOException, IllegalStateException { setPsConf3Ms(PS_SMART_PERSISTENCE_MASK, (enable) ? PS_SMART_PERSISTENCE_ENABLE : PS_SMART_PERSISTENCE_DISABLE); } Vcnl4200(String bus, Configuration configuration);  Vcnl4200(String bus);   Vcnl4200(I2cDevice device, Configuration configuration);   Vcnl4200(I2cDevice device); void applyConfiguration(Configuration configuration); int getDeviceId(); float getAlsData(); float getCurrentAlsResolution(); float getCurrentAlsMaxRange(); int getCurrentPsMaxRange(); int getPsData(); int getWhiteData(); InterruptStatus getInterruptStatus(); void setAlsIntegrationTime(@AlsIntegrationTime int integrationTime); void setAlsInterruptSwitch(@AlsInterruptSwitch int interruptSwitch); void setAlsInterruptPersistence(@AlsInterruptPersistence int interruptPersistence); void enableAlsInterrupt(boolean enable); void enableAlsPower(boolean enable); void setAlsInterruptThresholds(float lowThreshold, float highThreshold); void setPsIredDutyCycle(@PsIredDutyCycle int dutyCycle); void setPsInterruptPersistence(@PsInterruptPersistence int interruptPersistence); void setPsIntegrationTime(@PsIntegrationTime int integrationTime); void enablePsPower(boolean enable); void setPsOutputResolution(@PsOutputResolution int outputResolution); void setPsInterruptConfiguration(@PsInterruptConfiguration int interruptConfiguration); void setPsMultiPulseNumbers(@PsMultiPulseNumbers int multiPulseNumbers); void enablePsSmartPersistence(boolean enable); void enablePsActiveForceMode(boolean enable); int getOnDemandPsData(); void setPsSunlightImmunity(@PsSunlightImmunity int sunlightImmunity); void enablePsCancellationFunction(boolean enable); void setPsOperationMode(@PsOperationMode int operationMode); void setPsSunlightCapability(@PsSunlightCapability int sunlightCapability); void setPsSunlightProtectMode(@PsSunlightProtectMode int sunlightProtectMode); void setPsLedCurrent(@PsLedCurrent int ledCurrent); void setPsCancellationLevel(short cancellationLevel); void setPsInterruptThresholds(int lowThreshold, int highThreshold); @Override void close(); static final int ALS_IT_TIME_50MS; static final int ALS_IT_TIME_100MS; static final int ALS_IT_TIME_200MS; static final int ALS_IT_TIME_400MS; static final int ALS_INT_SWITCH_ALS_CHANNEL; static final int ALS_INT_SWITCH_WHITE_CHANNEL; static final int ALS_INT_PERSISTENCE_1; static final int ALS_INT_PERSISTENCE_2; static final int ALS_INT_PERSISTENCE_4; static final int ALS_INT_PERSISTENCE_8; static final int ALS_INT_DISABLE; static final int ALS_INT_ENABLE; static final int ALS_POWER_ON; static final int ALS_POWER_OFF; static final int PS_IRED_DUTY_CYCLE_1_160; static final int PS_IRED_DUTY_CYCLE_1_320; static final int PS_IRED_DUTY_CYCLE_1_640; static final int PS_IRED_DUTY_CYCLE_1_1280; static final int PS_INT_PERSISTENCE_1; static final int PS_INT_PERSISTENCE_2; static final int PS_INT_PERSISTENCE_3; static final int PS_INT_PERSISTENCE_4; static final int PS_IT_1; static final int PS_IT_1_5; static final int PS_IT_2; static final int PS_IT_4; static final int PS_IT_8; static final int PS_IT_9; static final int PS_POWER_ON; static final int PS_POWER_OFF; static final int PS_OUT_RES_12_BITS; static final int PS_OUT_RES_16_BITS; static final int PS_INT_CONFIG_DISABLE; static final int PS_INT_CONFIG_TRIGGER_BY_CLOSING; static final int PS_INT_CONFIG_TRIGGER_BY_AWAY; static final int PS_INT_CONFIG_TRIGGER_BY_CLOSING_AND_AWAY; static final int PS_MULTI_PULSE_1; static final int PS_MULTI_PULSE_2; static final int PS_MULTI_PULSE_4; static final int PS_MULTI_PULSE_8; static final int PS_SMART_PERSISTENCE_DISABLE; static final int PS_SMART_PERSISTENCE_ENABLE; static final int PS_ACTIVE_FORCE_MODE_DISABLE; static final int PS_ACTIVE_FORCE_MODE_ENABLE; static final int PS_TRIGGER_NO_PS_ACTIVE_FORCE_MODE; static final int PS_TRIGGER_ONE_TIME_CYCLE; static final int PS_SUNLIGHT_IMMUNITY_TYPICAL; static final int PS_SUNLIGHT_IMMUNITY_2X; static final int PS_SUNLIGHT_CANC_DISABLE; static final int PS_SUNLIGHT_CANC_ENABLE; static final int PS_OP_NORMAL_WITH_INT; static final int PS_OP_DETECT_LOGIC_OUTPUT; static final int PS_SUNLIGHT_CAP_TYPICAL; static final int PS_SUNLIGHT_CAP_1_5; static final int PS_SUNLIGHT_PROTECT_MODE_00; static final int PS_SUNLIGHT_PROTECT_MODE_FF; static final int PS_LED_CURRENT_50MA; static final int PS_LED_CURRENT_75MA; static final int PS_LED_CURRENT_100MA; static final int PS_LED_CURRENT_120MA; static final int PS_LED_CURRENT_140MA; static final int PS_LED_CURRENT_160MA; static final int PS_LED_CURRENT_180MA; static final int PS_LED_CURRENT_200MA; static final float[] ALS_IT_50MS_SENSITIVITY_RANGE; static final float[] ALS_IT_100MS_SENSITIVITY_RANGE; static final float[] ALS_IT_200MS_SENSITIVITY_RANGE; static final float[] ALS_IT_400MS_SENSITIVITY_RANGE; }