Here's an overview of the pin muxing implementation.