src/APDS9930.cpp
bool APDS9930::setProximityDiode(uint8_t drive)
{
    uint8_t val;
    
    /* Read value from CONTROL register */
    if( !wireReadDataByte(APDS9930_CONTROL, val) ) {
        return false;
    }
    
    /* Set bits in register to given value */
    drive &= 0b00000011;
    drive = drive << 4;
    val &= 0b11001111;
    val |= drive;
    
    /* Write register value back into CONTROL register */
    if( !wireWriteDataByte(APDS9930_CONTROL, val) ) {
        return false;
    }
    
    return true;
}
/**
 * @brief Selects the proximity diode
 *
 * Value    Diode selection
 *   0       Reserved
 *   1       Reserved
 *   2       Use Ch1 diode
 *   3       Reserved
 *
 * @param[in] drive the value (0-3) for the diode
 * @return True if operation successful. False otherwise.
 */
@brief Selects the proximity diode
Value    Diode selection
0       Reserved
1       Reserved
2       Use Ch1 diode
3       Reserved

@param[in] drive the value (0-3) for the diode
@return True if operation successful. False otherwise.
@brief Selects the proximity diode Value Diode selection 0 Reserved 1 Reserved 2 Use Ch1 diode 3 Reserved @param [ in ] drive the value ( 0 - 3 ) for the diode @return True if operation successful . False otherwise .
bool APDS9930::setProximityDiode(uint8_t drive)
{
    uint8_t val;
    if( !wireReadDataByte(APDS9930_CONTROL, val) ) {
        return false;
    }
    drive &= 0b00000011;
    drive = drive << 4;
    val &= 0b11001111;
    val |= drive;
    if( !wireWriteDataByte(APDS9930_CONTROL, val) ) {
        return false;
    }
    return true;
}
bool APDS9930 :: setProximityDiode ( uint8_t drive ) { uint8_t val ; if ( ! wireReadDataByte ( APDS9930_CONTROL , val ) ) { return false ; } drive &= 0b00000011 ; drive = drive << 4 ; val &= 0b11001111 ; val |= drive ; if ( ! wireWriteDataByte ( APDS9930_CONTROL , val ) ) { return false ; } return true ; }
@brief Selects the proximity diode
 Value    Diode selection
   0       Reserved
   1       Reserved
   2       Use Ch1 diode
   3       Reserved
@brief Selects the proximity diode Value Diode selection 0 Reserved 1 Reserved 2 Use Ch1 diode 3 Reserved
/* Read value from CONTROL register */ /* Set bits in register to given value */ /* Write register value back into CONTROL register */