📄 msp430x44x.h
字号:
#define SVSFG (0x01) /* SVS Flag */
#define SVSOP (0x02) /* SVS output (read only) */
#define SVSON (0x04) /* Switches the SVS on/off */
#define PORON (0x08) /* Enable POR Generation if Low Voltage */
#define VLDON (0x10)
#define VLDOFF (0x00)
#define VLD_1_8V (0x10)
/************************************************************
* LCD
************************************************************/
#define LCDCTL_ (0x0090) /* LCD Control */
DEFC( LCDCTL , LCDCTL_)
/* the names of the mode bits are different from the spec */
#define LCDON (0x01)
//#define LCDLOWR (0x02)
#define LCDSON (0x04)
#define LCDMX0 (0x08)
#define LCDMX1 (0x10)
#define LCDP0 (0x20)
#define LCDP1 (0x40)
#define LCDP2 (0x80)
/* Display modes coded with Bits 2-4 */
#define LCDSTATIC (LCDSON)
#define LCD2MUX (LCDMX0+LCDSON)
#define LCD3MUX (LCDMX1+LCDSON)
#define LCD4MUX (LCDMX1+LCDMX0+LCDSON)
/* Group select code with Bits 5-7 Seg.lines Dig.output */
#define LCDSG0 (0x00) /* --------- Port Only (default) */
#define LCDSG0_1 (LCDP0) /* S0 - S15 see Datasheet */
#define LCDSG0_2 (LCDP1) /* S0 - S19 see Datasheet */
#define LCDSG0_3 (LCDP1+LCDP0) /* S0 - S23 see Datasheet */
#define LCDSG0_4 (LCDP2) /* S0 - S27 see Datasheet */
#define LCDSG0_5 (LCDP2+LCDP0) /* S0 - S31 see Datasheet */
#define LCDSG0_6 (LCDP2+LCDP1) /* S0 - S35 see Datasheet */
#define LCDSG0_7 (LCDP2+LCDP1+LCDP0) /* S0 - S39 see Datasheet */
/* NOTE: YOU CAN ONLY USE THE 'S' OR 'G' DECLARATIONS FOR A COMMAND */
/* MOV #LCDSG0_3+LCDOG2_7,&LCDCTL ACTUALY MEANS MOV #LCDP1,&LCDCTL! */
#define LCDOG1_7 (0x00) /* --------- Port Only (default) */
#define LCDOG2_7 (LCDP0) /* S0 - S15 see Datasheet */
#define LCDOG3_7 (LCDP1) /* S0 - S19 see Datasheet */
#define LCDOG4_7 (LCDP1+LCDP0) /* S0 - S23 see Datasheet */
#define LCDOG5_7 (LCDP2) /* S0 - S27 see Datasheet */
#define LCDOG6_7 (LCDP2+LCDP0) /* S0 - S31 see Datasheet */
#define LCDOG7 (LCDP2+LCDP1) /* S0 - S35 see Datasheet */
#define LCDOGOFF (LCDP2+LCDP1+LCDP0) /* S0 - S39 see Datasheet */
#define LCDMEM_ (0x0091) /* LCD Memory */
#ifndef __IAR_SYSTEMS_ICC
#define LCDMEM (LCDMEM_) /* LCD Memory (for assembler) */
#else
#define LCDMEM ((char*) LCDMEM_) /* LCD Memory (for C) */
#endif
#define LCDM1_ (0x0091) /* LCD Memory 1 */
DEFC( LCDM1 , LCDM1_)
#define LCDM2_ (0x0092) /* LCD Memory 2 */
DEFC( LCDM2 , LCDM2_)
#define LCDM3_ (0x0093) /* LCD Memory 3 */
DEFC( LCDM3 , LCDM3_)
#define LCDM4_ (0x0094) /* LCD Memory 4 */
DEFC( LCDM4 , LCDM4_)
#define LCDM5_ (0x0095) /* LCD Memory 5 */
DEFC( LCDM5 , LCDM5_)
#define LCDM6_ (0x0096) /* LCD Memory 6 */
DEFC( LCDM6 , LCDM6_)
#define LCDM7_ (0x0097) /* LCD Memory 7 */
DEFC( LCDM7 , LCDM7_)
#define LCDM8_ (0x0098) /* LCD Memory 8 */
DEFC( LCDM8 , LCDM8_)
#define LCDM9_ (0x0099) /* LCD Memory 9 */
DEFC( LCDM9 , LCDM9_)
#define LCDM10_ (0x009A) /* LCD Memory 10 */
DEFC( LCDM10 , LCDM10_)
#define LCDM11_ (0x009B) /* LCD Memory 11 */
DEFC( LCDM11 , LCDM11_)
#define LCDM12_ (0x009C) /* LCD Memory 12 */
DEFC( LCDM12 , LCDM12_)
#define LCDM13_ (0x009D) /* LCD Memory 13 */
DEFC( LCDM13 , LCDM13_)
#define LCDM14_ (0x009E) /* LCD Memory 14 */
DEFC( LCDM14 , LCDM14_)
#define LCDM15_ (0x009F) /* LCD Memory 15 */
DEFC( LCDM15 , LCDM15_)
#define LCDM16_ (0x00A0) /* LCD Memory 16 */
DEFC( LCDM16 , LCDM16_)
#define LCDM17_ (0x00A1) /* LCD Memory 17 */
DEFC( LCDM17 , LCDM17_)
#define LCDM18_ (0x00A2) /* LCD Memory 18 */
DEFC( LCDM18 , LCDM18_)
#define LCDM19_ (0x00A3) /* LCD Memory 19 */
DEFC( LCDM19 , LCDM19_)
#define LCDM20_ (0x00A4) /* LCD Memory 20 */
DEFC( LCDM20 , LCDM20_)
#define LCDMA (LCDM10) /* LCD Memory A */
#define LCDMB (LCDM11) /* LCD Memory B */
#define LCDMC (LCDM12) /* LCD Memory C */
#define LCDMD (LCDM13) /* LCD Memory D */
#define LCDME (LCDM14) /* LCD Memory E */
#define LCDMF (LCDM15) /* LCD Memory F */
/************************************************************
* USART
************************************************************/
/* UxCTL */
#define PENA (0x80) /* Parity enable */
#define PEV (0x40) /* Parity 0:odd / 1:even */
#define SPB (0x20) /* Stop Bits 0:one / 1: two */
#define CHAR (0x10) /* Data 0:7-bits / 1:8-bits */
#define LISTEN (0x08) /* Listen mode */
#define SYNC (0x04) /* UART / SPI mode */
#define MM (0x02) /* Master Mode off/on */
#define SWRST (0x01) /* USART Software Reset */
/* UxTCTL */
#define CKPH (0x80) /* SPI: Clock Phase */
#define CKPL (0x40) /* Clock Polarity */
#define SSEL1 (0x20) /* Clock Source Select 1 */
#define SSEL0 (0x10) /* Clock Source Select 0 */
#define URXSE (0x08) /* Receive Start edge select */
#define TXWAKE (0x04) /* TX Wake up mode */
#define STC (0x02) /* SPI: STC enable 0:on / 1:off */
#define TXEPT (0x01) /* TX Buffer empty */
/* UxRCTL */
#define FE (0x80) /* Frame Error */
#define PE (0x40) /* Parity Error */
#define OE (0x20) /* Overrun Error */
#define BRK (0x10) /* Break detected */
#define URXEIE (0x08) /* RX Error interrupt enable */
#define URXWIE (0x04) /* RX Wake up interrupt enable */
#define RXWAKE (0x02) /* RX Wake up detect */
#define RXERR (0x01) /* RX Error Error */
/************************************************************
* USART 0
************************************************************/
#define U0CTL_ (0x0070) /* USART 0 Control */
DEFC( U0CTL , U0CTL_)
#define U0TCTL_ (0x0071) /* USART 0 Transmit Control */
DEFC( U0TCTL , U0TCTL_)
#define U0RCTL_ (0x0072) /* USART 0 Receive Control */
DEFC( U0RCTL , U0RCTL_)
#define U0MCTL_ (0x0073) /* USART 0 Modulation Control */
DEFC( U0MCTL , U0MCTL_)
#define U0BR0_ (0x0074) /* USART 0 Baud Rate 0 */
DEFC( U0BR0 , U0BR0_)
#define U0BR1_ (0x0075) /* USART 0 Baud Rate 1 */
DEFC( U0BR1 , U0BR1_)
#define U0RXBUF_ (0x0076) /* USART 0 Receive Buffer */
READ_ONLY DEFC( U0RXBUF , U0RXBUF_)
#define U0TXBUF_ (0x0077) /* USART 0 Transmit Buffer */
DEFC( U0TXBUF , U0TXBUF_)
/* Alternate register names */
#define UCTL0 U0CTL /* USART 0 Control */
#define UTCTL0 U0TCTL /* USART 0 Transmit Control */
#define URCTL0 U0RCTL /* USART 0 Receive Control */
#define UMCTL0 U0MCTL /* USART 0 Modulation Control */
#define UBR00 U0BR0 /* USART 0 Baud Rate 0 */
#define UBR10 U0BR1 /* USART 0 Baud Rate 1 */
#define RXBUF0 U0RXBUF /* USART 0 Receive Buffer */
#define TXBUF0 U0TXBUF /* USART 0 Transmit Buffer */
#define UCTL0_ U0CTL_ /* USART 0 Control */
#define UTCTL0_ U0TCTL_ /* USART 0 Transmit Control */
#define URCTL0_ U0RCTL_ /* USART 0 Receive Control */
#define UMCTL0_ U0MCTL_ /* USART 0 Modulation Control */
#define UBR00_ U0BR0_ /* USART 0 Baud Rate 0 */
#define UBR10_ U0BR1_ /* USART 0 Baud Rate 1 */
#define RXBUF0_ U0RXBUF_ /* USART 0 Receive Buffer */
#define TXBUF0_ U0TXBUF_ /* USART 0 Transmit Buffer */
#define UCTL_0 U0CTL /* USART 0 Control */
#define UTCTL_0 U0TCTL /* USART 0 Transmit Control */
#define URCTL_0 U0RCTL /* USART 0 Receive Control */
#define UMCTL_0 U0MCTL /* USART 0 Modulation Control */
#define UBR0_0 U0BR0 /* USART 0 Baud Rate 0 */
#define UBR1_0 U0BR1 /* USART 0 Baud Rate 1 */
#define RXBUF_0 U0RXBUF /* USART 0 Receive Buffer */
#define TXBUF_0 U0TXBUF /* USART 0 Transmit Buffer */
#define UCTL_0_ U0CTL_ /* USART 0 Control */
#define UTCTL_0_ U0TCTL_ /* USART 0 Transmit Control */
#define URCTL_0_ U0RCTL_ /* USART 0 Receive Control */
#define UMCTL_0_ U0MCTL_ /* USART 0 Modulation Control */
#define UBR0_0_ U0BR0_ /* USART 0 Baud Rate 0 */
#define UBR1_0_ U0BR1_ /* USART 0 Baud Rate 1 */
#define RXBUF_0_ U0RXBUF_ /* USART 0 Receive Buffer */
#define TXBUF_0_ U0TXBUF_ /* USART 0 Transmit Buffer */
/************************************************************
* USART 1
************************************************************/
#define U1CTL_ (0x0078) /* USART 1 Control */
DEFC( U1CTL , U1CTL_)
#define U1TCTL_ (0x0079) /* USART 1 Transmit Control */
DEFC( U1TCTL , U1TCTL_)
#define U1RCTL_ (0x007A) /* USART 1 Receive Control */
DEFC( U1RCTL , U1RCTL_)
#define U1MCTL_ (0x007B) /* USART 1 Modulation Control */
DEFC( U1MCTL , U1MCTL_)
#define U1BR0_ (0x007C) /* USART 1 Baud Rate 0 */
DEFC( U1BR0 , U1BR0_)
#define U1BR1_ (0x007D) /* USART 1 Baud Rate 1 */
DEFC( U1BR1 , U1BR1_)
#define U1RXBUF_ (0x007E) /* USART 1 Receive Buffer */
READ_ONLY DEFC( U1RXBUF , U1RXBUF_)
#define U1TXBUF_ (0x007F) /* USART 1 Transmit Buffer */
DEFC( U1TXBUF , U1TXBUF_)
/* Alternate register names */
#define UCTL1 U1CTL /* USART 1 Control */
#define UTCTL1 U1TCTL /* USART 1 Transmit Control */
#define URCTL1 U1RCTL /* USART 1 Receive Control */
#define UMCTL1 U1MCTL /* USART 1 Modulation Control */
#define UBR01 U1BR0 /* USART 1 Baud Rate 0 */
#define UBR11 U1BR1 /* USART 1 Baud Rate 1 */
#define RXBUF1 U1RXBUF /* USART 1 Receive Buffer */
#define TXBUF1 U1TXBUF /* USART 1 Transmit Buffer */
#define UCTL1_ U1CTL_ /* USART 1 Control */
#define UTCTL1_ U1TCTL_ /* USART 1 Transmit Control */
#define URCTL1_ U1RCTL_ /* USART 1 Receive Control */
#define UMCTL1_ U1MCTL_ /* USART 1 Modulation Control */
#define UBR01_ U1BR0_ /* USART 1 Baud Rate 0 */
#define UBR11_ U1BR1_ /* USART 1 Baud Rate 1 */
#define RXBUF1_ U1RXBUF_ /* USART 1 Receive Buffer */
#define TXBUF1_ U1TXBUF_ /* USART 1 Transmit Buffer */
#define UCTL_1 U1CTL /* USART 1 Control */
#define UTCTL_1 U1TCTL /* USART 1 Transmit Control */
#define URCTL_1 U1RCTL /* USART 1 Receive Control */
#define UMCTL_1 U1MCTL /* USART 1 Modulation Control */
#define UBR0_1 U1BR0 /* USART 1 Baud Rate 0 */
#define UBR1_1 U1BR1 /* USART 1 Baud Rate 1 */
#define RXBUF_1 U1RXBUF /* USART 1 Receive Buffer */
#define TXBUF_1 U1TXBUF /* USART 1 Transmit Buffer */
#define UCTL_1_ U1CTL_ /* USART 1 Control */
#define UTCTL_1_ U1TCTL_ /* USART 1 Transmit Control */
#define URCTL_1_ U1RCTL_ /* USART 1 Receive Control */
#define UMCTL_1_ U1MCTL_ /* USART 1 Modulation Control */
#define UBR0_1_ U1BR0_ /* USART 1 Baud Rate 0 */
#define UBR1_1_ U1BR1_ /* USART 1 Baud Rate 1 */
#define RXBUF_1_ U1RXBUF_ /* USART 1 Receive Buffer */
#define TXBUF_1_ U1TXBUF_ /* USART 1 Transmit Buffer */
/************************************************************
* Timer A3
************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -