Automatically set ALTERNATE pin mode when setting alternate function