summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--example/apps/icssg_pwm/firmware/src/icssg_iep_pwm.h5
-rw-r--r--example/apps/icssg_pwm/firmware/src/iepPwm.c13
-rw-r--r--example/apps/icssg_pwm/firmware/src/iepPwm.h3
-rw-r--r--example/apps/icssg_pwm/firmware/src/main.c9
4 files changed, 24 insertions, 6 deletions
diff --git a/example/apps/icssg_pwm/firmware/src/icssg_iep_pwm.h b/example/apps/icssg_pwm/firmware/src/icssg_iep_pwm.h
index 107dd28..6086af9 100644
--- a/example/apps/icssg_pwm/firmware/src/icssg_iep_pwm.h
+++ b/example/apps/icssg_pwm/firmware/src/icssg_iep_pwm.h
@@ -34,6 +34,11 @@
34#ifndef _ICSSG_IEP_PWM_H_ 34#ifndef _ICSSG_IEP_PWM_H_
35#define _ICSSG_IEP_PWM_H_ 35#define _ICSSG_IEP_PWM_H_
36 36
37/* ICSSG INTC events */
38/* Compile-time Host event for IEP0 CMP0 event, pr0_pru_mst_intr[2]_intr_req,
39 ideally Host would provide this to FW */
40#define TRIGGER_HOST_EVT ( 18 ) /* 2+16 */
41
37/* 42/*
38 * Firmware global registers 43 * Firmware global registers
39 */ 44 */
diff --git a/example/apps/icssg_pwm/firmware/src/iepPwm.c b/example/apps/icssg_pwm/firmware/src/iepPwm.c
index 6bd7cab..3ec8c75 100644
--- a/example/apps/icssg_pwm/firmware/src/iepPwm.c
+++ b/example/apps/icssg_pwm/firmware/src/iepPwm.c
@@ -546,6 +546,7 @@ static Int32 updateIepPwmCmpxShRegDb(
546 IcssgIepPwmObj *pIcssgIepPwmObj 546 IcssgIepPwmObj *pIcssgIepPwmObj
547); 547);
548 548
549volatile register uint32_t __R31;
549 550
550/* ------------------------------------------------------------------------- * 551/* ------------------------------------------------------------------------- *
551 * External Functions * 552 * External Functions *
@@ -780,7 +781,8 @@ void initIepPwmSm(
780 781
781/* Execute IEP PWM State Machine */ 782/* Execute IEP PWM State Machine */
782Int32 execIepPwmSm( 783Int32 execIepPwmSm(
783 IcssgIepPwmObj *pIcssgIepPwmObj 784 IcssgIepPwmObj *pIcssgIepPwmObj,
785 Bool txHostEvt
784) 786)
785{ 787{
786 CSL_icss_g_pr1_iep1_slvRegs *pIepHwRegs = pIcssgIepPwmObj->pIepHwRegs; 788 CSL_icss_g_pr1_iep1_slvRegs *pIepHwRegs = pIcssgIepPwmObj->pIepHwRegs;
@@ -791,6 +793,9 @@ Int32 execIepPwmSm(
791 if (pIcssgIepPwmObj->iepPwmState == IEP_SM_STATE_INIT) { 793 if (pIcssgIepPwmObj->iepPwmState == IEP_SM_STATE_INIT) {
792 if ((cmpStatus & IEP_CMP_STATUS_CMP0_MASK) == IEP_CMP_STATUS_CMP0_MASK) { /* CMP0 event has occurred */ 794 if ((cmpStatus & IEP_CMP_STATUS_CMP0_MASK) == IEP_CMP_STATUS_CMP0_MASK) { /* CMP0 event has occurred */
793 pIepHwRegs->CMP_STATUS_REG = IEP_CMP_STATUS_CMP0_12_MASK; /* clear CMP0-12 events */ 795 pIepHwRegs->CMP_STATUS_REG = IEP_CMP_STATUS_CMP0_12_MASK; /* clear CMP0-12 events */
796 if (txHostEvt == TRUE) {
797 __R31 = 16 + TRIGGER_HOST_EVT; /* trigger Host interrupt on IEP CMP0 event */
798 }
794 799
795 /* Initialize IEP PWM CMPx Shadow Registers */ 800 /* Initialize IEP PWM CMPx Shadow Registers */
796 status = initIepPwmCmpxShReg(pIcssgIepPwmObj); 801 status = initIepPwmCmpxShReg(pIcssgIepPwmObj);
@@ -808,6 +813,9 @@ Int32 execIepPwmSm(
808 if (pIcssgIepPwmObj->iepPwmState == IEP_SM_STATE_LHS) { 813 if (pIcssgIepPwmObj->iepPwmState == IEP_SM_STATE_LHS) {
809 if ((cmpStatus & IEP_CMP_STATUS_CMP0_MASK) == IEP_CMP_STATUS_CMP0_MASK) { /* CMP0 event has occurred */ 814 if ((cmpStatus & IEP_CMP_STATUS_CMP0_MASK) == IEP_CMP_STATUS_CMP0_MASK) { /* CMP0 event has occurred */
810 pIepHwRegs->CMP_STATUS_REG = IEP_CMP_STATUS_CMP0_12_MASK; /* clear CMP0-12 events */ 815 pIepHwRegs->CMP_STATUS_REG = IEP_CMP_STATUS_CMP0_12_MASK; /* clear CMP0-12 events */
816 if (txHostEvt == TRUE) {
817 __R31 = 16 + TRIGGER_HOST_EVT; /* trigger Host interrupt on IEP CMP0 event */
818 }
811 819
812 /* Perform LHS processing */ 820 /* Perform LHS processing */
813 iepPwmLhs(pIcssgIepPwmObj); 821 iepPwmLhs(pIcssgIepPwmObj);
@@ -819,6 +827,9 @@ Int32 execIepPwmSm(
819 else if (pIcssgIepPwmObj->iepPwmState == IEP_SM_STATE_RHS) { 827 else if (pIcssgIepPwmObj->iepPwmState == IEP_SM_STATE_RHS) {
820 if ((cmpStatus & IEP_CMP_STATUS_CMP0_MASK) == IEP_CMP_STATUS_CMP0_MASK) { /* CMP0 event has occurred */ 828 if ((cmpStatus & IEP_CMP_STATUS_CMP0_MASK) == IEP_CMP_STATUS_CMP0_MASK) { /* CMP0 event has occurred */
821 pIepHwRegs->CMP_STATUS_REG = IEP_CMP_STATUS_CMP0_12_MASK; /* clear CMP0-12 events */ 829 pIepHwRegs->CMP_STATUS_REG = IEP_CMP_STATUS_CMP0_12_MASK; /* clear CMP0-12 events */
830 if (txHostEvt == TRUE) {
831 __R31 = 16 + TRIGGER_HOST_EVT; /* trigger Host interrupt on IEP CMP0 event */
832 }
822 833
823 /* Perform RHS processing */ 834 /* Perform RHS processing */
824 iepPwmRhs(pIcssgIepPwmObj); 835 iepPwmRhs(pIcssgIepPwmObj);
diff --git a/example/apps/icssg_pwm/firmware/src/iepPwm.h b/example/apps/icssg_pwm/firmware/src/iepPwm.h
index 0ffe6a4..4b9ec5a 100644
--- a/example/apps/icssg_pwm/firmware/src/iepPwm.h
+++ b/example/apps/icssg_pwm/firmware/src/iepPwm.h
@@ -234,7 +234,8 @@ void initIepPwmSm(
234 234
235/* Execute IEP PWM State Machine */ 235/* Execute IEP PWM State Machine */
236Int32 execIepPwmSm( 236Int32 execIepPwmSm(
237 IcssgIepPwmObj *pIcssgIepPwmObj 237 IcssgIepPwmObj *pIcssgIepPwmObj,
238 Bool txHostEvt
238); 239);
239 240
240#endif /* _IEP_PWM_H_ */ 241#endif /* _IEP_PWM_H_ */
diff --git a/example/apps/icssg_pwm/firmware/src/main.c b/example/apps/icssg_pwm/firmware/src/main.c
index 9323ff4..6ad1af4 100644
--- a/example/apps/icssg_pwm/firmware/src/main.c
+++ b/example/apps/icssg_pwm/firmware/src/main.c
@@ -34,6 +34,7 @@
34#include "iepPwmFwRegs.h" 34#include "iepPwmFwRegs.h"
35#include "iepPwmHwRegs.h" 35#include "iepPwmHwRegs.h"
36#include "iepPwm.h" 36#include "iepPwm.h"
37#include "icssg_iep_pwm.h"
37 38
38void main(void) 39void main(void)
39{ 40{
@@ -107,7 +108,7 @@ void main(void)
107 while (1) 108 while (1)
108 { 109 {
109 gIcssgIep0PwmObj.pIepHwRegs->CMP_STATUS_REG = IEP_CMP_STATUS_CMP1_12_MASK; /* clear all but CMP0 events */ 110 gIcssgIep0PwmObj.pIepHwRegs->CMP_STATUS_REG = IEP_CMP_STATUS_CMP1_12_MASK; /* clear all but CMP0 events */
110 status = execIepPwmSm(&gIcssgIep0PwmObj); 111 status = execIepPwmSm(&gIcssgIep0PwmObj, TRUE);
111 if (status != IEP_STS_NERR) 112 if (status != IEP_STS_NERR)
112 { 113 {
113 /* Indicate Error to Host */ 114 /* Indicate Error to Host */
@@ -122,7 +123,7 @@ void main(void)
122 while (1) 123 while (1)
123 { 124 {
124 gIcssgIep1PwmObj.pIepHwRegs->CMP_STATUS_REG = IEP_CMP_STATUS_CMP1_12_MASK; /* clear all but CMP0 events */ 125 gIcssgIep1PwmObj.pIepHwRegs->CMP_STATUS_REG = IEP_CMP_STATUS_CMP1_12_MASK; /* clear all but CMP0 events */
125 status = execIepPwmSm(&gIcssgIep1PwmObj); 126 status = execIepPwmSm(&gIcssgIep1PwmObj, TRUE);
126 if (status != IEP_STS_NERR) 127 if (status != IEP_STS_NERR)
127 { 128 {
128 /* Indicate Error to Host */ 129 /* Indicate Error to Host */
@@ -140,14 +141,14 @@ void main(void)
140 gIcssgIep0PwmObj.pIepHwRegs->CMP_STATUS_REG = IEP_CMP_STATUS_CMP1_12_MASK; /* clear all but CMP0 events */ 141 gIcssgIep0PwmObj.pIepHwRegs->CMP_STATUS_REG = IEP_CMP_STATUS_CMP1_12_MASK; /* clear all but CMP0 events */
141 gIcssgIep1PwmObj.pIepHwRegs->CMP_STATUS_REG = IEP_CMP_STATUS_CMP1_12_MASK; /* clear all but CMP0 events */ 142 gIcssgIep1PwmObj.pIepHwRegs->CMP_STATUS_REG = IEP_CMP_STATUS_CMP1_12_MASK; /* clear all but CMP0 events */
142 143
143 status = execIepPwmSm(&gIcssgIep0PwmObj); 144 status = execIepPwmSm(&gIcssgIep0PwmObj, TRUE);
144 if (status != IEP_STS_NERR) 145 if (status != IEP_STS_NERR)
145 { 146 {
146 /* Indicate Error to Host */ 147 /* Indicate Error to Host */
147 ; 148 ;
148 } 149 }
149 150
150 status = execIepPwmSm(&gIcssgIep1PwmObj); 151 status = execIepPwmSm(&gIcssgIep1PwmObj, FALSE);
151 if (status != IEP_STS_NERR) 152 if (status != IEP_STS_NERR)
152 { 153 {
153 /* Indicate Error to Host */ 154 /* Indicate Error to Host */