Hello
I try to implement an interrupt on eval board AM263 CC. The idea is if the button is pushed on the eval board , it should trigger an interrupt. I don't know why, but the interrupt for the gpio pin could not be registered in the interrupt table.
I could show you my port setup below:
static CONST( Port_PinConfigType, PORT_PBCFG) PortConfigSet_0_PinConfig[] = { { .Port_PinId = 21, .Port_PullInhibitEnable = PORT_PIN_PULL_INHIBIT_DEFAULT, .Port_OutputOverride_Ctrl = 2, .Port_InputOverride_Ctrl = 2, .Port_DirectionChangeable = FALSE, .Port_PinModeChangeable = TRUE, .Port_PinLevelValue = PORT_PIN_LEVEL_LOW, .Port_PinDirection = PORT_PIN_IN, .Port_PinInitialMode = PORT_PIN_MODE_GPIOAB, .Port_PullTypeSelect = PORT_PIN_PULLTYPE_DEFAULT, .Port_SlewControl = PORT_PIN_SLEWCONTROL_DEFAULT, .Port_NumPortModes = 1, .Port_PinMode = { [0] = { .mode = PORT_PIN_MODE_GPIOAB, .muxmode = 7, // PINA8_LIN2_TXD_GPIO_22, Dio_WriteChannel ID = 22 }, }, .Port_PinDioRegId = (1 - 1U), /* GPIO register index is 0 based */ .Port_PinDioChannelId = 21, .Port_RegOffsetAddr = PINB8_LIN2_RXD, .Port_PinSignalName = (const sint8 *)"GPIO_21", .Port_PinName = (const sint8 *)"PIN_B8", .Port_PinSetEdgeTrigger = FALSE, .Port_PinSelectEdgeTrigger = BOTH_EDGE, } }; /*<PORT_PIN_CONFIGURATION>*/ static CONST( Port_DioRegConfigType, PORT_PBCFG) PortConfigSet_0_DioConfig[] = { [0] = { .Port_DioRegId = (1 - 1U), /* Dio Register is 0 based index */ .Port_BankInterruptEnable = 3, }, [1] = { .Port_DioRegId = (2 - 1U), /* Dio Register is 0 based index */ .Port_BankInterruptEnable = 3, }, [2] = { .Port_DioRegId = (3 - 1U), /* Dio Register is 0 based index */ .Port_BankInterruptEnable = 3, }, [3] = { .Port_DioRegId = (4 - 1U), /* Dio Register is 0 based index */ .Port_BankInterruptEnable = 3, } };
in main this functions are called:
Port_Init(PortConfigSet_0_pt); vimInit(); BswTest_Dio_GPIO21InterruptSetup(); ////////////////end main static void BswTest_Dio_GPIO21InterruptSetup(void) { VIMRegs *ptrVIMRegs; uint32 groupIdx; uint32 bit; Vim_IntCfg intCfg; intCfg.map = VIM_INTTYPE_IRQ; intCfg.type = VIM_INTTRIGTYPE_LEVEL; /* * Register GPIO interrupt * */ intCfg.intNum = 142U;//GPIO_INT_XBAR_GPIO_0_BANK_INTR_1; intCfg.handler = BswTest_Dio_GPIO21InterruptHandler; intCfg.priority = VIM_PRIORITY_9; vimRegisterInterrupt(&intCfg); } static void BswTest_Dio_GPIO21InterruptHandler(void) { Dio_WriteChannel(DioConf_DioChannel_GPIOAB_Ch22, STD_HIGH); System_printf("you pushed the button/n"); }
It is actually a copy paste from mcal library 4.3.1 . Are there some thing wrong?
When the vimRegisterInterrupt(&intCfg); is executed, the enable bit for interrupt is not set top 1 .!!!
Could you also explain what is for .Port_BankInterruptEnable is the dio config ?
Thank you in advance