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)
-
\$\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\$R Drast– R Drast2015年04月09日 15:36:40 +00:00Commented 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\$zupazt3– zupazt32015年04月09日 17:00:18 +00:00Commented Apr 9, 2015 at 17:00
1 Answer 1
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