0
\$\begingroup\$

I'm starting with ARM and I program in C for LPC1768.

I included "LPC17xx.h". It gives registers names in C. But where are the names of bits?

For instance: I want to use UART. So first step: "In the PCONP register (Table46), set bits PCUART2".

Now I'm doing it this way: LPC_SC->PCONP |= (1 << 24);

But I want to do it this way: LPC_SC->PCONP |= (1 << PCUART2)

Now I have to look into lots of tables to see what are the numbers of bits. Is there any C header file that has all the definitions? Something like that: #define PCUART2 24 or similar.

(I know there are high level libraries with functions like "init_uart()" but I have to write it low)

asked Apr 9, 2015 at 15:31
\$\endgroup\$
2
  • \$\begingroup\$ If you can't find a header, just write it out. Can't take that long, and you only need to do it once. \$\endgroup\$ Commented Apr 9, 2015 at 15:36
  • \$\begingroup\$ I know I can write it :) I'm looking for it to save work, writing it from zero won't save me any time. And it would take long to go through all the tables.. \$\endgroup\$ Commented Apr 9, 2015 at 17:00

1 Answer 1

-1
\$\begingroup\$

Ok, I found anwser on another site. With this help, I created single header with defines. You can download it there: http://www.elektroda.pl/rtvforum/viewtopic.php?p=14606647#14606647

answered Apr 10, 2015 at 17:00
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.