int main (void) {
uint32_t interval;
unsigned int i,j,k,m;//,x
SystemInit();
/* NVIC is installed inside UARTInit file. */
UARTInit(115200);
/* Config CLKOUT, mostly used for debugging. */
CLKOUT_Setup( CLKOUTCLK_SRC_MAIN_CLK );
LPC_IOCON->PIO0_1 &= ~0x07;
LPC_IOCON->PIO0_1 |= 0x01;//zlg book ,2 should 010 /* CLK OUT */
/* Enable AHB clock to the GPIO domain. */
LPC_SYSCON->SYSAHBCLKCTRL |= (1<<6);
interval = SystemAHBFrequency/1000 - 1;
if ( interval > 0xFFFF )
{
interval = 0xFFFF;
}
init_timer16(0, interval);
enable_timer16(0);
SSPInit();//set ssp pin and enable it
GPIOSetDir( 0, 11, 1 ); //p0_11 as addr/command select
GPIOSetValue( 0, 11, 0 ); //add at 2010_08_17,cmd/data defaut as data
/* Set port 1_8 to output ,led and clock, by wkj 20100815*/
GPIOSetDir( 1, 8, 1 );
/* set not use pin as input */
//GPIOSetDir( PORT0, 1, 0 );
clr_scr(); |