简体   繁体   English

在哪里可以找到MSP430G2553的链接器命令文件?

[英]Where can I find the linker command file for the MSP430G2553?

I'm using the MSPGCC to compile and link my programs. 我正在使用MSPGCC来编译和链接我的程序。 I'd like to see how the hardware addresses are assigned in the linker command file. 我想看看如何在链接器命令文件中分配硬件地址。 Inside the header file for my device I found these lines: 在我的设备的头文件中,我找到了这些行:

/* External references resolved by a device-specific linker command file */
#define SFR_8BIT(address)   extern volatile unsigned char address
#define SFR_16BIT(address)  extern volatile unsigned int address

Further on in the file I found lines like this under the GPIO section: 在文件的后面我在GPIO部分找到了这样的行:

SFR_8BIT(P1IN);                               /* Port 1 Input */
SFR_8BIT(P1OUT);                              /* Port 1 Output */
SFR_8BIT(P1DIR);                              /* Port 1 Direction */
SFR_8BIT(P1IFG);                              /* Port 1 Interrupt Flag */

What I'd like to see is how P1IN is defined. 我想看到的是如何定义P1IN。 I'm trying to get a better understanding of what it is so I can use it. 我试图更好地了解它是什么,所以我可以使用它。

I realize it can be used like this: 我意识到它可以像这样使用:

P1OUT &= 0xF7; // clear bit 3

I'd like to find the linker file so I can better understand how the address is being assigned. 我想找到链接器文件,以便我可以更好地理解如何分配地址。 I know I can just look at the data sheet to see what it is, but I'd like to know how the linker is finding it. 我知道我可以查看数据表以查看它是什么,但我想知道链接器是如何找到它的。

They are defined in the file msp430g2553.cmd . 它们在文件msp430g2553.cmd中定义。

/************************************************************
* DIGITAL I/O Port1/2 Pull up / Pull down Resistors
************************************************************/
P1IN               = 0x0020;
P1OUT              = 0x0021;
...

PS: I'm using CCS. PS:我正在使用CCS。 The file is located at path\\to\\ccs\\ccs_base\\msp430\\include along with the header file msp430g2553.h . 该文件位于path\\to\\ccs\\ccs_base\\msp430\\include以及头文件msp430g2553.h

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM