hw/drivers/sensors/hts221/src/hts221.c
static int32_t hts221_calc_rh(hts221_cal_t *cal, int32_t h_out)
{
    int32_t kn = cal->H1_rH_x2 - cal->H0_rH_x2;
    int32_t kd = cal->H1_T0_out - cal->H0_T0_out;
    int32_t x = h_out-cal->H0_T0_out;
    int32_t res = (((kn*x*10)/kd) + cal->H0_rH_x2*10)/2;
    return (res > 1000) ? 1000 : res;
}
// returns relative humidity in procent x10
returns relative humidity in procent x10
returns relative humidity in procent x10
static int32_t hts221_calc_rh(hts221_cal_t *cal, int32_t h_out)
{
    int32_t kn = cal->H1_rH_x2 - cal->H0_rH_x2;
    int32_t kd = cal->H1_T0_out - cal->H0_T0_out;
    int32_t x = h_out-cal->H0_T0_out;
    int32_t res = (((kn*x*10)/kd) + cal->H0_rH_x2*10)/2;
    return (res > 1000) ? 1000 : res;
}
static int32_t hts221_calc_rh ( hts221_cal_t * cal , int32_t h_out ) { int32_t kn = cal -> H1_rH_x2 - cal -> H0_rH_x2 ; int32_t kd = cal -> H1_T0_out - cal -> H0_T0_out ; int32_t x = h_out - cal -> H0_T0_out ; int32_t res = ( ( ( kn * x * 10 ) / kd ) + cal -> H0_rH_x2 * 10 ) / 2 ; return ( res > 1000 ) ? 1000 : res ; }
returns relative humidity in procent x10
returns relative humidity in procent x10