/*
===============================================================================
Name : GPIO0_1_Test.c
Author : $(author)
Version :
Copyright : $(copyright)
Description : main definition
===============================================================================
*/
#include "chip.h"
#include <cr_section_macros.h>
const uint32_t OscRateIn = 12000000;
const uint32_t ExtRateIn = 0;
enum PORTS {PORT0};
enum GPIO0PIO // For the TSSOP20 and SOP20 packages
{PIO0_0,PIO0_1,PIO0_2,PIO0_3,PIO0_4,PIO0_5,PIO0_6,PIO0_7,
PIO0_8,PIO0_9,PIO0_10,PIO0_11,PIO0_12,PIO0_13,PIO0_14,PIO0_15,
PIO0_16,PIO0_17};
enum INOUT {IN, OUT};
enum LOWHIGH {LOW, HIGH};
int main(void) {
SystemCoreClockUpdate();
Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_GPIO);
Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, PORT0, PIO0_1);
Chip_GPIO_SetPinState(LPC_GPIO_PORT, PORT0, PIO0_1, LOW);
// GPIO0_1 should be low, but there is a clock signal there. Why?
// Force the counter to be placed into memory
volatile static int i = 0 ;
// Enter an infinite loop, just incrementing a counter
while(1) {
i++ ;
}
return 0 ;
}
|