19 lines
672 B
Plaintext
19 lines
672 B
Plaintext
#define LED1 8
|
|
#define LED2 9
|
|
|
|
static void GPIOInit(void) {
|
|
/* Enable the clock GPIO */
|
|
Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_GPIO);
|
|
/*disable default fixed pins*/
|
|
Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM);
|
|
Chip_SWM_DisableFixedPin(SWM_FIXED_XTALIN); //pin 8
|
|
Chip_SWM_DisableFixedPin(SWM_FIXED_XTALOUT); //pin 9
|
|
Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM);
|
|
|
|
/* red */
|
|
Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 0, LED1);
|
|
Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0, LED1, false);
|
|
/* green */
|
|
Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 0, LED2);
|
|
Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0, LED2, false);
|
|
} |