h> LPC17xx.h contains the following #define
h> #define LPC_GPIO1 ((LPC_GPIO_TypeDef *) LPC_GPIO1_BASE )
h> What is the meaning of " * " in this context. Multiplying
h> a type definition by a memory address has me mystified. Is it
h> possible * is the symbol meaning pointer in this context?
The following code snippet comes from an
example that came with a development board.
// Set GPIO - P1_24, P1_25, P1_28, P1_29 - to be outputs
LPC_GPIO1->FIODIR |= LED_ALL;
LPC17xx.h contains the following #define
#define LPC_GPIO1 ((LPC_GPIO_TypeDef *) LPC_GPIO1_BASE )
What is the meaning of " * " in this context. Multiplying
a type definition by a memory address has me mystified. Is it
possible * is the symbol meaning pointer in this context?
Are there any Web Sites that explain how to use a complicated
header file like LPC17xx.h? Usage examples are nice but I am
hoping to find something that speeds up the learning process.
Howard
The following information is provided for those who need to
see the full macro definitions.
The definition of LPC_GPIO_TypeDef is provided at the end
of this message. It was placed there because of its length and
it was interfering with the readability of this message.
LPC_GPI01_BASE is defined by the following #define in LPC17xx.h
#define LPC_GPIO1_BASE (LPC_GPIO_BASE + 0x00020)
LPC_GPIO_BASE is defined by the following #define in LPC17xx.h
#define LPC_GPIO_BASE (0x2009C000UL)
LED_ALL is defined by the following #define in
a .h header file that comes with the example.
#define LED_ALL (LED_2 | LED_3 | LED_4 | LED_5)
// LED_2, LED_3, LED_4 and LED_5 are defined as
// Led 2 is P1_24
#define LED_2 (1 << 24)
// Led 3 is P1_25
#define LED_3 (1 << 25)
// Led 4 is P1_28
#define LED_4 (1 << 28)
// Led 5 is P1_29
#define LED_5 (1 << 29)