HI.
I'd like to use gpio1_11 as input IO in Vision_apps on mcu3_0.
And I want to detect the falling edge of gpio1_11 using interrupt routing.
I have referenced some e2e. and I implemented the code below.
void test_gpio_handler()
{
cnt++;
GPIO_clearInt(0);
}
static void SetRmIrqGPIO()
{
struct tisci_msg_rm_irq_set_req rmIrqReq;
struct tisci_msg_rm_irq_set_resp rmIrqResp;
memset(&rmIrqReq, 0x0, sizeof(rmIrqReq));
memset(&rmIrqResp, 0x0, sizeof(rmIrqResp));
rmIrqReq.valid_params = 0U;
rmIrqReq.global_event = 0U;
rmIrqReq.src_id = 0U;
rmIrqReq.src_index = 0U;
rmIrqReq.dst_id = 0U;
rmIrqReq.dst_host_irq = 0U;
rmIrqReq.ia_id = 0U;
rmIrqReq.vint = 0U;
rmIrqReq.vint_status_bit_index = 0U;
rmIrqReq.secondary_host = TISCI_MSG_VALUE_RM_UNUSED_SECONDARY_HOST;
rmIrqReq.secondary_host = TISCI_MSG_VALUE_RM_UNUSED_SECONDARY_HOST;
rmIrqReq.src_id = TISCI_DEV_GPIOMUX_INTRTR0;
rmIrqReq.src_index = 11; //Need to add 128 for GPIO1
/* Set the destination based on the core */
rmIrqReq.dst_id = TISCI_DEV_GPIOMUX_INTRTR0; //TISCI_DEV_R5FSS1_CORE0;
rmIrqReq.dst_host_irq = 16; //don't know how to set this
/* Set the destination interrupt */
rmIrqReq.valid_params |= TISCI_MSG_VALUE_RM_DST_ID_VALID;
rmIrqReq.valid_params |= TISCI_MSG_VALUE_RM_DST_HOST_IRQ_VALID;
Sciclient_rmIrqSet(
(const struct tisci_msg_rm_irq_set_req *)&rmIrqReq,
&rmIrqResp,
SCICLIENT_SERVICE_WAIT_FOREVER);
}
static void GPIO_configIntRouter(uint32_t portNum, uint32_t pinNum, uint32_t gpioIntRtrOutIntNum, GPIO_v0_HwAttrs *cfg)
{
GPIO_IntCfg *intCfg;
uint32_t bankNum = 0U;
intCfg = cfg->intCfg;
cfg->baseAddr = 0x601000UL;
bankNum = pinNum/16; /* Each GPIO bank has 16 pins */
intCfg[pinNum].intNum = 176 + bankNum; //CSLR_R5FSS1_CORE0_INTR_GPIOMUX_INTRTR0_OUTP_16
intCfg[pinNum].intcMuxNum = INVALID_INTC_MUX_NUM;
intCfg[pinNum].intcMuxInEvent = 0;
intCfg[pinNum].intcMuxOutEvent = 0;
}
void gpio_ecap_init(void)
{
GPIO_v0_HwAttrs gpio_cfg;
Board_moduleClockEnable(TISCI_DEV_GPIO1);
GPIO_socGetInitCfg(0, &gpio_cfg); //
gpio_cfg.baseAddr = 0x601000UL;
GPIO_configIntRouter(1, 11, 0, &gpio_cfg);
CSL_REG32_WR(CSL_CTRL_MMR0_CFG0_BASE + CSL_MAIN_CTRL_MMR_CFG0_PADCONFIG140, 0x0050007);
GPIO_socSetInitCfg(0, &gpio_cfg);
GPIO_setCallback(0, test_gpio_handler);
GPIO_init();
SetRmIrqGPIO();
GPIO_setCallback(0, test_gpio_handler);
GPIO_enableInt(0);
GPIO_clearInt(0);
}
After gpio setting, I confirmed that the GPIO read value was changing.
But the gpio interrupt handler doesn't work.
Is dst_host_irq correct?
how to work the gpio handler?