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

📄 hal_board.h

📁 msp430与cc2500无线收发器通讯的底层硬件配置
💻 H
字号:
/******************************************************************************
    Filename: hal_board.h

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

#ifndef HAL_BOARD_H
#define HAL_BOARD_H

#include "hal_types.h"
#include "hal_defs.h"
#include "hal_digio.h"

//----------------------------------------------------------------------------------
// This is where you include the header file defining all of the registers
// for your specific microcontroller.
//----------------------------------------------------------------------------------
#include <msp430x16x.h>
#include "hal_msp430.h"


//----------------------------------------------------------------------------------
//  Easy access, zero overhead LED macros
//  Adapted to hardware interface on MSP430 Experimenter Board
//----------------------------------------------------------------------------------
#define HAL_LED_SET_0   (P1OUT |= BIT0)
#define HAL_LED_SET_1   (P1OUT |= BIT1)
#define HAL_LED_SET_2   (P1OUT |= BIT2)
#define HAL_LED_SET_3   (P1OUT |= BIT3)
#define HAL_LED_SET_4   (P1OUT |= BIT4)
#define HAL_LED_SET_5   (P1OUT |= BIT5)
#define HAL_LED_SET_6   (P1OUT |= BIT6)
#define HAL_LED_SET_7   (P1OUT |= BIT7)

#define HAL_LED_CLR_0   (P1OUT &= ~BIT0)
#define HAL_LED_CLR_1   (P1OUT &= ~BIT1)
#define HAL_LED_CLR_2   (P1OUT &= ~BIT2)
#define HAL_LED_CLR_3   (P1OUT &= ~BIT3)
#define HAL_LED_CLR_4   (P1OUT &= ~BIT4)
#define HAL_LED_CLR_5   (P1OUT &= ~BIT5)
#define HAL_LED_CLR_6   (P1OUT &= ~BIT6)
#define HAL_LED_CLR_7   (P1OUT &= ~BIT7)

#define HAL_LED_TGL_0   (P1OUT ^= BIT0)
#define HAL_LED_TGL_1   (P1OUT ^= BIT1)
#define HAL_LED_TGL_2   (P1OUT ^= BIT2)
#define HAL_LED_TGL_3   (P1OUT ^= BIT3)
#define HAL_LED_TGL_4   (P1OUT ^= BIT4)
#define HAL_LED_TGL_5   (P1OUT ^= BIT5)
#define HAL_LED_TGL_6   (P1OUT ^= BIT6)
#define HAL_LED_TGL_7   (P1OUT ^= BIT7)



//----------------------------------------------------------------------------------
//  Port and pin where GDO0 and GDO2 from CC1100/CC2500 are connected
//----------------------------------------------------------------------------------
#define HAL_IO_GDO0_PORT  5
#define HAL_IO_GDO0_PIN   4
#define HAL_IO_GDO2_PORT  5
#define HAL_IO_GDO2_PIN   5


//----------------------------------------------------------------------------------
//  Define ports and pins used by SPI interface to CC1100/CC2500
//----------------------------------------------------------------------------------
#define HAL_SPI_SOMI_PORT 5
#define HAL_SPI_SOMI_PIN  2
#define HAL_SPI_SIMO_PORT 5
#define HAL_SPI_SIMO_PIN  1
#define HAL_SPI_CLK_PORT  5
#define HAL_SPI_CLK_PIN   3
#define HAL_SPI_CS_PORT   5
#define HAL_SPI_CS_PIN    0

//----------------------------------------------------------------------------------
// Select interface on MSP430 to use for SPI (define only one!)
//----------------------------------------------------------------------------------

// #define HAL_SPI_INTERFACE_USART0
#define HAL_SPI_INTERFACE_USART1
// #define HAL_SPI_INTERFACE_USCIA0
// #define HAL_SPI_INTERFACE_USCIA1
// #define HAL_SPI_INTERFACE_USCIB0
// #define HAL_SPI_INTERFACE_USCIB1
// #define HAL_SPI_INTERFACE_USI
// #define HAL_SPI_INTERFACE_BITBANG



#ifdef __cplusplus
extern "C" {
#endif

extern const digioConfig pinLed0;
extern const digioConfig pinLed1;
extern const digioConfig pinLed2;
extern const digioConfig pinLed3;
extern const digioConfig pinLed4;
extern const digioConfig pinLed5;
extern const digioConfig pinLed6;
extern const digioConfig pinLed7;

extern const digioConfig pinS1;
extern const digioConfig pinS2;

extern const digioConfig pinGDO0;
extern const digioConfig pinGDO2;



//----------------------------------------------------------------------------------
// Function declarations
//----------------------------------------------------------------------------------

void halBoardInit(void);


#ifdef __cplusplus
}
#endif

/**********************************************************************************/
#endif

⌨️ 快捷键说明

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