Bugreport: LPCOpen 2.06 for LPC11E68 and 2.16 LPC11E68 configuration pin Interrupt

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

Bugreport: LPCOpen 2.06 for LPC11E68 and 2.16 LPC11E68 configuration pin Interrupt

342 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cappo85 on Tue Jul 07 05:38:31 MST 2015
I would like to report a bug in the file syscon_11n6x.c, function :

void Chip_SYSCTL_SetPinInterrupt(uint32_t intno, uint8_t port, uint8_t pin)
{
if (port == 0) {
/* Pins P0.1 to P0.23 only */
LPC_SYSCTL->PINTSEL[intno] = (uint32_t) pin;
}
else {
/* P1.1 to P1.31 and P2.0 to P2.7 */
LPC_SYSCTL->PINTSEL[intno] = (uint32_t) ((port -1)* 32 + pin);
}
}

is not correct.
The proposed solution is:

void Chip_SYSCTL_SetPinInterrupt(uint32_t intno, uint8_t port, uint8_t pin)
{
        switch(port)
        {
        case 0:
                LPC_SYSCTL->PINTSEL[intno] = (uint32_t) pin;
                break;
               
        case 1:
                LPC_SYSCTL->PINTSEL[intno] = (uint32_t) (24 + pin);
                break;
               
        case 2:
                LPC_SYSCTL->PINTSEL[intno] = (uint32_t) (56 + pin);
                break;

       default:
                break;
        }
}

Best regards
Riccardo Capponi
Labels (1)
0 Kudos
2 Replies

318 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cappo85 on Tue Jul 07 08:26:57 MST 2015
Thanks very much.

The implementation:

/* PIO0_0 [Offset: 0]; PIO1_0 [Offset: 24(0x18)]; PIO2_0 [Offset: 56(0x38)] */
#define PINTSEL_OFFSET "\0\x18\x38"

STATIC INLINE void Chip_SYSCTL_SetPinInterrupt(uint32_t intno, uint8_t port, uint8_t pin)
{
       LPC_SYSCTL->PINTSEL[intno] = (uint32_t) PINTSEL_OFFSET[port] + pin;
}

is terrific!!!!!!
Very fast.

Best Regards
Riccardo Capponi
0 Kudos

318 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Tue Jul 07 05:43:53 MST 2015
Another solution:

http://www.lpcware.com/content/forum/bug-lpcopen-206-lpc11u67
0 Kudos