Use enum instead of define for pa_cp types
Moving functions so that pa_pd may use them
Moving yet another function
Implementing pa_pd