/* This function reads ir by ap3216c sensor measurement */
uint16_t ap3216c_read_ir_data(void)
/* This function reads ir by ap3216c sensor measurement */
uint16_t ap3216c_read_ir_data(void)
{
    uint16_t proximity = 0;
    uint32_t read_data;
    read_data = read_low_and_high(AP3216C_IR_DATA_L_REG, 1);
    proximity =
        (read_data & 0x0003) +
        ((read_data >> 8) & 0xFF);
    return proximity;
}