#include "LPC13xx.h" int main(void) { LPC_SYSCON->SYSAHBCLKCTRL |= (1<<6); //GPIO clk en LPC_SYSCON->SYSAHBCLKCTRL |= (1<<16); //IOCON clk en LPC_SYSCON->SYSAHBCLKCTRL |= 0x7ffff; //en all clk LPC_IOCON->PIO0_7 = 0xD; //pin function : 0011010000=> 0x0D0 LPC_GPIO0->DIR |= (1<<7); //pin direction LPC_GPIO0->DATA &= ~(1<<7); //set pin low /* while(1){ // loop - commented out for now... LPC_GPIO0->DATA |= (1<<7); //set pin high for(i=0; i<0x10000; ++i); LPC_GPIO0->DATA &= ~(1<<7); //set pin low for(i=0; i<0x10000; ++i); } //end while */ } //end main |
LPC_IOCON->PIO0_7 =[color=#f30] 0xD[/color]; //pin function : 0011010000=> [color=#f00]0x0D0[/color] |