//=========================== Code for test GPIO==================================================
/* Turn on led port clocks */
SIM_SCGC5 = SIM_SCGC5_PORTA_MASK | SIM_SCGC5_PORTB_MASK | SIM_SCGC5_PORTC_MASK | SIM_SCGC5_PORTD_MASK | SIM_SCGC5_PORTE_MASK;
//turn on PIT module clock
/* Set pin0,pin1 of PORTD as GPIO */
PORTD_PCR0=(0|PORT_PCR_MUX(1));
PORTD_PCR1=(0|PORT_PCR_MUX(1));
PORTD_PCR4=(0|PORT_PCR_MUX(1));
PORTD_PCR5=(0|PORT_PCR_MUX(1));
/* set pin0,pin1 to be output*/
GPIOD_PDDR=GPIO_PDDR_PDD(GPIO_PIN(0)|GPIO_PIN(1)|GPIO_PIN(4)|GPIO_PIN(5));
GPIOD_PDOR &= ~(GPIO_PDOR_PDO(GPIO_PIN(0)|GPIO_PIN(1)|GPIO_PIN(4)|GPIO_PIN(5)));