I need to write an IEEE single-precision floating point number to a 32-bit hardware register at a particular address. To do that, I need to convert a variable of type float
You can use type punning with a union,
union { float f; uint32_t u; } un; un.f = your_float; uint32_t target = un.u;
to get the bits. Or you can use memcpy.
memcpy