Here is my gpio_init function...
void gpio_init(void)
{
// enable clock for gpio ports a and b
SIM_SCGC5 |= SIM_SCGC5_PORTA_MASK + SIM_SCGC5_PORTB_MASK;
// select gpio as pin functionality
gpio_PTB_PCR1 |= PORT_PCR_MUX(PIN_FUNC_ALT1); // unused
gpio_PTB_PCR2 |= PORT_PCR_MUX(PIN_FUNC_ALT1); // adc_pdrst_n
gpio_PTB_PCR5 |= PORT_PCR_MUX(PIN_FUNC_ALT1); // unused
gpio_PTA_PCR6 |= PORT_PCR_MUX(PIN_FUNC_ALT1); // adc_drdy_n/spi_0_miso
// configure port b pins and clear output states of port b pins
gpio_PTB_PDDR |= gpio_PTB_PDRST_N + gpio_PTB_1_UNUSED + gpio_PTB_5_UNUSED;
gpio_PTB_PCOR |= gpio_PTB_PDRST_N + gpio_PTB_1_UNUSED + gpio_PTB_5_UNUSED;
// testing...
gpio_PTB_PCR2 |= PORT_PCR_IRQC(PIN_IRQC_8); -- this works...
gpio_PTA_PCR6 |= PORT_PCR_IRQC(PIN_IRQC_8); -- this does NOT! Why?
// configure port a pins
gpio_PTA_PDDR |= gpio_PTA_DRDY_N + gpio_PTA_5_UNUSED + gpio_PTA_7_UNUSED;
gpio_PTA_PCOR |= gpio_PTA_5_UNUSED + gpio_PTA_7_UNUSED;
return;
}