You are given a pointer to a UART_ControlRegister struct representing a 32-bit hardware register. The struct has the following bitfields:
struct UART_ControlRegister {
unsigned int baudrate : 4; // Bits 0-3
unsigned int tx_enable : 1; // Bit 4
unsigned int rx_enable : 1; // Bit 5
unsigned int tx_irq_en : 1; // Bit 6
unsigned int rx_irq_en : 1; // Bit 7
unsigned int parity_en : 1; // Bit 8
unsigned int stop_bits : 1; // Bit 9
unsigned int reserved : 22; // Bits 10-31
};
Your task:
Write a function that receives a pointer to this struct.