LPCOPEN and PINCON

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
2,704件の閲覧回数
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 件の賞賛
返信
1 解決策
2,232件の閲覧回数
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 件の賞賛
返信
2 返答(返信)
2,233件の閲覧回数
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 件の賞賛
返信
2,232件の閲覧回数
agustinbanchio
Contributor I

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

0 件の賞賛
返信