To turn On the C172 A/P, I just press the HDG or ALT button.
To turn Off, if you already have assigned buttons for “Pitch trim up” and “Pitch trim down”, hitting either one will disengage the A/P. Otherwise, mapping a button to “Servo toggle” will also do the job.