Part Number: AM5728
Tool/software: Code Composer Studio
In AM5728's DSP processor, we need EHRPWM Interrupt with TI RTOS. The question is how to register interrupt isr?
We need to detect the phase by ehrpwm2A or ehrpwm2B interrupts when the counter is decreased from period to zero.
I have configured the registers for interrupt as here:
void PWM_InterruptConfig(void)
{
/*
* AM57x DSP does not have a default Xbar connection for PWM
* interrupts, need to use a reserved IRQ Xbar instance for Xbar
* interrupt configuration
*/
/* Use reserved XBAR_INST_DSP1_IRQ_34 */
CSL_xbarIrqConfigure(CSL_XBAR_IRQ_CPU_ID_DSP1, CSL_XBAR_INST_DSP1_IRQ_34, CSL_XBAR_PWMSS2_IRQ_ePWM1INT);
// disables the ePWM Event interrupt.
CSL_epwmEtIntrDisable(PWM_BASE_ADDRESS);
// Configures the interrupt source and interrupt period.
// Enable event time-base counter equal to zero.
// Generate an interrupt on the first event
CSL_epwmEtIntrCfg(PWM_BASE_ADDRESS, PWMSS_EPWM_ETSEL_INTSEL_CTR_0, PWMSS_EPWM_ETPS_INTPRD_GEN_FIRST_EVT);
// Enables the ePWM Event interrupt.
CSL_epwmEtIntrEnable(PWM_BASE_ADDRESS);
}
But I also write ISR, which needs to be registered or installed.
How to register it in TI RTOS?
Are these codes useful?
C:\ti\processor_sdk_rtos_am57xx_6_03_00_106\pdk_am57xx_1_0_17\packages\ti\csl\example\gpio\gpio_interrupt.c
C:\ti\processor_sdk_rtos_am57xx_6_03_00_106\pdk_am57xx_1_0_17\packages\ti\csl\arch\a15\src\ interrupt.c
C:\ti\processor_sdk_rtos_am57xx_6_03_00_106\pdk_am57xx_1_0_17\packages\ti\csl\arch\c66x\ interrupt.c
Thanks,