1234
This commit is contained in:
19
GPIO_setup
Normal file
19
GPIO_setup
Normal file
@@ -0,0 +1,19 @@
|
||||
#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);
|
||||
}
|
||||
Reference in New Issue
Block a user