/* If the update of the counter for the specified PWM generator has yet to be completed, the value returned may not be the active period. The value returned is the programmed period, measured in PWM clock ticks. */
uint32_t PWMGenPeriodGet(uint32_t ui32Base, uint32_t ui32Gen)
/* If the update of the counter for the specified PWM generator has yet to be completed, the value returned may not be the active period. The value returned is the programmed period, measured in PWM clock ticks. */
uint32_t PWMGenPeriodGet(uint32_t ui32Base, uint32_t ui32Gen)
{
    ASSERT((ui32Base == PWM0_BASE) || (ui32Base == PWM1_BASE));
    ASSERT(_PWMGenValid(ui32Gen));
    ui32Gen = PWM_GEN_BADDR(ui32Base, ui32Gen);
    if(HWREG(ui32Gen + PWM_O_X_CTL) & PWM_X_CTL_MODE)
    {
        return(HWREG(ui32Gen + PWM_O_X_LOAD) * 2);
    }
    else
    {
        return(HWREG(ui32Gen + PWM_O_X_LOAD) + 1);
    }
}