Hi@wc
you can take a look at the function:
/*FUNCTION**********************************************************************
*
* Function Name : Emios_Pwm_Ip_SetOutputState
* Description : Set the state of output pin
*
*
*END**************************************************************************/
void Emios_Pwm_Ip_SetOutputState(uint8 Instance,
uint8 Channel,
Emios_Pwm_Ip_OutputStateType OutputState)
{
#if (EMIOS_PWM_IP_DEV_ERROR_DETECT == STD_ON)
DevAssert(EMIOS_PWM_IP_INSTANCE_COUNT > Instance);
DevAssert(EMIOS_PWM_IP_CHANNEL_COUNT > Channel);
#endif
Emios_Pwm_Ip_HwAddrType *const Base = Emios_Pwm_Ip_aBasePtr[Instance];
SchM_Enter_Pwm_PWM_EXCLUSIVE_AREA_24();
/* Set output pin polarity */
if (EMIOS_PWM_IP_OUTPUT_STATE_LOW == OutputState)
{
Emios_Pwm_Ip_SetEdgePolarity(Base, Channel, (Emios_Pwm_Ip_PolarityType)EMIOS_PWM_IP_ACTIVE_LOW);
}
else
{
Emios_Pwm_Ip_SetEdgePolarity(Base, Channel, (Emios_Pwm_Ip_PolarityType)EMIOS_PWM_IP_ACTIVE_HIGH);
}
/* Enter GPIO output Mode */
Emios_Pwm_Ip_SetPwmMode(Base, Channel, (Emios_Pwm_Ip_PwmModeType)EMIOS_PWM_IP_MODE_GPO);
/* Stored the current Mode */
Emios_Pwm_Ip_aCurrentModes[Instance][Channel] = (Emios_Pwm_Ip_PwmModeType)EMIOS_PWM_IP_MODE_GPO;
/* Disable Channel interrupts */
Emios_Pwm_Ip_SetInterruptRequest(Base, Channel, FALSE);
/* Clear pending interrupt flag for the Channel */
Emios_Pwm_Ip_ClearFlagEvent(Base, Channel);
/* Confirm the Channel is idle state */
Emios_Pwm_Ip_aCheckState[Instance][Channel] = (uint8)2U;
SchM_Exit_Pwm_PWM_EXCLUSIVE_AREA_24();
}
for example:
Emios_Pwm_Ip_SetOutputState(INSTANCE_1,7,EMIOS_PWM_IP_OUTPUT_STATE_LOW);
TestDelay(0x1fff);
Emios_Pwm_Ip_SetOutputState(INSTANCE_1,7,EMIOS_PWM_IP_OUTPUT_STATE_HIGH);
TestDelay(0x1fff);