Part Number:AM5708
设置GPIO4_4(LED0)的中断来使LED1亮,使用GPIOTriggerPinInt来触发,但是运行完这行触发不了中断,下面是我的代码
/* XDCtools Header files */
#include <xdc/std.h>
#include <xdc/cfg/global.h>
#include <xdc/runtime/System.h>
#include <xdc/runtime/Error.h>
/* BIOS Header files */
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <stdio.h>
/* TI-RTOS Header files */
#include <ti/drv/gpio/GPIO.h>
#include <ti/drv/gpio/soc/GPIO_soc.h>
/* UART Header files */
#include <ti/drv/uart/UART.h>
#include <ti/drv/uart/UART_stdio.h>
#include <ti/drv/uart/test/src/UART_board.h>
#include <ti/board/board.h>
#include <ti/csl/soc.h>
#include <ti/csl/soc/am572x/src/cslr_control_core_pad_io.h>
#include <ti/board/src/evmAM572x/include/evmam572x_pinmux.h>
/**********************************************************************
************************** Macros ************************************
**********************************************************************/
#define GPIO_PIN_VAL_LOW(0U)
#define GPIO_PIN_VAL_HIGH(1U)
#define GPIO_USER0_LED_PIN_NUM(0x04U)
#define GPIO_USER0_LED_PORT_NUM(0x04)/* user-led0, gpio4_4 */
#define GPIO_USER1_LED_PIN_NUM(0x04U)
#define GPIO_USER1_LED_PORT_NUM(0x05)/* user-led1, gpio5_4 */
#define GPIO_USER2_LED_PIN_NUM(0x05U)
#define GPIO_USER2_LED_PORT_NUM(0x05)/* user-led2, gpio5_5 */
/**********************************************************************
************************** Internal functions ************************
**********************************************************************/
/* GPIO Driver board specific pin configuration structure */
GPIO_PinConfig gpioPinConfigs[] = {GPIO_DEVICE_CONFIG(GPIO_USER0_LED_PORT_NUM, GPIO_USER0_LED_PIN_NUM) | GPIO_CFG_INPUT | GPIO_CFG_IN_INT_RISING,GPIO_DEVICE_CONFIG(GPIO_USER1_LED_PORT_NUM,GPIO_USER1_LED_PIN_NUM) | GPIO_CFG_OUTPUT
};
void myfunc(void)
{static int count = 0;count ++;GPIO_write(1, GPIO_PIN_VAL_HIGH);
}
GPIO_CallbackFxn gpioCallbackFunctions[] = {myfunc,
};
/* GPIO Driver configuration structure */
GPIO_v1_Config GPIO_v1_config = {gpioPinConfigs,gpioCallbackFunctions,sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig),sizeof(gpioCallbackFunctions) / sizeof(GPIO_CallbackFxn),0x20,
};
/*
* ======== main ========
*/
int main(void)
{uint32_t regVal = 0;//count = 1;/* Call board_init functions */GPIO_init();CSL_FINS(regVal, CONTROL_CORE_PAD_IO_PAD_VIN2A_D3_VIN2A_D3_MUXMODE, 0xEU);((CSL_padRegsOvly) CSL_MPU_CORE_PAD_IO_REGISTERS_REGS)->PAD_VIN2A_D3 = regVal;/* vin2a_d3.gpio4_4(user_led0) *///GPIO_setCallback(0, myfunc);/* Enable GPIO interrupt on the specific gpio pin */GPIO_enableInt(0);GPIO_write(1, GPIO_PIN_VAL_HIGH);//GPIO_write(1, GPIO_PIN_VAL_HIGH);//GPIO_toggle(0);GPIOTriggerPinInt(CSL_IPU_GPIO4_REGS,0,0x4);// GPIO_write(1, GPIO_PIN_VAL_LOW);//BIOS_start();return (0);
}
Daniel:
您好
https://e2echina.ti.com/support/processors/f/processors-forum/209124/am5708-pdk-drv-gpio
官方这个帖子有相关说明。
https://www.ti2k.com/wp-content/uploads/ti2k/DeyiSupport_DSP_index_how_to_guides.html
官方SDK说明中有关于中断配置说明并有相关代码。请您参考。
https://www.ti.com.cn/tool/PROCESSOR-SDK-AM57X
这是官方针对于IC的相关文件。
TI中文支持网

![TMS320F28379D: 导入例程出现故障Description Resource Path Location Type gmake: *** [gridconnectedinvlclfltr.obj] Error 1 gridConnectedInverterLCLFltr C/C++ Problem-TI中文支持网](https://www.ti2k.com/wp-content/uploads/ti2k/DeyiSupport_C2000_pastedimage1752114958744v1.jpg)

