这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » MCU » MSP430操作(定义变量)

共1条 1/1 1 跳转至

MSP430操作(定义变量)

助工
2014-09-27 22:23:48     打赏
#i nclude <GLOBAL.h>
#i nclude <stdlib.h>
#i nclude <stdbool.h>
#i nclude <msp430x41x.h>

//------------------------------------------------------------------------------

#define SysPowerDirOut           P1DIR |=  BIT2
#define SysPowerClos             P1OUT |=  BIT2
#define SysPowerOpen             P1OUT &= ~BIT2

#define SysSclDirOut             P1DIR |=  BIT1
#define SysSclDirIn              P1DIR &=~ BIT1
#define SysSclHig                P1OUT |=  BIT1            
#define SysSclLow                P1OUT &=~ BIT1
#define SysScl                   BIT1
//------------------------------------------------------------------------------

#define CpuCardRstDirOut         P1DIR |=  BIT0
#define CpuCardRstDirIn          P1DIR &=~ BIT0
#define CpuCardRstHig            P1OUT |=  BIT0             
#define CpuCardRstLow            P1OUT &=~ BIT0

#define CpuCardSdaDirOut         P1DIR |=  BIT5 
#define CpuCardSdaDirIn          P1DIR &=~ BIT5
#define CpuCardSdaHig            P1OUT |=  BIT5             
#define CpuCardSdaLow            P1OUT &=~ BIT5
#define CpuCardSdaInSt           P1IN  &   BIT5 

//------------------------------------------------------------------------------

#define EasmChipRstDirOut        P6DIR |=  BIT0
#define EasmChipRstDirIn         P6DIR &=~ BIT0
#define EasmChipRstHig           P6OUT |=  BIT0             
#define EasmChipRstLow           P6OUT &=~ BIT0

#define EasmChipSdaDirOut        P6DIR |=  BIT1 
#define EasmChipSdaDirIn         P6DIR &=~ BIT1
#define EasmChipSdaHig           P6OUT |=  BIT1             
#define EasmChipSdaLow           P6OUT &=~ BIT1
#define EasmChipSdaInSt          P6IN  &   BIT1 

//------------------------------------------------------------------------------
#define CLA  0  
#define INS  1
#define P01  2
#define P02  3
#define P03  4
#define F01  5
#define F02  6

#define   CardChkDirSt        P1IN  &   BIT4
#define   CardChkDirIn        P1DIR &=~ BIT4
#define   CardChkSt         BIT4

 

 


共1条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]