hal_utils_float_to_fixed_point_32b() function
Convert the float type to fixed point type
Arguments
flt
IEEE 754 float type data
fp_cfg
Fixed-point data configuration
fp_out
The output fixed-point data
Return value
0: Success -1: Fixed point data overflow, `fp_out` will still be assigned -2: Float is NaN -3: Invalid configuration
Notes
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)
hal_utils_float_to_fixed_point_32b() reads 7 variables:
![]()
hal_utils_float_to_fixed_point_32b()