LPCOPEN and PINCON

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPCOPEN and PINCON

Jump to solution
1,765 Views
agustinbanchio
Contributor I

I have an LPC1769 and been using LPCXpresso with cmsis and got used to using LPC_PINCON for (PINSEL and PINMODE) and LPC_GPIO0 and LPC_GPIO2 for port 0 and port 2 Fast input output. I need USB for a project I'm working on and the LPCOpen example works, but it doesn't have PINCON and GPIO functions that I had with CMSIS 1v30. If I try mixing the include statements many things get declared twice and there are lots of error while compiling. Is there a way to add this device specific functions to LPCOpen examples?

0 Kudos
1 Solution
1,293 Views
soledad
NXP Employee
NXP Employee

Hi,

You can use the Chip_GPIO_SetPinState function, for example:

void Board_LED_Set(uint8_t LEDNumber, bool On)
{
    if (LEDNumber == 0) {
        Chip_GPIO_SetPinState(LPC_GPIO_PORT, 1, 12, (bool) !On);
    }
    else if (LEDNumber == 1) {
        Chip_GPIO_SetPinState(LPC_GPIO_PORT, 1, 11, (bool) !On);
    }
}

Please check the following document:

How to create a new LPC project using LPCOpen and LPCXpresso 

Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
2 Replies
1,294 Views
soledad
NXP Employee
NXP Employee

Hi,

You can use the Chip_GPIO_SetPinState function, for example:

void Board_LED_Set(uint8_t LEDNumber, bool On)
{
    if (LEDNumber == 0) {
        Chip_GPIO_SetPinState(LPC_GPIO_PORT, 1, 12, (bool) !On);
    }
    else if (LEDNumber == 1) {
        Chip_GPIO_SetPinState(LPC_GPIO_PORT, 1, 11, (bool) !On);
    }
}

Please check the following document:

How to create a new LPC project using LPCOpen and LPCXpresso 

Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,293 Views
agustinbanchio
Contributor I

Thank you sole, I'll be reading about this functions, they seem pretty straight forward. Again thanks a lot.

0 Kudos