⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 its_board.c

📁 program show the communication of CC100-MSP430
💻 C
字号:
/***********************************************************************************
    Filename: ITS_board.c

    Copyright 2007 Texas Instruments, Inc.
***********************************************************************************/

#include "ITS_types.h"
#include "ITS_defs.h"
#include "ITS_digio.h"
#include "ITS_int.h"
#include "ITS_mcu.h"
#include "ITS_board.h"
#include "ITS_spi.h"
#include "ITS_uart.h"

//------------------------------------------------------------------------------
//  Global variables
//------------------------------------------------------------------------------

// The constants below define some of the I/O signals used by the board
// Port, pin number, pin bitmask, direction and initial value should be
// set in order to match the target hardware. Once defined, the pins are
// configured in ITSBoardInit() by calling ITSDigioConfig()

//const digioConfig pinLed1   = {1, 1, BIT1, HAL_DIGIO_OUTPUT, 0};
//const digioConfig pinLed2   = {2, 2, BIT2, HAL_DIGIO_OUTPUT, 0};
//const digioConfig pinLed4   = {5, 1, BIT1, HAL_DIGIO_OUTPUT, 0};
const digioConfig pinS1     = {2, 2, BIT2, HAL_DIGIO_INPUT,  0};
const digioConfig pinS2     = {2, 3, BIT3, HAL_DIGIO_INPUT,  0};
const digioConfig pinGDO0   = {1, 4, BIT4, HAL_DIGIO_INPUT,  0};
const digioConfig pinGDO2   = {1, 5, BIT5, HAL_DIGIO_INPUT,  0};


//------------------------------------------------------------------------------
//  void ITSBoardInit(void)
//
//  DESCRIPTION:
//    Set up board. Initialize MCU, configure I/O pins and user interfaces
//------------------------------------------------------------------------------
void ITSBoardInit(void)
{
    WDTCTL = WDTPW + WDTHOLD;
    BCSCTL2 |= DCOR;    
    //P1SEL |= 0xC0;
    //P2SEL |= 0x02;
    P2IFG = 0x00;
    P1IFG = 0x00;

  //  ITSDigioConfig(&pinLed1);
  //  ITSDigioConfig(&pinLed2);
  //  ITSDigioConfig(&pinLed4);
  //  ITSDigioConfig(&pinS1);
  //  ITSDigioConfig(&pinS2);
    ITSDigioConfig(&pinGDO0);
    ITSDigioConfig(&pinGDO2);
    
    ITSSpiInit(0);
    ITSUartInit(9600);
    //ITSIntOn();
  
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -