//
P5SEL |= BIT2+BIT3; // Port select XT2
UCSCTL6 &= ~XT2OFF; // Enable XT2
UCSCTL3 |= SELREF_2; // FLLref = REFO
// Since LFXT1 is not used,
// sourcing FLL with LFXT1 can cause
// XT1OFFG flag to set
UCSCTL4 |= SELA_2; // //ACLK=REFO,SMCLK=DCO,MCLK=DCO
}
//初始化与CC1120连接的spi
void CC1120_SpiInit(void)
{
volatile unsigned int i;
WDTCTL = WDTPW+WDTHOLD; // Stop watchdog timer
P1DIR |= BIT7; // Set P1.7 for CSN
P2DIR |= BIT3; // Set P2.3 for slave reset
P3SEL |= BIT3+BIT4; // P3.3,4 option select
P2SEL |= BIT7; // P2.7 CLK