This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

LPC23xx gpio code

Hello,
Can someone explain what it means??

#define IOPIN0 (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0x00))

The controller using is LPC23xx/24xx.

BR Chethan

Parents
  • Standard C pointer cast, telling the address of a volatile 32-bit register at a specific address that should be used with the name IOPIN0.

    So the address - as an integer - is said to be a pointer to volatile 32-bit unsigned, and the macro then does a pointer indirection to "follow" the pointer to allow you to either read or write that register.

    So bring out a decent book about the C language - or even better the language standard - and have a look at type declarations and type casts.

Reply
  • Standard C pointer cast, telling the address of a volatile 32-bit register at a specific address that should be used with the name IOPIN0.

    So the address - as an integer - is said to be a pointer to volatile 32-bit unsigned, and the macro then does a pointer indirection to "follow" the pointer to allow you to either read or write that register.

    So bring out a decent book about the C language - or even better the language standard - and have a look at type declarations and type casts.

Children