当前位置:编程学习 > 网站相关 >>

TI CC2541.h的头文件 for IAR

 print?/************************************************************************************************** 
 *                                        - ioCC2541.h - 
 * 
 * Header file with definitions for the Texas Instruments CC2541 low-power System-on-Chip: 
 * an 8051-based MCU with 2.4 GHz Bluetooth low energy RF transceiver, and up to 256 kB FLASH. 
 * 
 * This file supports the IAR Embedded Workbench for 8051. 
 * 
 ************************************************************************************************** 
 */ 
 
#ifndef IOCC2541_H 
#define IOCC2541_H 
 
/* ------------------------------------------------------------------------------------------------ 
 *                                      Compiler Abstraction 
 * ------------------------------------------------------------------------------------------------ 
 */ 
#ifdef __IAR_SYSTEMS_ICC__ 
#pragma language=extended 
#define SFR(name,addr)   __sfr   __no_init  volatile  unsigned char  name @ addr; 
#define SFRBIT(name, addr, bit7, bit6, bit5, bit4, bit3, bit2, bit1, bit0) \ 
__sfr __no_init volatile union \ 
{                              \ 
  unsigned char name;          \ 
  struct {                     \ 
    unsigned char bit0 : 1;    \ 
    unsigned char bit1 : 1;    \ 
    unsigned char bit2 : 1;    \ 
    unsigned char bit3 : 1;    \ 
    unsigned char bit4 : 1;    \ 
    unsigned char bit5 : 1;    \ 
    unsigned char bit6 : 1;    \ 
    unsigned char bit7 : 1;    \ 
  };                           \ 
} @ addr; 
#define SBIT(name,addr) /* not in use for IAR C Compiler */ 
#define XREG(addr)       ((unsigned char volatile __xdata *) 0)[addr] 
#define PXREG(addr)      ((unsigned char volatile __xdata *) addr) 
#define VECT(num,addr)   addr 
 
#elif defined __IAR_SYSTEMS_ASM__ 
#define SFR(name,addr)   name  DEFINE  addr 
SFRBITMACRO MACRO t, addr, bit7 , bit6, bit5, bit4, bit3, bit2, bit1, bit0 
t    DEFINE addr 
bit7 DEFINE addr.7 
bit6 DEFINE addr.6 
bit5 DEFINE addr.5 
bit4 DEFINE addr.4    ;; NB: do not modify indentation of this macro 
bit3 DEFINE addr.3 
bit2 DEFINE addr.2 
bit1 DEFINE addr.1 
bit0 DEFINE addr.0 
            ENDM 
#define SFRBIT(name, addr, bit7, bit6, bit5, bit4, bit3, bit2, bit1, bit0) \ 
    SFRBITMACRO <name>, <addr>, <bit7>, <bit6>, <bit5>, <bit4>, <bit3>, <bit2>, <bit1>, <bit0> 
#define SBIT(name,addr)  name  DEFINE  addr 
#define XREG(addr)       addr 
#define PXREG(addr)      addr 
#define VECT(num,addr)   addr 
/* IAR assembler uses some predefined registers. The following prevents name collisions. */ 
#define SP   SPx 
#define ACC  ACCx 
#define B    Bx 
#define PSW  PSWx 
#define CY   CYx 
#define AC   ACx 
#define F0   F0x 
#define RS1  RS1x 
#define RS0  RS0x 
#define OV   OVx 
#define P    Px 
 
#else 
#error "Unrecognized compiler." 
#endif 
 
 
/* ------------------------------------------------------------------------------------------------ 
 *                                        Interrupt Vectors 
 * ------------------------------------------------------------------------------------------------ 
 */ 
#define  RFERR_VECTOR   VECT(  0, 0x03 )   /*  RF core error situation                     */ 
#define  ADC_VECTOR     VECT(  1, 0x0B )   /*  ADC end of conversion                       */ 
#define  URX0_VECTOR    VECT(  2, 0x13 )   /*  USART 0 RX complete                         */ 
#define  URX1_VECTOR    VECT(  3, 0x1B )   /*  USART 1 RX complete                         */ 
#define  ENC_VECTOR     VECT(  4, 0x23 )   /*  AES encryption/decryption complete          */ 
#define  ST_VECTOR      VECT(  5, 0x2B )   /*  Sleep Timer Compare                         */ 
#define  P2INT_VECTOR   VECT(  6, 0x33 )   /*  Port 2 Inputs and I2C                       */ 
#define  UTX0_VECTOR    VECT(  7, 0x3B )   /*  USART0 TX Complete                          */ 
#define  DMA_VECTOR     VECT(  8, 0x43 )   /*  DMA Transfer Complete            &nb

补充:综合编程 , 其他综合 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,