Function esp_idf_sys::hal_utils_float_to_fixed_point_32b

source ยท
pub unsafe extern "C" fn hal_utils_float_to_fixed_point_32b(
    flt: f32,
    fp_cfg: *const hal_utils_fixed_point_t,
    fp_out: *mut u32,
) -> c_int
Expand description

@brief Convert the float type to fixed point type @note The supported data format: - [input] float (IEEE 754): sign(1bit) + exponent(8bit) + mantissa(23bit) (32 bit in total) - [output] fixed-point: sign(1bit) + integer(int_bit) + fraction(frac_bit) (less or equal to 32 bit)

@param[in] flt IEEE 754 float type data @param[in] fp_cfg Fixed-point data configuration @param[out] fp_out The output fixed-point data @return 0: Success -1: Fixed point data overflow, fp_out will still be assigned -2: Float is NaN -3: Invalid configuration