Diagram of the GPIOA_MODER register as 16 two-bit fields, one per pin. Pin 5's field is set to 01 by the line GPIOA->MODER |= (1 << 10), making PA5 an output that drives an LED.

I'm writing drivers for the STM32's peripherals straight from the reference manual, without ST's HAL. I want to understand what the HAL normally handles for you: how each peripheral is clocked, configured and driven through its memory-mapped registers.