lpc code routines

17 Apr 2014

I want to use direct port access such as LPC_IOCON->PIO1_13 = (0 | 1<<5 | 1<<4); to access and define some of the needed registers bits but im getting errors while I do as such in the mbed online compiler! I want to know can I use direct functions at all? If yes then how?

21 Apr 2014

Anyone?

21 Apr 2014

You probably get this error : Error: Class "LPC_IOCON_TypeDef" has no member "PIO1_13" in "main.cpp
This means you tried to use a pin that is not defined for the selected mcu.
Can you tell us what mcu you selected in the compiler or what mcu you want to use?

21 Apr 2014

I selected a LPC11u35 I think this pin is free!

21 Apr 2014

I tested it with an LPC11u24, and then it works fine, and they should share those registers.

21 Apr 2014

Erik,

can you post your code please! that working for you!

21 Apr 2014

#include "mbed.h" 


int main() {
    LPC_IOCON->PIO1_13 = (0 | 1<<5 | 1<<4); 
}

It compiles, and I believe it doesn't for you.

21 Apr 2014

Okay My bad I was trying to define it out of the main() funciton, it compiles fine now.