?? main.c
字號:
#include <LPC21xx.H>
void SPI_ISR (void) __irq;
void main (void)
{
unsigned int result;
PINSEL0 = 0x00005500; //enable SPI0 pins
S0SPCCR = 0x000000C8; //Set bit timing
S0SPCR = 0x000000A0; //Master interrupts enabled
VICVectCntl0 = 0x0000002A; //select a priority slot for a given interrupt
VICVectAddr0 = (unsigned)SPI_ISR; //pass the address of the IRQ into the VIC slot
VICIntEnable = 0x00000400; //enable interrupt
result = S0SPSR; //clear the status register prior to transmission
S0SPDR = 0x00000055; //write some data
while (1)
{
;
}
}
void SPI_ISR (void) __irq
{
unsigned int result;
result = S0SPSR; //read and clear the status flags
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -