Alternate Functions Most GPIO pins feature alternate functions Each pin has one or several predefined uses PWM, UART, SPI, I2C, ... Most of the device pins are managed by the GPIO subsystem Usually, only power and high-speed signals (e.g. USB) live on dedicated pins When using GPIO, programs should be portable We need an API that always works, with any CPU family The same program should build and work everywhere The applicatin code (and data) should never refer to CPU specifics When using alternate functions, it's a device-specific issue The driver (UART, SPI, whatever) is machine specific, It must know the device registers It can know the device pins (and AF) too Still, we want a consistent API for GPIO use When offering and alternate function API, GPIO must be 0 Portability is paramount