Other Parts Discussed in Thread: SYSCONFIG
Hello, I want to implement the GPIO interrupt function on the R5F MCU of the main domain on TDA4VM. My version info is:
Linux: ti-processor-sdk-linux-j7-evm-08_02_00_03-Linux-x86-Install.bin
RTOS: ti-processor-sdk-rtos-j721e-evm-08_02_00_05.tar.gz
Question 1:
If the GPIO belongs to the main domain, how should I configure it?
Here I take GPIO0_99(w23) and GPIO0_100(W28) as examples, and make the following configuration:
Step 1: Generate the following configuration through sysconfig_gui:
/* MyGPIO1 -> GPIO0_99 -> W23 */
{
PIN_RGMII6_TD3, PIN_MODE(7) | ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & ~PIN_PULL_DIRECTION))
},
/* MyGPIO1 -> GPIO0_100 -> W28 */
{
PIN_RGMII6_TD2, PIN_MODE(7) | ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
},
Note: I added the above code to the rtos\pdk_jacinto_08_02_00_21\packages\ti\board\src\j721e_evm\J721E_pinmux_data.c file and made sure that the corresponding GPIO is not used by other peripherals.
Step 2: I configured the GPIO_PinConfig global variable:
#define TEST_GPIO_INT_FUN_W23 (99)
#define TEST_GPIO_INT_FUN_W28 (100)
typedef enum {
ENUM_TEST_GPIO_INT_FUN_W23=0,
ENUM_TEST_GPIO_INT_FUN_W28,
}BOARD_CAMERA_GPIO_CTL;
GPIO_PinConfig gpioPinConfigs[] =
{
GPIO_DEVICE_CONFIG(GPIO_MAIN_DOMAIN_0, TEST_GPIO_INT_FUN_W23) | GPIO_CFG_IN_INT_RISING | GPIO_CFG_INPUT,
GPIO_DEVICE_CONFIG(GPIO_MAIN_DOMAIN_0, TEST_GPIO_INT_FUN_W28) | GPIO_CFG_IN_INT_RISING | GPIO_CFG_INPUT,
};
GPIO_CallbackFxn gpioCallbackFunctions[] =
{
NULL,
NULL
};
GPIO_v0_Config GPIO_v0_config =
{
gpioPinConfigs,
gpioCallbackFunctions,
sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig),
sizeof(gpioCallbackFunctions) / sizeof(GPIO_CallbackFxn),
0x8U
};
void AppGpioCallbackFxn_W23(void)
{
printf("%s %s %d\n", __FILE__, __func__, __LINE__);
}
void AppGpioCallbackFxn_W28(void)
{
printf("%s %s %d\n", __FILE__, __func__, __LINE__);
}
Step 3: Call the API for initialization
Board_initCfg boardCfg;
boardCfg = BOARD_INIT_PINMUX_CONFIG | BOARD_INIT_UART_STDIO | BOARD_INIT_MODULE_CLOCK;
Board_init(boardCfg);
GPIO_init();
GPIO_setCallback(ENUM_TEST_GPIO_INT_FUN_W23, AppGpioCallbackFxn_W23);
GPIO_setCallback(ENUM_TEST_GPIO_INT_FUN_W28, AppGpioCallbackFxn_W28);
GPIO_enableInt(ENUM_TEST_GPIO_INT_FUN_W23);
GPIO_enableInt(ENUM_TEST_GPIO_INT_FUN_W28);
After completing the above steps, I gave a 25Hz PWM pulse to GPIO0_99(w23) and GPIO0_100(W28), but the corresponding GPIO interrupt did not respond. What is wrong with my configuration?
Question 2:
If the GPIO belongs to the wkup domain, how should I configure it?