am243x: pruio: modify example
-modify example to generate pwm's in sync -change to pruicss_pwm -remove hardcoded values in api calls Fixes: PINDSW-7096 Signed-off-by: Manoj Koppolu <manoj_koppolu@ti.com>
This commit is contained in:
parent
b158ee7d6a
commit
baaca0657d
@ -39,9 +39,9 @@
|
||||
#include <drivers/pruicss.h>
|
||||
#include <drivers/pinmux.h>
|
||||
|
||||
/** \brief Global Structure pointer holding PRUSS1 memory Map. */
|
||||
/** \brief Global Structure pointer holding PRUICSSG1 memory Map. */
|
||||
|
||||
PRUICSS_Handle gPruIcss0Handle;
|
||||
PRUICSS_Handle gPruIcssHandle;
|
||||
|
||||
/*
|
||||
* This example uses the PRUICSS PWM module to generate a signal
|
||||
@ -84,67 +84,70 @@ Pinmux_PerCfg_t gPinMuxMainDomainCfg1[] = {
|
||||
};
|
||||
void pruicss_iep_init(void *args)
|
||||
{
|
||||
int status;
|
||||
int32_t status;
|
||||
/*Disable IEP0 counter*/
|
||||
status= PRUICSS_controlIepCounter(gPruIcss0Handle,0,0);
|
||||
status= PRUICSS_controlIepCounter(gPruIcssHandle,0,0);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
Pinmux_config(gPinMuxMainDomainCfg1, PINMUX_DOMAIN_ID_MAIN);
|
||||
|
||||
/*Intialize IEP0 count value*/
|
||||
PRUICSS_setIepCounterLower_32bitValue(gPruIcss0Handle,0,0xFFFFFFFF);
|
||||
PRUICSS_setIepCounterUpper_32bitValue(gPruIcss0Handle,0,0xFFFFFFFF);
|
||||
PRUICSS_PWM_setIepCounterLower_32bitValue(gPruIcssHandle,0,0xFFFFFFFF);
|
||||
PRUICSS_PWM_setIepCounterUpper_32bitValue(gPruIcssHandle,0,0xFFFFFFFF);
|
||||
|
||||
/*configure cmp 0 value with APP_PRUICSS_PWM_PRD_VAL*/
|
||||
status=PRUICSS_setIepCompareEventLower_32bitValue(gPruIcss0Handle,0,0,(APP_PRUICSS_PWM_PRD_VAL & 0xFFFFFFFF));
|
||||
status=PRUICSS_PWM_setIepCompareEventLower_32bitValue(gPruIcssHandle,0,0,(APP_PRUICSS_PWM_PRD_VAL & 0xFFFFFFFF));
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
/*configure cmp 6 value with APP_PRUICSS_IEP0_COMP6_VAL*/
|
||||
status=PRUICSS_setIepCompareEventLower_32bitValue(gPruIcss0Handle,0,6,(APP_PRUICSS_IEP0_COMP6_VAL & 0xFFFFFFFF));
|
||||
status=PRUICSS_PWM_setIepCompareEventLower_32bitValue(gPruIcssHandle,0,6,(APP_PRUICSS_IEP0_COMP6_VAL & 0xFFFFFFFF));
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
/*Enable cmp 0 and cmp 6*/
|
||||
status=PRUICSS_configureIepCompareEnable(gPruIcss0Handle,0,0x41);
|
||||
status=PRUICSS_PWM_configureIepCompareEnable(gPruIcssHandle,0,0x41);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
/*Set IEP0 counter Increment value*/
|
||||
status=PRUICSS_setIepCounterIncrementValue(gPruIcss0Handle,0,PRUICSS_IEP_COUNT_INCREMENT_VALUE);
|
||||
status=PRUICSS_setIepCounterIncrementValue(gPruIcssHandle,0,PRUICSS_IEP_COUNT_INCREMENT_VALUE);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
/*Enable cmp 0 reset of counter*/
|
||||
PRUICSS_configureIepCmp0ResetEnable(gPruIcss0Handle,0,0x1);
|
||||
PRUICSS_PWM_configureIepCmp0ResetEnable(gPruIcssHandle,0,0x1);
|
||||
|
||||
/*Enable IEP0 counter*/
|
||||
status=PRUICSS_controlIepCounter(gPruIcss0Handle,0,1);
|
||||
status=PRUICSS_controlIepCounter(gPruIcssHandle,0,1);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
}
|
||||
|
||||
void pruicss_pwm_init(void *args){
|
||||
int status;
|
||||
void pruicss_pwm_init(void *args)
|
||||
{
|
||||
int32_t status;
|
||||
/*Enable IEP CMP flags to auto clear after state transition*/
|
||||
status=PRUICSS_configurePwmEfficiencyModeEnable(gPruIcss0Handle, 1);
|
||||
status=PRUICSS_PWM_configurePwmEfficiencyModeEnable(gPruIcssHandle, 1);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
/*Enable compare0 trip reset */
|
||||
PRUICSS_configurePwmCmp0TripResetEnable(gPruIcss0Handle,0,1);
|
||||
PRUICSS_PWM_configurePwmCmp0TripResetEnable(gPruIcssHandle,0,1);
|
||||
/*configure PWM B2 signal of set 0, intial state to low*/
|
||||
status=PRUICCS_actionOnOutputCfgPwmSignalB2(gPruIcss0Handle,0,0,1);
|
||||
status=PRUICSS_PWM_actionOnOutputCfgPwmSignalB2(gPruIcssHandle,0,0,1);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
/*configure PWM B2 signal of set 0, active state to high*/
|
||||
status=PRUICCS_actionOnOutputCfgPwmSignalB2(gPruIcss0Handle,0,1,2);
|
||||
status=PRUICSS_PWM_actionOnOutputCfgPwmSignalB2(gPruIcssHandle,0,1,2);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
}
|
||||
|
||||
void pruicss_pwm_duty_cycle_main(void *args)
|
||||
{
|
||||
|
||||
int32_t status;
|
||||
|
||||
Drivers_open(); // check return status
|
||||
|
||||
int status;
|
||||
status = Board_driversOpen();
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
gPruIcss0Handle = PRUICSS_open(CONFIG_PRU_ICSS0);
|
||||
DebugP_assert(gPruIcss0Handle != NULL);
|
||||
gPruIcssHandle = PRUICSS_open(CONFIG_PRU_ICSS0);
|
||||
DebugP_assert(gPruIcssHandle != NULL);
|
||||
|
||||
pruicss_pwm_init(NULL);
|
||||
|
||||
|
||||
@ -39,9 +39,9 @@
|
||||
#include <drivers/pruicss.h>
|
||||
#include <drivers/pinmux.h>
|
||||
|
||||
/** \brief Global Structure pointer holding PRUSS1 memory Map. */
|
||||
/** \brief Global Structure pointer holding PRUICSSG0 memory Map. */
|
||||
|
||||
PRUICSS_Handle gPruIcss0Handle;
|
||||
PRUICSS_Handle gPruIcssHandle;
|
||||
|
||||
/*
|
||||
* This example uses the PRUICSS PWM module to generate a signal
|
||||
@ -50,11 +50,15 @@ PRUICSS_Handle gPruIcss0Handle;
|
||||
* The default parameters are : Frequency : 1kHz, Duty cycle : 25%,
|
||||
* All these parameters are configurable.
|
||||
*
|
||||
* In this example PWM0_0_P0S(alias signal A0) is used to generate the signal, the user can also
|
||||
* In this example PWM0_0_POS(alias signal PWM0_A0),PWM3_2_NEG(alias signal PWM3_B2) is used to generate the signal, the user can also
|
||||
* select a different one.
|
||||
*
|
||||
* PWM0_0_P0S(alias signal A0) uses IEP0 CMP1 EVENT to control Duty cycle
|
||||
* PWM0_0_POS(alias signal PWM0_A0) uses IEP0 CMP1 EVENT to control Duty cycle
|
||||
* & IEP0 CMP0 to control output Frequency
|
||||
*
|
||||
* PWM3_2_NEG(alias signal PWM3_B2) uses IEP1 CMP12 EVENT to control Duty cycle
|
||||
* & IEP0 CMP0 to control output Frequency
|
||||
*
|
||||
* This example also showcases how to configure and use the PRUICSS PWM module.
|
||||
*/
|
||||
|
||||
@ -63,14 +67,19 @@ PRUICSS_Handle gPruIcss0Handle;
|
||||
/* Modify this to change the IEP counter increment value*/
|
||||
#define PRUICSS_IEP_COUNT_INCREMENT_VALUE (1U)
|
||||
/* Duty Cycle of PWM output signal in % - give value from 1 to 99 */
|
||||
#define APP_PRUICSS_PWM_DUTY_CYCLE (25U)
|
||||
#define APP_PRUICSS_PWM3_B2_DUTY_CYCLE (25U)
|
||||
/* Duty Cycle of PWM output signal in % - give value from 1 to 99 */
|
||||
#define APP_PRUICSS_PWM0_A0_DUTY_CYCLE (25U)
|
||||
/* Frequency of PWM output signal in Hz - 1 KHz is selected */
|
||||
#define APP_PRUICSS_PWM_OUTPUT_FREQ (1U * 1000U)
|
||||
/* PRD value - this determines the period */
|
||||
#define APP_PRUICSS_PWM_PRD_VAL (((PRUICSS_IEP0_CLK_FREQ / APP_PRUICSS_PWM_OUTPUT_FREQ))*(PRUICSS_IEP_COUNT_INCREMENT_VALUE))
|
||||
/* DUTY CYCLE width - this determines width of PWM output signal duty cycle*/
|
||||
#define APP_PRUICSS_IEP0_COMP1_VAL (APP_PRUICSS_PWM_PRD_VAL-((APP_PRUICSS_PWM_DUTY_CYCLE*APP_PRUICSS_PWM_PRD_VAL)/100))
|
||||
#define APP_PRUICSS_IEP0_COMP1_VAL (APP_PRUICSS_PWM_PRD_VAL-((APP_PRUICSS_PWM0_A0_DUTY_CYCLE*APP_PRUICSS_PWM_PRD_VAL)/100))
|
||||
/* DUTY CYCLE width - this determines width of PWM output signal duty cycle*/
|
||||
#define APP_PRUICSS_IEP1_COMP12_VAL (APP_PRUICSS_PWM_PRD_VAL-((APP_PRUICSS_PWM3_B2_DUTY_CYCLE*APP_PRUICSS_PWM_PRD_VAL)/100))
|
||||
|
||||
/*FIXME: Add pinmux in sysconfig generated file*/
|
||||
Pinmux_PerCfg_t gPinMuxMainDomainCfg1[] = {
|
||||
|
||||
/* PRU_ICSSG0_PWM0 pin config */
|
||||
@ -79,72 +88,113 @@ Pinmux_PerCfg_t gPinMuxMainDomainCfg1[] = {
|
||||
PIN_PRG0_PRU0_GPO12,
|
||||
( PIN_MODE(3) | PIN_PULL_DISABLE )
|
||||
},
|
||||
|
||||
/* PRU_ICSSG0_PWM3 pin config */
|
||||
/* PRG0_PWM3_B2 -> PRG0_PRU0_GPO5 (F2) */
|
||||
{
|
||||
PIN_PRG0_PRU0_GPO5,
|
||||
( PIN_MODE(3) | PIN_PULL_DISABLE )
|
||||
},
|
||||
{PINMUX_END, PINMUX_END}
|
||||
|
||||
};
|
||||
|
||||
|
||||
void pruicss_iep_init(void *args)
|
||||
{
|
||||
|
||||
int status;
|
||||
/*Disable IEP0 counter*/
|
||||
status= PRUICSS_controlIepCounter(gPruIcss0Handle,0,0);
|
||||
status= PRUICSS_controlIepCounter(gPruIcssHandle,0,0);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
Pinmux_config(gPinMuxMainDomainCfg1, PINMUX_DOMAIN_ID_MAIN);
|
||||
/*Enable IEP1 slave mode*/
|
||||
status=PRUICSS_PWM_enableIEP1Slave(gPruIcssHandle,1);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
/*Intialize IEP0 count value*/
|
||||
PRUICSS_setIepCounterLower_32bitValue(gPruIcss0Handle,0,0xFFFFFFFF);
|
||||
PRUICSS_setIepCounterUpper_32bitValue(gPruIcss0Handle,0,0xFFFFFFFF);
|
||||
PRUICSS_PWM_setIepCounterLower_32bitValue(gPruIcssHandle,0,0xFFFFFFFF);
|
||||
PRUICSS_PWM_setIepCounterUpper_32bitValue(gPruIcssHandle,0,0xFFFFFFFF);
|
||||
|
||||
/*configure cmp 0 value with APP_PRUICSS_PWM_PRD_VAL*/
|
||||
status=PRUICSS_setIepCompareEventLower_32bitValue(gPruIcss0Handle,0,0,(APP_PRUICSS_PWM_PRD_VAL & 0xFFFFFFFF));
|
||||
/*configure cmp 0 value of IEP0 with APP_PRUICSS_PWM_PRD_VAL*/
|
||||
status=PRUICSS_PWM_setIepCompareEventLower_32bitValue(gPruIcssHandle,0,0,(APP_PRUICSS_PWM_PRD_VAL & 0xFFFFFFFF));
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
/*configure cmp 1 value with APP_PRUICSS_IEP0_COMP1_VAL*/
|
||||
status=PRUICSS_setIepCompareEventLower_32bitValue(gPruIcss0Handle,0,1,(APP_PRUICSS_IEP0_COMP1_VAL & 0xFFFFFFFF));
|
||||
status=PRUICSS_PWM_setIepCompareEventLower_32bitValue(gPruIcssHandle,0,1,(APP_PRUICSS_IEP0_COMP1_VAL & 0xFFFFFFFF));
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
/*Enable cmp 0 and cmp 1*/
|
||||
status=PRUICSS_configureIepCompareEnable(gPruIcss0Handle,0,0x3);
|
||||
/*configure cmp 11 value with APP_PRUICSS_IEP1_COMP11_VAL*/
|
||||
status=PRUICSS_PWM_setIepCompareEventLower_32bitValue(gPruIcssHandle,1,12,(APP_PRUICSS_IEP1_COMP12_VAL & 0xFFFFFFFF));
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
/*Enable cmp 0 and cmp 1 of IEP0*/
|
||||
status=PRUICSS_PWM_configureIepCompareEnable(gPruIcssHandle,0,0x3);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
/*Enable cmp12 of IEP1*/
|
||||
status=PRUICSS_PWM_configureIepCompareEnable(gPruIcssHandle,1,0x1000);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
/*Set IEP0 counter Increment value*/
|
||||
status=PRUICSS_setIepCounterIncrementValue(gPruIcss0Handle,0,PRUICSS_IEP_COUNT_INCREMENT_VALUE);
|
||||
status=PRUICSS_setIepCounterIncrementValue(gPruIcssHandle,0,PRUICSS_IEP_COUNT_INCREMENT_VALUE);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
/*Enable cmp 0 reset of counter*/
|
||||
PRUICSS_configureIepCmp0ResetEnable(gPruIcss0Handle,0,0x1);
|
||||
/*Enable cmp 0 reset of IEP0 counter*/
|
||||
status=PRUICSS_PWM_configureIepCmp0ResetEnable(gPruIcssHandle,0,0x1);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
/*Enable IEP0 counter*/
|
||||
status=PRUICSS_controlIepCounter(gPruIcss0Handle,0,1);
|
||||
status=PRUICSS_controlIepCounter(gPruIcssHandle,0,1);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
}
|
||||
|
||||
void pruicss_pwm_init(void *args){
|
||||
|
||||
int status;
|
||||
/*Enable IEP CMP flags to auto clear after state transition*/
|
||||
status=PRUICSS_configurePwmEfficiencyModeEnable(gPruIcss0Handle, 1);
|
||||
status=PRUICSS_PWM_configurePwmEfficiencyModeEnable(gPruIcssHandle, 1);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
/*Enable compare0 trip reset */
|
||||
PRUICSS_configurePwmCmp0TripResetEnable(gPruIcss0Handle,0,1);
|
||||
/*configure PWM A0 signal of set 0, intial state to low*/
|
||||
status=PRUICCS_actionOnOutputCfgPwmSignalA0(gPruIcss0Handle,0,0,1);
|
||||
|
||||
/*Enable compare0 trip reset of set 0*/
|
||||
status=PRUICSS_PWM_configurePwmCmp0TripResetEnable(gPruIcssHandle,0,1);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
/*configure PWM A0 signal of set 0, active state to high*/
|
||||
status=PRUICCS_actionOnOutputCfgPwmSignalA0(gPruIcss0Handle,0,1,2);
|
||||
|
||||
/*Enable compare0 trip reset of set 3 */
|
||||
status=PRUICSS_PWM_configurePwmCmp0TripResetEnable(gPruIcssHandle,3,1);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
/*configure PWM B2 signal of set 0, intial state to low*/
|
||||
status=PRUICSS_PWM_actionOnOutputCfgPwmSignalA0(gPruIcssHandle,0,0,1);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
/*configure PWM B2 signal of set 0, active state to high*/
|
||||
status=PRUICSS_PWM_actionOnOutputCfgPwmSignalA0(gPruIcssHandle,0,1,2);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
/*configure PWM B2 signal of set 0, intial state to low*/
|
||||
status=PRUICSS_PWM_actionOnOutputCfgPwmSignalB2(gPruIcssHandle,3,0,1);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
/*configure PWM B2 signal of set 0, active state to high*/
|
||||
status=PRUICSS_PWM_actionOnOutputCfgPwmSignalB2(gPruIcssHandle,3,1,2);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
}
|
||||
|
||||
void pruicss_pwm_duty_cycle_main(void *args)
|
||||
{
|
||||
|
||||
int32_t status;
|
||||
|
||||
Drivers_open(); // check return status
|
||||
|
||||
int status;
|
||||
status = Board_driversOpen();
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
gPruIcss0Handle = PRUICSS_open(CONFIG_PRU_ICSS0);
|
||||
DebugP_assert(gPruIcss0Handle != NULL);
|
||||
gPruIcssHandle = PRUICSS_open(CONFIG_PRU_ICSS0);
|
||||
DebugP_assert(gPruIcssHandle != NULL);
|
||||
|
||||
Pinmux_config(gPinMuxMainDomainCfg1, PINMUX_DOMAIN_ID_MAIN);
|
||||
|
||||
pruicss_pwm_init(NULL);
|
||||
|
||||
|
||||
@ -39,9 +39,9 @@
|
||||
#include <drivers/pruicss.h>
|
||||
#include <drivers/pinmux.h>
|
||||
|
||||
/** \brief Global Structure pointer holding PRUSS1 memory Map. */
|
||||
/** \brief Global Structure pointer holding PRUICSSG1 memory Map. */
|
||||
|
||||
PRUICSS_Handle gPruIcss0Handle;
|
||||
PRUICSS_Handle gPruIcssHandle;
|
||||
|
||||
/*
|
||||
* This example uses the PRUICSS PWM module to generate a signal
|
||||
@ -84,67 +84,70 @@ Pinmux_PerCfg_t gPinMuxMainDomainCfg1[] = {
|
||||
};
|
||||
void pruicss_iep_init(void *args)
|
||||
{
|
||||
int status;
|
||||
int32_t status;
|
||||
/*Disable IEP0 counter*/
|
||||
status= PRUICSS_controlIepCounter(gPruIcss0Handle,0,0);
|
||||
status= PRUICSS_controlIepCounter(gPruIcssHandle,0,0);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
Pinmux_config(gPinMuxMainDomainCfg1, PINMUX_DOMAIN_ID_MAIN);
|
||||
|
||||
/*Intialize IEP0 count value*/
|
||||
PRUICSS_setIepCounterLower_32bitValue(gPruIcss0Handle,0,0xFFFFFFFF);
|
||||
PRUICSS_setIepCounterUpper_32bitValue(gPruIcss0Handle,0,0xFFFFFFFF);
|
||||
PRUICSS_PWM_setIepCounterLower_32bitValue(gPruIcssHandle,0,0xFFFFFFFF);
|
||||
PRUICSS_PWM_setIepCounterUpper_32bitValue(gPruIcssHandle,0,0xFFFFFFFF);
|
||||
|
||||
/*configure cmp 0 value with APP_PRUICSS_PWM_PRD_VAL*/
|
||||
status=PRUICSS_setIepCompareEventLower_32bitValue(gPruIcss0Handle,0,0,(APP_PRUICSS_PWM_PRD_VAL & 0xFFFFFFFF));
|
||||
status=PRUICSS_PWM_setIepCompareEventLower_32bitValue(gPruIcssHandle,0,0,(APP_PRUICSS_PWM_PRD_VAL & 0xFFFFFFFF));
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
/*configure cmp 6 value with APP_PRUICSS_IEP0_COMP6_VAL*/
|
||||
status=PRUICSS_setIepCompareEventLower_32bitValue(gPruIcss0Handle,0,6,(APP_PRUICSS_IEP0_COMP6_VAL & 0xFFFFFFFF));
|
||||
status=PRUICSS_PWM_setIepCompareEventLower_32bitValue(gPruIcssHandle,0,6,(APP_PRUICSS_IEP0_COMP6_VAL & 0xFFFFFFFF));
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
/*Enable cmp 0 and cmp 6*/
|
||||
status=PRUICSS_configureIepCompareEnable(gPruIcss0Handle,0,0x41);
|
||||
status=PRUICSS_PWM_configureIepCompareEnable(gPruIcssHandle,0,0x41);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
/*Set IEP0 counter Increment value*/
|
||||
status=PRUICSS_setIepCounterIncrementValue(gPruIcss0Handle,0,PRUICSS_IEP_COUNT_INCREMENT_VALUE);
|
||||
status=PRUICSS_setIepCounterIncrementValue(gPruIcssHandle,0,PRUICSS_IEP_COUNT_INCREMENT_VALUE);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
/*Enable cmp 0 reset of counter*/
|
||||
PRUICSS_configureIepCmp0ResetEnable(gPruIcss0Handle,0,0x1);
|
||||
PRUICSS_PWM_configureIepCmp0ResetEnable(gPruIcssHandle,0,0x1);
|
||||
|
||||
/*Enable IEP0 counter*/
|
||||
status=PRUICSS_controlIepCounter(gPruIcss0Handle,0,1);
|
||||
status=PRUICSS_controlIepCounter(gPruIcssHandle,0,1);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
}
|
||||
|
||||
void pruicss_pwm_init(void *args){
|
||||
int status;
|
||||
void pruicss_pwm_init(void *args)
|
||||
{
|
||||
int32_t status;
|
||||
/*Enable IEP CMP flags to auto clear after state transition*/
|
||||
status=PRUICSS_configurePwmEfficiencyModeEnable(gPruIcss0Handle, 1);
|
||||
status=PRUICSS_PWM_configurePwmEfficiencyModeEnable(gPruIcssHandle, 1);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
/*Enable compare0 trip reset */
|
||||
PRUICSS_configurePwmCmp0TripResetEnable(gPruIcss0Handle,0,1);
|
||||
PRUICSS_PWM_configurePwmCmp0TripResetEnable(gPruIcssHandle,0,1);
|
||||
/*configure PWM B2 signal of set 0, intial state to low*/
|
||||
status=PRUICCS_actionOnOutputCfgPwmSignalB2(gPruIcss0Handle,0,0,1);
|
||||
status=PRUICSS_PWM_actionOnOutputCfgPwmSignalB2(gPruIcssHandle,0,0,1);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
/*configure PWM B2 signal of set 0, active state to high*/
|
||||
status=PRUICCS_actionOnOutputCfgPwmSignalB2(gPruIcss0Handle,0,1,2);
|
||||
status=PRUICSS_PWM_actionOnOutputCfgPwmSignalB2(gPruIcssHandle,0,1,2);
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
}
|
||||
|
||||
void pruicss_pwm_duty_cycle_main(void *args)
|
||||
{
|
||||
|
||||
int32_t status;
|
||||
|
||||
Drivers_open(); // check return status
|
||||
|
||||
int status;
|
||||
status = Board_driversOpen();
|
||||
DebugP_assert(SystemP_SUCCESS == status);
|
||||
|
||||
gPruIcss0Handle = PRUICSS_open(CONFIG_PRU_ICSS0);
|
||||
DebugP_assert(gPruIcss0Handle != NULL);
|
||||
gPruIcssHandle = PRUICSS_open(CONFIG_PRU_ICSS0);
|
||||
DebugP_assert(gPruIcssHandle != NULL);
|
||||
|
||||
pruicss_pwm_init(NULL);
|
||||
|
||||
|
||||
@ -106,13 +106,10 @@ BUILD_COMBO_motorcontrol_endat = motorcontrol_endat_r5f.ti-arm-clang
|
||||
BUILD_COMBO_motorcontrol_hdsl = motorcontrol_hdsl_r5f.ti-arm-clang
|
||||
BUILD_COMBO_motorcontrol_tamagawa = motorcontrol_tamagawa_r5f.ti-arm-clang
|
||||
BUILD_COMBO_motorcontrol_bissc = motorcontrol_bissc_r5f.ti-arm-clang
|
||||
|
||||
# Combine all Components
|
||||
BUILD_COMBO_ALL = $(BUILD_COMBO_motorcontrol_sdfm) $(BUILD_COMBO_motorcontrol_endat) $(BUILD_COMBO_motorcontrol_hdsl) $(BUILD_COMBO_motorcontrol_tamagawa) $(BUILD_COMBO_motorcontrol_bissc)
|
||||
BUILD_COMBO_pruicss_pwm = pruicss_pwm_r5f.ti-arm-clang
|
||||
|
||||
# Combine all Components
|
||||
BUILD_COMBO_ALL = $(BUILD_COMBO_motorcontrol_sdfm) $(BUILD_COMBO_motorcontrol_endat) $(BUILD_COMBO_motorcontrol_hdsl) $(BUILD_COMBO_motorcontrol_tamagawa) $(BUILD_COMBO_pruicss_pwm)
|
||||
BUILD_COMBO_ALL = $(BUILD_COMBO_motorcontrol_sdfm) $(BUILD_COMBO_motorcontrol_endat) $(BUILD_COMBO_motorcontrol_hdsl) $(BUILD_COMBO_motorcontrol_tamagawa) $(BUILD_COMBO_motorcontrol_bissc) $(BUILD_COMBO_pruicss_pwm)
|
||||
|
||||
# Combine all Pre-built Components
|
||||
BUILD_COMBO_PREBUILT_ALL =
|
||||
@ -140,6 +137,7 @@ $(BUILD_COMBO_motorcontrol_tamagawa):
|
||||
|
||||
$(BUILD_COMBO_motorcontrol_bissc):
|
||||
$(MAKE) -C source/position_sense/bissc -f makefile.am243x.$(subst motorcontrol_bissc_,,$@) all
|
||||
|
||||
$(BUILD_COMBO_pruicss_pwm):
|
||||
$(MAKE) -C source/pruicss_pwm -f makefile.am243x.$(subst pruicss_pwm_,,$@) all
|
||||
|
||||
@ -150,13 +148,10 @@ BUILD_COMBO_CLEAN_motorcontrol_endat = motorcontrol_endat_r5f.ti-arm-clang_clean
|
||||
BUILD_COMBO_CLEAN_motorcontrol_hdsl = motorcontrol_hdsl_r5f.ti-arm-clang_clean
|
||||
BUILD_COMBO_CLEAN_motorcontrol_tamagawa = motorcontrol_tamagawa_r5f.ti-arm-clang_clean
|
||||
BUILD_COMBO_CLEAN_motorcontrol_bissc = motorcontrol_bissc_r5f.ti-arm-clang_clean
|
||||
|
||||
# Combine all Components Clean
|
||||
BUILD_COMBO_CLEAN_ALL = $(BUILD_COMBO_CLEAN_motorcontrol_sdfm) $(BUILD_COMBO_CLEAN_motorcontrol_endat) $(BUILD_COMBO_CLEAN_motorcontrol_hdsl) $(BUILD_COMBO_CLEAN_motorcontrol_tamagawa) $(BUILD_COMBO_CLEAN_motorcontrol_bissc)
|
||||
BUILD_COMBO_CLEAN_pruicss_pwm = pruicss_pwm_r5f.ti-arm-clang_clean
|
||||
|
||||
# Combine all Components Clean
|
||||
BUILD_COMBO_CLEAN_ALL = $(BUILD_COMBO_CLEAN_motorcontrol_sdfm) $(BUILD_COMBO_CLEAN_motorcontrol_endat) $(BUILD_COMBO_CLEAN_motorcontrol_hdsl) $(BUILD_COMBO_CLEAN_motorcontrol_tamagawa) $(BUILD_COMBO_CLEAN_pruicss_pwm)
|
||||
BUILD_COMBO_CLEAN_ALL = $(BUILD_COMBO_CLEAN_motorcontrol_sdfm) $(BUILD_COMBO_CLEAN_motorcontrol_endat) $(BUILD_COMBO_CLEAN_motorcontrol_hdsl) $(BUILD_COMBO_CLEAN_motorcontrol_tamagawa) $(BUILD_COMBO_CLEAN_motorcontrol_bissc) $(BUILD_COMBO_CLEAN_pruicss_pwm)
|
||||
|
||||
# Combine all Pre-built Components Clean
|
||||
BUILD_COMBO_PREBUILT_CLEAN_ALL =
|
||||
@ -179,6 +174,7 @@ $(BUILD_COMBO_CLEAN_motorcontrol_tamagawa):
|
||||
|
||||
$(BUILD_COMBO_CLEAN_motorcontrol_bissc):
|
||||
$(MAKE) -C source/position_sense/bissc -f makefile.am243x.$(subst motorcontrol_bissc_,,$(subst _clean,,$@)) clean
|
||||
|
||||
$(BUILD_COMBO_CLEAN_pruicss_pwm):
|
||||
$(MAKE) -C source/pruicss_pwm -f makefile.am243x.$(subst pruicss_pwm_,,$(subst _clean,,$@)) clean
|
||||
|
||||
@ -189,13 +185,10 @@ BUILD_COMBO_SCRUB_motorcontrol_endat = motorcontrol_endat_r5f.ti-arm-clang_scrub
|
||||
BUILD_COMBO_SCRUB_motorcontrol_hdsl = motorcontrol_hdsl_r5f.ti-arm-clang_scrub_scrub
|
||||
BUILD_COMBO_SCRUB_motorcontrol_tamagawa = motorcontrol_tamagawa_r5f.ti-arm-clang_scrub_scrub
|
||||
BUILD_COMBO_SCRUB_motorcontrol_bissc = motorcontrol_bissc_r5f.ti-arm-clang_scrub_scrub
|
||||
|
||||
# Combine all Components Scrub Targets
|
||||
BUILD_COMBO_SCRUB_ALL = $(BUILD_COMBO_SCRUB_motorcontrol_sdfm) $(BUILD_COMBO_SCRUB_motorcontrol_endat) $(BUILD_COMBO_SCRUB_motorcontrol_hdsl) $(BUILD_COMBO_SCRUB_motorcontrol_tamagawa) $(BUILD_COMBO_SCRUB_motorcontrol_bissc)
|
||||
BUILD_COMBO_SCRUB_pruicss_pwm = pruicss_pwm_r5f.ti-arm-clang_scrub_scrub
|
||||
|
||||
# Combine all Components Scrub Targets
|
||||
BUILD_COMBO_SCRUB_ALL = $(BUILD_COMBO_SCRUB_motorcontrol_sdfm) $(BUILD_COMBO_SCRUB_motorcontrol_endat) $(BUILD_COMBO_SCRUB_motorcontrol_hdsl) $(BUILD_COMBO_SCRUB_motorcontrol_tamagawa) $(BUILD_COMBO_SCRUB_pruicss_pwm)
|
||||
BUILD_COMBO_SCRUB_ALL = $(BUILD_COMBO_SCRUB_motorcontrol_sdfm) $(BUILD_COMBO_SCRUB_motorcontrol_endat) $(BUILD_COMBO_SCRUB_motorcontrol_hdsl) $(BUILD_COMBO_SCRUB_motorcontrol_tamagawa) $(BUILD_COMBO_SCRUB_motorcontrol_bissc) $(BUILD_COMBO_SCRUB_pruicss_pwm)
|
||||
|
||||
# Combine all Pre-built Components Scrub Targets
|
||||
BUILD_COMBO_PREBUILT_SCRUB_ALL =
|
||||
@ -218,6 +211,7 @@ $(BUILD_COMBO_SCRUB_motorcontrol_tamagawa):
|
||||
|
||||
$(BUILD_COMBO_SCRUB_motorcontrol_bissc):
|
||||
$(MAKE) -C source/position_sense/bissc -f makefile.am243x.$(subst motorcontrol_bissc_,,$(subst _scrub,,$@)) scrub
|
||||
|
||||
$(BUILD_COMBO_SCRUB_pruicss_pwm):
|
||||
$(MAKE) -C source/pruicss_pwm -f makefile.am243x.$(subst pruicss_pwm_,,$(subst _scrub,,$@)) scrub
|
||||
|
||||
|
||||
@ -41,11 +41,12 @@
|
||||
#include <drivers/hw_include/hw_types.h>
|
||||
#include <pruicss_pwm/include/pruicss_pwm.h>
|
||||
|
||||
int32_t PRUICSS_setIepCounterLower_32bitValue(PRUICSS_Handle handle, uint8_t iepInstance, uint32_t value){
|
||||
int32_t PRUICSS_PWM_setIepCounterLower_32bitValue(PRUICSS_Handle handle, uint8_t iepInstance, uint32_t value)
|
||||
{
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (iepInstance < 2) && (value <= 0xFFFFFFFF))
|
||||
if ((handle != NULL) && (iepInstance < PRUICSS_NUM_IEP_INSTANCES) && (value <= PRUICSS_IEP_COUNT_REG_MAX))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -66,11 +67,12 @@ int32_t PRUICSS_setIepCounterLower_32bitValue(PRUICSS_Handle handle, uint8_t iep
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICSS_setIepCounterUpper_32bitValue(PRUICSS_Handle handle, uint8_t iepInstance, uint32_t value){
|
||||
int32_t PRUICSS_PWM_setIepCounterUpper_32bitValue(PRUICSS_Handle handle, uint8_t iepInstance, uint32_t value)
|
||||
{
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (iepInstance < 2) && (value <= 0xFFFFFFFF))
|
||||
if ((handle != NULL) && (iepInstance < PRUICSS_NUM_IEP_INSTANCES) && (value <= PRUICSS_IEP_COUNT_REG_MAX))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -91,12 +93,12 @@ int32_t PRUICSS_setIepCounterUpper_32bitValue(PRUICSS_Handle handle, uint8_t iep
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICSS_configureIepCmp0ResetEnable(PRUICSS_Handle handle, uint8_t iepInstance, uint8_t enable)
|
||||
int32_t PRUICSS_PWM_configureIepCmp0ResetEnable(PRUICSS_Handle handle, uint8_t iepInstance, uint8_t enable)
|
||||
{
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (iepInstance < 2) && (enable < 2))
|
||||
if ((handle != NULL) && (iepInstance < PRUICSS_NUM_IEP_INSTANCES) && (enable < 2))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -117,11 +119,12 @@ int32_t PRUICSS_configureIepCmp0ResetEnable(PRUICSS_Handle handle, uint8_t iepIn
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICSS_configureIepCompareEnable(PRUICSS_Handle handle, uint8_t iepInstance, uint16_t value){
|
||||
int32_t PRUICSS_PWM_configureIepCompareEnable(PRUICSS_Handle handle, uint8_t iepInstance, uint16_t value)
|
||||
{
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (iepInstance < 2) && (value <= 0xFFFF))
|
||||
if ((handle != NULL) && (iepInstance < PRUICSS_NUM_IEP_INSTANCES) && (value <= PRUICSS_IEP_CMP_EVENTS_ENABLE_MAX_VALUE))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -142,12 +145,13 @@ int32_t PRUICSS_configureIepCompareEnable(PRUICSS_Handle handle, uint8_t iepInst
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICSS_setIepCompareEventLower_32bitValue(PRUICSS_Handle handle, uint8_t iepInstance, uint8_t cmpEvent, uint32_t value){
|
||||
int32_t PRUICSS_PWM_setIepCompareEventLower_32bitValue(PRUICSS_Handle handle, uint8_t iepInstance, uint8_t cmpEvent, uint32_t value)
|
||||
{
|
||||
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (iepInstance < 2) && (cmpEvent < 16))
|
||||
if ((handle != NULL) && (iepInstance < PRUICSS_NUM_IEP_INSTANCES) && (cmpEvent < PRUICSS_NUM_IEP_CMP_EVENTS))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -301,12 +305,13 @@ int32_t PRUICSS_setIepCompareEventLower_32bitValue(PRUICSS_Handle handle, uint8_
|
||||
|
||||
|
||||
|
||||
int32_t PRUICSS_setIepCompareEventUpper_32bitValue(PRUICSS_Handle handle, uint8_t iepInstance, uint8_t cmpEvent, uint32_t value){
|
||||
int32_t PRUICSS_PWM_setIepCompareEventUpper_32bitValue(PRUICSS_Handle handle, uint8_t iepInstance, uint8_t cmpEvent, uint32_t value)
|
||||
{
|
||||
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (iepInstance < 2) && (cmpEvent < 16))
|
||||
if ((handle != NULL) && (iepInstance < PRUICSS_NUM_IEP_INSTANCES) && (cmpEvent < PRUICSS_NUM_IEP_CMP_EVENTS))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -458,11 +463,12 @@ int32_t PRUICSS_setIepCompareEventUpper_32bitValue(PRUICSS_Handle handle, uint8_
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICSS_setPwmDebounceValue(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t value){
|
||||
int32_t PRUICSS_PWM_setPwmDebounceValue(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t value)
|
||||
{
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (pwmSet < 4) && (value <= 0xFF))
|
||||
if ((handle != NULL) && (pwmSet < PRUICSS_NUM_PWM_SETS) && (value <= PRUICSS_PWM_DEBOUNCE_MAX_VALUE))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -491,11 +497,12 @@ int32_t PRUICSS_setPwmDebounceValue(PRUICSS_Handle handle, uint8_t pwmSet, uint8
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICSS_setPwmTripMask(PRUICSS_Handle handle, uint8_t pwmSet, uint16_t maskvalue){
|
||||
int32_t PRUICSS_PWM_setPwmTripMask(PRUICSS_Handle handle, uint8_t pwmSet, uint16_t maskvalue)
|
||||
{
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (pwmSet < 4) && (maskvalue <= 0x01FF))
|
||||
if ((handle != NULL) && (pwmSet < PRUICSS_NUM_PWM_SETS) && (maskvalue <= PRUICSS_PWM_TRIP_MASK_MAX_VALUE))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -524,11 +531,12 @@ int32_t PRUICSS_setPwmTripMask(PRUICSS_Handle handle, uint8_t pwmSet, uint16_t m
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICSS_configurePwmCmp0TripResetEnable(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t enable){
|
||||
int32_t PRUICSS_PWM_configurePwmCmp0TripResetEnable(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t enable)
|
||||
{
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (pwmSet < 4) && (enable < 2))
|
||||
if ((handle != NULL) && (pwmSet < PRUICSS_NUM_PWM_SETS) && (enable < 2))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -557,11 +565,12 @@ int32_t PRUICSS_configurePwmCmp0TripResetEnable(PRUICSS_Handle handle, uint8_t p
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICSS_generatePwmTripReset(PRUICSS_Handle handle, uint8_t pwmSet){
|
||||
int32_t PRUICSS_PWM_generatePwmTripReset(PRUICSS_Handle handle, uint8_t pwmSet)
|
||||
{
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (pwmSet < 4))
|
||||
if ((handle != NULL) && (pwmSet < PRUICSS_NUM_PWM_SETS))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -590,11 +599,12 @@ int32_t PRUICSS_generatePwmTripReset(PRUICSS_Handle handle, uint8_t pwmSet){
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICSS_generatePwmOverCurrentErrorTrip(PRUICSS_Handle handle, uint8_t pwmSet){
|
||||
int32_t PRUICSS_PWM_generatePwmOverCurrentErrorTrip(PRUICSS_Handle handle, uint8_t pwmSet)
|
||||
{
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (pwmSet < 4))
|
||||
if ((handle != NULL) && (pwmSet < PRUICSS_NUM_PWM_SETS))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -623,11 +633,12 @@ int32_t PRUICSS_generatePwmOverCurrentErrorTrip(PRUICSS_Handle handle, uint8_t p
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICSS_generatePwmPositionFeedbackErrorTrip(PRUICSS_Handle handle, uint8_t pwmSet){
|
||||
int32_t PRUICSS_PWM_generatePwmPositionFeedbackErrorTrip(PRUICSS_Handle handle, uint8_t pwmSet)
|
||||
{
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (pwmSet < 4))
|
||||
if ((handle != NULL) && (pwmSet < PRUICSS_NUM_PWM_SETS))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -656,11 +667,12 @@ int32_t PRUICSS_generatePwmPositionFeedbackErrorTrip(PRUICSS_Handle handle, uint
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICSS_clearPwmTripResetStatus(PRUICSS_Handle handle, uint8_t pwmSet){
|
||||
int32_t PRUICSS_PWM_clearPwmTripResetStatus(PRUICSS_Handle handle, uint8_t pwmSet)
|
||||
{
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (pwmSet < 4))
|
||||
if ((handle != NULL) && (pwmSet < PRUICSS_NUM_PWM_SETS))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -689,11 +701,12 @@ int32_t PRUICSS_clearPwmTripResetStatus(PRUICSS_Handle handle, uint8_t pwmSet){
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICSS_clearPwmOverCurrentErrorTrip(PRUICSS_Handle handle, uint8_t pwmSet){
|
||||
int32_t PRUICSS_PWM_clearPwmOverCurrentErrorTrip(PRUICSS_Handle handle, uint8_t pwmSet)
|
||||
{
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (pwmSet < 4))
|
||||
if ((handle != NULL) && (pwmSet < PRUICSS_NUM_PWM_SETS))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -722,11 +735,12 @@ int32_t PRUICSS_clearPwmOverCurrentErrorTrip(PRUICSS_Handle handle, uint8_t pwmS
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICSS_clearPwmPositionFeedbackErrorTrip(PRUICSS_Handle handle, uint8_t pwmSet){
|
||||
int32_t PRUICSS_PWM_clearPwmPositionFeedbackErrorTrip(PRUICSS_Handle handle, uint8_t pwmSet)
|
||||
{
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (pwmSet < 4))
|
||||
if ((handle != NULL) && (pwmSet < PRUICSS_NUM_PWM_SETS))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -755,11 +769,12 @@ int32_t PRUICSS_clearPwmPositionFeedbackErrorTrip(PRUICSS_Handle handle, uint8_t
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICSS_getPwmTripTriggerCauseVector(PRUICSS_Handle handle, uint8_t pwmSet){
|
||||
int32_t PRUICSS_PWM_getPwmTripTriggerCauseVector(PRUICSS_Handle handle, uint8_t pwmSet)
|
||||
{
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (pwmSet < 4))
|
||||
if ((handle != NULL) && (pwmSet < PRUICSS_NUM_PWM_SETS))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -784,11 +799,12 @@ int32_t PRUICSS_getPwmTripTriggerCauseVector(PRUICSS_Handle handle, uint8_t pwmS
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICSS_getPwmTripStatus(PRUICSS_Handle handle, uint8_t pwmSet){
|
||||
int32_t PRUICSS_PWM_getPwmTripStatus(PRUICSS_Handle handle, uint8_t pwmSet)
|
||||
{
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (pwmSet < 4))
|
||||
if ((handle != NULL) && (pwmSet < PRUICSS_NUM_PWM_SETS))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -813,28 +829,30 @@ int32_t PRUICSS_getPwmTripStatus(PRUICSS_Handle handle, uint8_t pwmSet){
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICSS_clearPwmTripStatus(PRUICSS_Handle handle, uint8_t pwmSet){
|
||||
int32_t PRUICSS_PWM_clearPwmTripStatus(PRUICSS_Handle handle, uint8_t pwmSet)
|
||||
{
|
||||
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (pwmSet < 4))
|
||||
if ((handle != NULL) && (pwmSet < PRUICSS_NUM_PWM_SETS))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
retVal= PRUICSS_generatePwmTripReset(handle,pwmSet);
|
||||
retVal= PRUICSS_PWM_generatePwmTripReset(handle,pwmSet);
|
||||
if(retVal == SystemP_SUCCESS)
|
||||
{
|
||||
PRUICSS_clearPwmTripResetStatus(handle,pwmSet);
|
||||
PRUICSS_PWM_clearPwmTripResetStatus(handle,pwmSet);
|
||||
}
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICCS_actionOnOutputCfgPwmSignalA0(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action){
|
||||
int32_t PRUICSS_PWM_actionOnOutputCfgPwmSignalA0(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action)
|
||||
{
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (pwmSet < 4) && (state<3))
|
||||
if ((handle != NULL) && (pwmSet < PRUICSS_NUM_PWM_SETS) && (state < PRUICSS_NUM_PWM_STATES))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -916,11 +934,12 @@ int32_t PRUICCS_actionOnOutputCfgPwmSignalA0(PRUICSS_Handle handle, uint8_t pwmS
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICCS_actionOnOutputCfgPwmSignalA1(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action){
|
||||
int32_t PRUICSS_PWM_actionOnOutputCfgPwmSignalA1(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action)
|
||||
{
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (pwmSet < 4) && (state<3))
|
||||
if ((handle != NULL) && (pwmSet < PRUICSS_NUM_PWM_SETS) && (state < PRUICSS_NUM_PWM_STATES))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -1002,11 +1021,12 @@ int32_t PRUICCS_actionOnOutputCfgPwmSignalA1(PRUICSS_Handle handle, uint8_t pwmS
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICCS_actionOnOutputCfgPwmSignalA2(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action){
|
||||
int32_t PRUICSS_PWM_actionOnOutputCfgPwmSignalA2(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action)
|
||||
{
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (pwmSet < 4) && (state<3))
|
||||
if ((handle != NULL) && (pwmSet < PRUICSS_NUM_PWM_SETS) && (state < PRUICSS_NUM_PWM_STATES))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -1086,11 +1106,12 @@ int32_t PRUICCS_actionOnOutputCfgPwmSignalA2(PRUICSS_Handle handle, uint8_t pwmS
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICCS_actionOnOutputCfgPwmSignalB0(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action){
|
||||
int32_t PRUICSS_PWM_actionOnOutputCfgPwmSignalB0(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action)
|
||||
{
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (pwmSet < 4) && (state<3))
|
||||
if ((handle != NULL) && (pwmSet < PRUICSS_NUM_PWM_SETS) && (state < PRUICSS_NUM_PWM_STATES))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -1170,11 +1191,12 @@ int32_t PRUICCS_actionOnOutputCfgPwmSignalB0(PRUICSS_Handle handle, uint8_t pwmS
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICCS_actionOnOutputCfgPwmSignalB1(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action){
|
||||
int32_t PRUICSS_PWM_actionOnOutputCfgPwmSignalB1(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action)
|
||||
{
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (pwmSet < 4) && (state<3))
|
||||
if ((handle != NULL) && (pwmSet < PRUICSS_NUM_PWM_SETS) && (state < PRUICSS_NUM_PWM_STATES))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -1255,11 +1277,12 @@ int32_t PRUICCS_actionOnOutputCfgPwmSignalB1(PRUICSS_Handle handle, uint8_t pwmS
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICCS_actionOnOutputCfgPwmSignalB2(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action){
|
||||
int32_t PRUICSS_PWM_actionOnOutputCfgPwmSignalB2(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action)
|
||||
{
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (pwmSet < 4) && (state<3))
|
||||
if ((handle != NULL) && (pwmSet < PRUICSS_NUM_PWM_SETS) && (state < PRUICSS_NUM_PWM_STATES))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
@ -1340,7 +1363,8 @@ int32_t PRUICCS_actionOnOutputCfgPwmSignalB2(PRUICSS_Handle handle, uint8_t pwmS
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICSS_configurePwmEfficiencyModeEnable(PRUICSS_Handle handle, uint8_t enable){
|
||||
int32_t PRUICSS_PWM_configurePwmEfficiencyModeEnable(PRUICSS_Handle handle, uint8_t enable)
|
||||
{
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
@ -1352,3 +1376,22 @@ int32_t PRUICSS_configurePwmEfficiencyModeEnable(PRUICSS_Handle handle, uint8_t
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int32_t PRUICSS_PWM_enableIEP1Slave(PRUICSS_Handle handle, uint8_t enable)
|
||||
{
|
||||
|
||||
PRUICSS_HwAttrs const *hwAttrs;
|
||||
int32_t retVal = SystemP_FAILURE;
|
||||
|
||||
if ((handle != NULL) && (enable < 2))
|
||||
{
|
||||
retVal = SystemP_SUCCESS;
|
||||
hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
|
||||
|
||||
HW_WR_FIELD32((hwAttrs->cfgRegBase + CSL_ICSSCFG_IEPCLK),
|
||||
CSL_ICSSCFG_IEPCLK_IEP1_SLV_EN, 1);
|
||||
}
|
||||
return retVal;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -55,6 +55,7 @@
|
||||
* Each Set has one trip zone output OR logic block
|
||||
* Each trip zone block has nine trip_error signals (trip_e1_[0:2], trip_e2, trip_e3[0:2], trip_e4, trip_e5) as input
|
||||
* And one PWMn_TZ_OUT output signal which makes transition to safe or trip state from current state
|
||||
*
|
||||
* ________________
|
||||
* tripn_e1_[2:0](Debounce Trip)----------------------->| |
|
||||
* | |
|
||||
@ -87,6 +88,7 @@ extern "C" {
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <drivers/pruicss.h>
|
||||
#include <kernel/dpl/SystemP.h>
|
||||
#include <drivers/hw_include/cslr.h>
|
||||
#include <drivers/hw_include/hw_types.h>
|
||||
|
||||
@ -95,14 +97,44 @@ extern "C" {
|
||||
/* ========================================================================== */
|
||||
|
||||
/**
|
||||
* \brief Return status when the API execution was successful
|
||||
* \brief Number of PRUICSS IEP Instances
|
||||
*/
|
||||
#define SystemP_SUCCESS ((int32_t )0)
|
||||
#define PRUICSS_NUM_IEP_INSTANCES (0x2U)
|
||||
|
||||
/**
|
||||
* \brief Return status when the API execution was not successful due to a failure.
|
||||
* \brief PRUICSS IEP count register maximum value
|
||||
*/
|
||||
#define SystemP_FAILURE ((int32_t)-1)
|
||||
#define PRUICSS_IEP_COUNT_REG_MAX (0xFFFFFFFFU)
|
||||
|
||||
/**
|
||||
* \brief Number of PRUICSS IEP compare events
|
||||
*/
|
||||
#define PRUICSS_NUM_IEP_CMP_EVENTS (0x10U)
|
||||
|
||||
/**
|
||||
* \brief Number of PRUICSS IEP compare events enable field maximum value
|
||||
*/
|
||||
#define PRUICSS_IEP_CMP_EVENTS_ENABLE_MAX_VALUE (0x0000FFFFU)
|
||||
|
||||
/**
|
||||
* \brief Number of PRUICSS PWM Sets
|
||||
*/
|
||||
#define PRUICSS_NUM_PWM_SETS (0x4U)
|
||||
|
||||
/**
|
||||
* \brief Number of PRUICSS PWM number of states
|
||||
*/
|
||||
#define PRUICSS_NUM_PWM_STATES (0x3U)
|
||||
|
||||
/**
|
||||
* \brief PRUICSS PWM Debounce maximum value
|
||||
*/
|
||||
#define PRUICSS_PWM_DEBOUNCE_MAX_VALUE (0xFFU)
|
||||
|
||||
/**
|
||||
* \brief Number of PRUICSS PWM Sets
|
||||
*/
|
||||
#define PRUICSS_PWM_TRIP_MASK_MAX_VALUE (0x000001FFU)
|
||||
|
||||
|
||||
|
||||
@ -116,10 +148,10 @@ extern "C" {
|
||||
* \param handle PRUICSS_Handle returned from PRUICSS_open()
|
||||
* \param iepInstance 0 for IEP0, 1 for IEP1
|
||||
* \param value iep count register Lower 32bit Value
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICSS_setIepCounterLower_32bitValue(PRUICSS_Handle handle, uint8_t iepInstance, uint32_t value);
|
||||
int32_t PRUICSS_PWM_setIepCounterLower_32bitValue(PRUICSS_Handle handle, uint8_t iepInstance, uint32_t value);
|
||||
|
||||
/**
|
||||
* \brief This API writes Upper_32bit Value of IEP counter in IEP module.
|
||||
@ -127,21 +159,21 @@ int32_t PRUICSS_setIepCounterLower_32bitValue(PRUICSS_Handle handle, uint8_t iep
|
||||
* \param handle PRUICSS_Handle returned from PRUICSS_open()
|
||||
* \param iepInstance 0 for IEP0, 1 for IEP1
|
||||
* \param value iep count register Upper 32bit Value
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICSS_setIepCounterUpper_32bitValue(PRUICSS_Handle handle, uint8_t iepInstance, uint32_t value);
|
||||
int32_t PRUICSS_PWM_setIepCounterUpper_32bitValue(PRUICSS_Handle handle, uint8_t iepInstance, uint32_t value);
|
||||
|
||||
/**
|
||||
* \brief This API sets enables/disables of IEP counter reset on compare 0 event in IEP module.
|
||||
*
|
||||
* \param handle PRUICSS_Handle returned from PRUICSS_open()
|
||||
* \param iepInstance 0 for IEP0, 1 for IEP1
|
||||
* \param value Value to store in compare enable field of compare config register
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \param enable enable 0 for disable, 1 for enable
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICSS_configureIepCmp0ResetEnable(PRUICSS_Handle handle, uint8_t iepInstance, uint8_t enable);
|
||||
int32_t PRUICSS_PWM_configureIepCmp0ResetEnable(PRUICSS_Handle handle, uint8_t iepInstance, uint8_t enable);
|
||||
|
||||
/**
|
||||
* \brief This API sets enables/disables compare events in IEP module.
|
||||
@ -149,10 +181,10 @@ int32_t PRUICSS_configureIepCmp0ResetEnable(PRUICSS_Handle handle, uint8_t iepIn
|
||||
* \param handle PRUICSS_Handle returned from PRUICSS_open()
|
||||
* \param iepInstance 0 for IEP0, 1 for IEP1
|
||||
* \param value Value to store in compare enable field of compare config register
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICSS_configureIepCompareEnable(PRUICSS_Handle handle, uint8_t iepInstance, uint16_t value);
|
||||
int32_t PRUICSS_PWM_configureIepCompareEnable(PRUICSS_Handle handle, uint8_t iepInstance, uint16_t value);
|
||||
|
||||
/**
|
||||
* \brief This API writes Lower_32bit Value of compare event in IEP module.
|
||||
@ -161,10 +193,10 @@ int32_t PRUICSS_configureIepCompareEnable(PRUICSS_Handle handle, uint8_t iepInst
|
||||
* \param iepInstance 0 for IEP0, 1 for IEP1
|
||||
* \param value compare register Lower 32bit Value
|
||||
* \param cmpEvent compare Event number. Maximum value allowed is 15
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICSS_setIepCompareEventLower_32bitValue(PRUICSS_Handle handle, uint8_t iepInstance, uint8_t cmpEvent, uint32_t value);
|
||||
int32_t PRUICSS_PWM_setIepCompareEventLower_32bitValue(PRUICSS_Handle handle, uint8_t iepInstance, uint8_t cmpEvent, uint32_t value);
|
||||
|
||||
/**
|
||||
* \brief This API writes Upper_32bit Value of compare event in IEP module.
|
||||
@ -173,10 +205,10 @@ int32_t PRUICSS_setIepCompareEventLower_32bitValue(PRUICSS_Handle handle, uint8_
|
||||
* \param iepInstance 0 for IEP0, 1 for IEP1
|
||||
* \param value compare register Upper 32bit Value
|
||||
* \param cmpEvent compare Event number. Maximum value allowed is 15
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICSS_setIepCompareEventUpper_32bitValue(PRUICSS_Handle handle, uint8_t iepInstance, uint8_t cmpEvent, uint32_t value);
|
||||
int32_t PRUICSS_PWM_setIepCompareEventUpper_32bitValue(PRUICSS_Handle handle, uint8_t iepInstance, uint8_t cmpEvent, uint32_t value);
|
||||
|
||||
/**
|
||||
* \brief This API updates Debounce Value for specified pwm set
|
||||
@ -184,10 +216,10 @@ int32_t PRUICSS_setIepCompareEventUpper_32bitValue(PRUICSS_Handle handle, uint8_
|
||||
* \param handle PRUICSS_Handle returned from PRUICSS_open()
|
||||
* \param pwmSet 0 for PWM0, 1 for PWM1, 2 for PWM2, 3 for PWM3
|
||||
* \param value pwmSet Debounce Value
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICSS_setPwmDebounceValue(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t value);
|
||||
int32_t PRUICSS_PWM_setPwmDebounceValue(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t value);
|
||||
|
||||
/**
|
||||
* \brief This API updates TripMask Value for specified pwm set
|
||||
@ -206,101 +238,101 @@ int32_t PRUICSS_setPwmDebounceValue(PRUICSS_Handle handle, uint8_t pwmSet, uint8
|
||||
* \param handle PRUICSS_Handle returned from PRUICSS_open()
|
||||
* \param pwmSet 0 for PWM0, 1 for PWM1, 2 for PWM2, 3 for PWM3
|
||||
* \param maskvalue pwmSet maskValue
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICSS_setPwmTripMask(PRUICSS_Handle handle, uint8_t pwmSet, uint16_t maskvalue);
|
||||
int32_t PRUICSS_PWM_setPwmTripMask(PRUICSS_Handle handle, uint8_t pwmSet, uint16_t maskvalue);
|
||||
|
||||
/**
|
||||
* \brief This API enables/disables TripReset on Compare_0 Event for specified pwm set
|
||||
*
|
||||
* \param handle PRUICSS_Handle returned from PRUICSS_open()
|
||||
* \param pwmSet 0 for PWM0, 1 for PWM1, 2 for PWM2, 3 for PWM3
|
||||
* \param value 0 for disable, 1 for enable
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \param enable 0 for disable, 1 for enable
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICSS_configurePwmCmp0TripResetEnable(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t enable);
|
||||
int32_t PRUICSS_PWM_configurePwmCmp0TripResetEnable(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t enable);
|
||||
|
||||
/**
|
||||
* \brief This API generates Software Trip Reset by writing 1 to bit field for specified pwm set
|
||||
*
|
||||
* \param handle PRUICSS_Handle returned from PRUICSS_open()
|
||||
* \param pwmSet 0 for PWM0, 1 for PWM1, 2 for PWM2, 3 for PWM3
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICSS_generatePwmTripReset(PRUICSS_Handle handle, uint8_t pwmSet);
|
||||
int32_t PRUICSS_PWM_generatePwmTripReset(PRUICSS_Handle handle, uint8_t pwmSet);
|
||||
|
||||
/**
|
||||
* \brief This API generates Software Over current error trip by writing 1 to bit field for specified pwm set
|
||||
*
|
||||
* \param handle PRUICSS_Handle returned from PRUICSS_open()
|
||||
* \param pwmSet 0 for PWM0, 1 for PWM1, 2 for PWM2, 3 for PWM3
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICSS_generatePwmOverCurrentErrorTrip(PRUICSS_Handle handle, uint8_t pwmSet);
|
||||
int32_t PRUICSS_PWM_generatePwmOverCurrentErrorTrip(PRUICSS_Handle handle, uint8_t pwmSet);
|
||||
|
||||
/**
|
||||
* \brief This API generates Software Position Feedback Error Trip by writing 1 to bit field for specified pwm set
|
||||
*
|
||||
* \param handle PRUICSS_Handle returned from PRUICSS_open()
|
||||
* \param pwmSet 0 for PWM0, 1 for PWM1, 2 for PWM2, 3 for PWM3
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICSS_generatePwmPositionFeedbackErrorTrip(PRUICSS_Handle handle, uint8_t pwmSet);
|
||||
int32_t PRUICSS_PWM_generatePwmPositionFeedbackErrorTrip(PRUICSS_Handle handle, uint8_t pwmSet);
|
||||
|
||||
/**
|
||||
* \brief This API clears Software Trip Reset by writing 0 to bit field for specified pwm set
|
||||
*
|
||||
* \param handle PRUICSS_Handle returned from PRUICSS_open()
|
||||
* \param pwmSet 0 for PWM0, 1 for PWM1, 2 for PWM2, 3 for PWM3
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICSS_clearPwmTripResetStatus(PRUICSS_Handle handle, uint8_t pwmSet);
|
||||
int32_t PRUICSS_PWM_clearPwmTripResetStatus(PRUICSS_Handle handle, uint8_t pwmSet);
|
||||
|
||||
/**
|
||||
* \brief This API clears Software Over current error trip by writing 0 to bit field for specified pwm set
|
||||
*
|
||||
* \param handle PRUICSS_Handle returned from PRUICSS_open()
|
||||
* \param pwmSet 0 for PWM0, 1 for PWM1, 2 for PWM2, 3 for PWM3
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICSS_clearPwmOverCurrentErrorTrip(PRUICSS_Handle handle, uint8_t pwmSet);
|
||||
int32_t PRUICSS_PWM_clearPwmOverCurrentErrorTrip(PRUICSS_Handle handle, uint8_t pwmSet);
|
||||
|
||||
/**
|
||||
* \brief This API clears Software Position Feedback Error Trip by writing 0 to bit field for specified pwm set
|
||||
*
|
||||
* \param handle PRUICSS_Handle returned from PRUICSS_open()
|
||||
* \param pwmSet 0 for PWM0, 1 for PWM1, 2 for PWM2, 3 for PWM3
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICSS_clearPwmPositionFeedbackErrorTrip(PRUICSS_Handle handle, uint8_t pwmSet);
|
||||
int32_t PRUICSS_PWM_clearPwmPositionFeedbackErrorTrip(PRUICSS_Handle handle, uint8_t pwmSet);
|
||||
|
||||
/**
|
||||
* \brief This API returns Trip trigger cause vector for specified pwm set
|
||||
*
|
||||
* \param handle PRUICSS_Handle returned from PRUICSS_open()
|
||||
* \param pwmSet 0 for PWM0, 1 for PWM1, 2 for PWM2, 3 for PWM3
|
||||
* \return #Trip trigger cause vector on success, #SystemP_FAILURE on error
|
||||
* \return Trip trigger cause vector on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICSS_getPwmTripTriggerCauseVector(PRUICSS_Handle handle, uint8_t pwmSet);
|
||||
int32_t PRUICSS_PWM_getPwmTripTriggerCauseVector(PRUICSS_Handle handle, uint8_t pwmSet);
|
||||
|
||||
/**
|
||||
* \brief This API returns Trip status for specified pwm set
|
||||
*
|
||||
* \param handle PRUICSS_Handle returned from PRUICSS_open()
|
||||
* \param pwmSet 0 for PWM0, 1 for PWM1, 2 for PWM2, 3 for PWM3
|
||||
* \return #Trip status on success, #SystemP_FAILURE on error
|
||||
* \return Trip status on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICSS_getPwmTripStatus(PRUICSS_Handle handle, uint8_t pwmSet);
|
||||
int32_t PRUICSS_PWM_getPwmTripStatus(PRUICSS_Handle handle, uint8_t pwmSet);
|
||||
|
||||
/**
|
||||
* \brief This API clears Trip status and makes state transition to Intial state as follows (Active->Intial)
|
||||
@ -308,10 +340,10 @@ int32_t PRUICSS_getPwmTripStatus(PRUICSS_Handle handle, uint8_t pwmSet);
|
||||
*
|
||||
* \param handle PRUICSS_Handle returned from PRUICSS_open()
|
||||
* \param pwmSet 0 for PWM0, 1 for PWM1, 2 for PWM2, 3 for PWM3
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICSS_clearPwmTripStatus(PRUICSS_Handle handle, uint8_t pwmSet);
|
||||
int32_t PRUICSS_PWM_clearPwmTripStatus(PRUICSS_Handle handle, uint8_t pwmSet);
|
||||
|
||||
/**
|
||||
* \brief This API updates output action for specified state of A0 signal for specified PWM set
|
||||
@ -320,10 +352,10 @@ int32_t PRUICSS_clearPwmTripStatus(PRUICSS_Handle handle, uint8_t pwmSet);
|
||||
* \param pwmSet 0 for PWM0, 1 for PWM1, 2 for PWM2, 3 for PWM3
|
||||
* \param state 0 for Intial, 1 for Active, 2 for Safe(alias Trip) state
|
||||
* \param action 0 for Toggle, 1 for Low, 2 for High
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICCS_actionOnOutputCfgPwmSignalA0(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action);
|
||||
int32_t PRUICSS_PWM_actionOnOutputCfgPwmSignalA0(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action);
|
||||
|
||||
/**
|
||||
* \brief This API updates output action for specified state of A1 signal for specified PWM set
|
||||
@ -332,10 +364,10 @@ int32_t PRUICCS_actionOnOutputCfgPwmSignalA0(PRUICSS_Handle handle, uint8_t pwmS
|
||||
* \param pwmSet 0 for PWM0, 1 for PWM1, 2 for PWM2, 3 for PWM3
|
||||
* \param state 0 for Intial, 1 for Active, 2 for Safe(alias Trip) state
|
||||
* \param action 0 for Toggle, 1 for Low, 2 for High
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICCS_actionOnOutputCfgPwmSignalA1(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action);
|
||||
int32_t PRUICSS_PWM_actionOnOutputCfgPwmSignalA1(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action);
|
||||
|
||||
/**
|
||||
* \brief This API updates output action for specified state of A2 signal for specified PWM set
|
||||
@ -344,10 +376,10 @@ int32_t PRUICCS_actionOnOutputCfgPwmSignalA1(PRUICSS_Handle handle, uint8_t pwmS
|
||||
* \param pwmSet 0 for PWM0, 1 for PWM1, 2 for PWM2, 3 for PWM3
|
||||
* \param state 0 for Intial, 1 for Active, 2 for Safe(alias Trip) state
|
||||
* \param action 0 for Toggle, 1 for Low, 2 for High
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICCS_actionOnOutputCfgPwmSignalA2(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action);
|
||||
int32_t PRUICSS_PWM_actionOnOutputCfgPwmSignalA2(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action);
|
||||
|
||||
/**
|
||||
* \brief This API updates output action for specified state of B0 signal for specified PWM set
|
||||
@ -356,10 +388,10 @@ int32_t PRUICCS_actionOnOutputCfgPwmSignalA2(PRUICSS_Handle handle, uint8_t pwmS
|
||||
* \param pwmSet 0 for PWM0, 1 for PWM1, 2 for PWM2, 3 for PWM3
|
||||
* \param state 0 for Intial, 1 for Active, 2 for Safe(alias Trip) state
|
||||
* \param action 0 for Toggle, 1 for Low, 2 for High
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICCS_actionOnOutputCfgPwmSignalB0(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action);
|
||||
int32_t PRUICSS_PWM_actionOnOutputCfgPwmSignalB0(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action);
|
||||
|
||||
/**
|
||||
* \brief This API updates output action for specified state of B1 signal for specified PWM set
|
||||
@ -368,10 +400,10 @@ int32_t PRUICCS_actionOnOutputCfgPwmSignalB0(PRUICSS_Handle handle, uint8_t pwmS
|
||||
* \param pwmSet 0 for PWM0, 1 for PWM1, 2 for PWM2, 3 for PWM3
|
||||
* \param state 0 for Intial, 1 for Active, 2 for Safe(alias Trip) state
|
||||
* \param action 0 for Toggle, 1 for Low, 2 for High
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICCS_actionOnOutputCfgPwmSignalB1(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action);
|
||||
int32_t PRUICSS_PWM_actionOnOutputCfgPwmSignalB1(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action);
|
||||
|
||||
/**
|
||||
* \brief This API updates output action for specified state of B2 signal for specified PWM set
|
||||
@ -380,10 +412,10 @@ int32_t PRUICCS_actionOnOutputCfgPwmSignalB1(PRUICSS_Handle handle, uint8_t pwmS
|
||||
* \param pwmSet 0 for PWM0, 1 for PWM1, 2 for PWM2, 3 for PWM3
|
||||
* \param state 0 for Intial, 1 for Active, 2 for Safe(alias Trip) state
|
||||
* \param action 0 for Toggle, 1 for Low, 2 for High
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICCS_actionOnOutputCfgPwmSignalB2(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action);
|
||||
int32_t PRUICSS_PWM_actionOnOutputCfgPwmSignalB2(PRUICSS_Handle handle, uint8_t pwmSet, uint8_t state, uint8_t action);
|
||||
|
||||
/**
|
||||
* \brief This API enables Efficiency mode
|
||||
@ -393,10 +425,22 @@ int32_t PRUICCS_actionOnOutputCfgPwmSignalB2(PRUICSS_Handle handle, uint8_t pwmS
|
||||
*
|
||||
* \param handle PRUICSS_Handle returned from PRUICSS_open()
|
||||
* \param enable 0 for disable, 1 for enable
|
||||
* \return #SystemP_SUCCESS on success, #SystemP_FAILURE on error
|
||||
* \return SystemP_SUCCESS on success, SystemP_FAILURE on error
|
||||
*
|
||||
*/
|
||||
int32_t PRUICSS_configurePwmEfficiencyModeEnable(PRUICSS_Handle handle, uint8_t enable);
|
||||
int32_t PRUICSS_PWM_configurePwmEfficiencyModeEnable(PRUICSS_Handle handle, uint8_t enable);
|
||||
|
||||
/**
|
||||
* \brief This function enables IEP1 counter follow IEP0 counter
|
||||
* when Enabled IEP1 counter acts as slave
|
||||
* IEP1 counter[63:0] is from IEP0 during 64-bit mode
|
||||
* IEP1 counter[31:0] is from IEP0 during 32-bit mode
|
||||
*
|
||||
* \param handle PRUICSS_Handle returned from PRUICSS_open()
|
||||
* \param enable 0 for disable, 1 for enable
|
||||
* \return SystemP_SUCCESS in case of success, SystemP_FAILURE otherwise
|
||||
*/
|
||||
int32_t PRUICSS_PWM_enableIEP1Slave(PRUICSS_Handle handle, uint8_t enable);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user