裸机寄存器操作


贴个裸机扫盲,以防哪天被花盆砸中,记忆全无。(纯水贴,,活着)


//1 mode config
#define ON 0x0

//2 port register define
#define rGPBCON (* (volatile unsigned *) 0x56000010) // Port B control, from datasheet

//3 prt init
void LedInit(void)
{
	rGPBCON = (rGPBCON & 0xfffffff0) | 0x5; // from datasheet
}



你可能感兴趣的:(裸机寄存器操作)