Bit-Structured Registers for Embedded Hardware
Unfortunately, the C standard does not guarantee your struct is even the same size as a uint32_t since there's no requirement that bit-fields be compactly stored. Even if they were, you still have to figure out which of the 32 bits are you interested in. The first 24? Last 24? somewhere in the middle (unlikely, but possible)? This is not portable.

If you are ok with the performance hit, you can write a helper function which will pack the constituent components for you.

uint32_t pll_n_reg_pack(PLL_N_REG field)
{
    uint32_t res = n_reg.control_bits;
    res |= n_reg.a_counter &lt;&lt; 2;
    res |= n_reg.reserved &lt;&lt; 7;
    res |= n_reg.b_counter &lt;&lt; 8;
    res |= n_reg.cp_gain &lt;&lt; 21;
    res |= n_reg.div_by_2 &lt;&lt; 22;
    res |= n_reg.div_by_sel &lt;&lt; 23;
    return res;
}


If performance is critical and the compiler isn't able to optimize this, you might want to consider working with a raw uint32_t (or uint8_t[3]) and localize the code such that the bit shifting/masking is limited.

More useful information:


Memory layout of struct having bitfields
Why bit endianness is an issue in bitfields?