Include "LPC17xx.h" ?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Include "LPC17xx.h" ?

4,580 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ElectroNerd on Fri Sep 21 16:30:14 MST 2012
Hello,

I just migrated from 8-bit PIC MCUs to 32-bit ARMs and am having trouble understanding how to get started developing, specifically on including the "LPC17xx.h" header file for the LPCXpresso LPC1769 dev board.

I'm used to the fact that, with Microchip's MPLAB IDE, you navigate to the directory where default include files are and then select it to reference it in your current project directory. With the Code-Red IDE, what are the steps to include that header file?

Thanks in advance!

-P.S.- If there are any good tutorials you know of, please let me know!
0 项奖励
10 回复数

2,843 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sun Feb 24 06:30:59 MST 2013
J1939 is not included in CMSIS. Basic CAN functions are included in CAN samples, for a complete J1939 you need a library ;)
AFAIK there's no free J1939 library for LPC1769 :(, but googling can't hurt :)
0 项奖励

2,843 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tarik1985 on Sun Feb 24 05:58:13 MST 2013

Quote: kayoda
There are a lot of samples with LPC17 header files out there. Therefore CMSIS is a good idea :)


hello,
i seek the C function for J1939 communication in my LPC1769 board
thanks
0 项奖励

2,843 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ex-kayoda on Wed Sep 26 11:08:35 MST 2012
There are a lot of samples with LPC17 header files out there. Therefore CMSIS is a good idea :)
0 项奖励

2,843 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ElectroNerd on Wed Sep 26 10:56:31 MST 2012
Nvm
0 项奖励

2,843 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Sep 21 18:34:24 MST 2012

Quote:

It builds fine with the above statement...

No  :o

Compiler can't find this function , so it's warning you: "implicit declaration of function 'GPIO_SetDir'"  :eek:

Obviously this function is copied from somewhere else. If you find the source of this function you'll see that it's using register access as described in UM.

Therefore that's not included in C reference. Usually GPIO functions use LPC17xx.h structs to access registers :)
0 项奖励

2,843 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ElectroNerd on Fri Sep 21 17:39:43 MST 2012
OK, it turns out that I'm having trouble with the correct syntax of how to access the GPIO registers...

GPIO_SetDir(1, 0xB0000000, 1);           /* LEDs on PORT1 defined as Output    */


It builds fine with the above statement (although it gives me a warning: "implicit declaration of function 'GPIO_SetDir'") - is there a C reference manual for the C library names?
0 项奖励

2,843 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Sep 21 17:19:35 MST 2012
How to handle pins is described in Chapter 7: LPC17xx Pin configuration

http://www.nxp.com/documents/user_manual/UM10360.pdf


Quote:

I see that they include it in their lcd.c source file...but when I try that it can't find the header file.

Then your 'other project' doesn't include CMSIS or it's not opened in your workspace :confused:
0 项奖励

2,843 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ElectroNerd on Fri Sep 21 16:58:10 MST 2012
All I want to do is turn ON any I/O port I specify...how do I accomplish this?

My understanding:
[LIST]
[*]Configure I/O as input or output (presumably FIODIR)
[*]Set I/O pin on or off (presumably FIOSET)
[/LIST]

(What is the specifics on selecting just an individual pin?

Consider the [B]void leds_init(void) {...}[/B] function in "RDB1768cmsis2_LedStrobe" -> "lcd.c":

void leds_init (void)
{
// Set P1_24, P1_25, P1_28, P1_29 to 00 - GPIO
LPC_PINCON->PINSEL3&= (~0x0F0F0000);
// Set GPIO - P1_24, P1_25, P1_28, P1_29 - to be outputs
LPC_GPIO1->FIODIR |= LED_ALL;
}


[B]Note:[/B] I recognize this is for a different development board, but I think only the hardware changes.

When I include that into my other project it tells me it doesn't recognize the LPCGPIO1 term (it is in LPC17xx.h)! I see that they include it in their lcd.c source file...but when I try that it can't find the header file.

Also, I don't think I need to worry about LPC_PINCON; isn't that for the ethernet?

Thanks.

[B]EDIT:[/B] I was able to include the LPC17xx file by doing this:

#include "NXP/LPC17xx/LPC17xx.h"
0 项奖励

2,843 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ElectroNerd on Fri Sep 21 16:45:28 MST 2012
Actually, it looks like the "Includes" drop-list of my project already contains the LPC17xx header file automatically. Nevermind!

[B]EDIT[/B]: Ah, thanks Zero for the confirmation and resources.

That does seem over the top, though...I don't need to include ALL of the header files, just a couple.
0 项奖励

2,843 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Sep 21 16:43:34 MST 2012
Tutorials:

LPCXpresso Introduction part 1 training video
http://www.youtube.com/watch?v=dV7rG...feature=relmfu

LPCXpresso Introduction part 2 training video
http://www.youtube.com/watch?v=cLvGw...feature=relmfu

Learn Eclipse the LPCXpresso way - from the developers
http://www.youtube.com/watch?v=E6vSPloei-0

NXP LPCXpresso HomePage
http://ics.nxp.com/lpcxpresso/


Quote:

...on including the "LPC17xx.h" header file for the LPCXpresso LPC1769 dev board...

CMSIS should include it, so what are we talking about here  :confused: LPCXpresso standard project ?
0 项奖励