lpcware

CMSIS GPIO driver - potential bug

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Marc Crandall on Wed Aug 03 14:13:01 MST 2011
Hello,

I wanted to let you know about a potential driver problem for the CMSIS GPIO LPC178x_8x.

In the file "lpc177x_8x_gpio.c"

I believe this function should be modified as follows. (Note the case 5 addition)

This took me a very long time to track down - hope this is useful to someone else.

(Note I sent this message to NXP support as well)

<code>
static LPC_GPIO_TypeDef *GPIO_GetPointer(uint8_t portNum)
{
LPC_GPIO_TypeDef *pGPIO = NULL;

switch (portNum)
{
case 0:
pGPIO = LPC_GPIO0;
break;

case 1:
pGPIO = LPC_GPIO1;
break;

case 2:
pGPIO = LPC_GPIO2;
break;

case 3:
pGPIO = LPC_GPIO3;
break;

case 4:
pGPIO = LPC_GPIO4;
break;

case 5:
pGPIO = LPC_GPIO5;
break;

default:
break;
}

return pGPIO;
}
</code>

Outcomes