The typedef below is for the DIR register from the Atmel SAMD21 ARM MCU include file. Since the bit struct member and the reg member are both 32 bits, is there any difference between the two members in the union?
I'm trying to understand why they did not just use a uint32_t as the type for the DIRSET register. My only thought that they just defined it this way to be consistent with other registers where there are multiple fields within the bit struct.
typedef union {
struct {
uint32_t DIRSET:32;
} bit;
uint32_t reg;
} PORT_DIRSET_Type;