工具/软件:TI-RTOS
大家好
在 TMDSEVM6657L (出厂设置、引脚 GPIO-14和 GPIO-26之间的快捷方式除外)上、我尝试对程序(CCS7)进行编码、其中:
- 定时器在 GPIO-14上产生一个周期为1秒的方波脉冲序列
- GPIO-26配置为输入、它应该在引脚 GPIO-15上产生一个中断、并且它的 ISR 输出一个第二个方波脉冲
第一部分正常工作(计时器及其中断每半秒一次)。 第二个没有。 我包含了整个项目的 zip 文件(请参阅下文)。
e2e.ti.com/.../cic0_5F00_isr.zip
我的印象是、我在函数内做了一些错误:
void cic0_config_GPIO_IRQ (int int_vec、int host_int_num、int gpio_pin、void (* ISR)(UARg))
{
uint32_t hwi_status = hwi_disable();
CpIntc_disableAllHostIntts (cic0); //一次性禁用 CIC0
CpIntc_clearSysInt( cic0、input_event_num ); //清除现有事件标志并启用它。
CpIntc_mapSysIntToHostInt( cic0、input_event_num、host_int_num ); //将系统事件映射到主机中断
CpIntc_dispatchPlug( input_event_num、isr、input_event_num、true ); //为 INPUT_EVENT_num 注册 ISR。
int EventID = CpIntc_getEventId( host_int_num ); //将 CorePac
EventCombiner_dispatchPlug( EventID、CpIntc_dispatch、host_int_num、true )的主机中断转换为事件;//注册 CpIntc 调度
程序 Hwi_Params_init (&hwi_params); //初始化 Hwi 参数。
Hwi_params.EventID = EventID / 32; // EventCombiner 期望0 <= EventID <= 3。
Hwi_params.arg = hwi_params.EventID;
hwi_params.enableInt = true;
hwi_params.maskSeting = Hwi_MaskingOption_self;
Hwi_create (int_vec、&EventCombiner_Dispatch、 (hwi_params,&error_block );//将 EventCombiner 发送程序注册到 int_vec
CpIntc_enableHostInt( cic0,host_int_num ); //启用主机中断。
CpIntc_enableAllHostInts( cic0 ); //启用全局主机中断。
CpIntc_enableSysInt( cic0、input_event_num ); //现在设置完成。 启用系统事件。
Hwi_restore (hwi_status);
}
有人发现问题了吗?
提前非常感谢!
此致、
Pablo
