/* Initializes the tim Channel5 according to the specified parameters in the init_struct.  */
void TIM_OC5Init(TIM_TypeDef *tim, TIM_OCInitTypeDef *init_struct)
/* Initializes the tim Channel5 according to the specified parameters in the init_struct.  */
void TIM_OC5Init(TIM_TypeDef *tim, TIM_OCInitTypeDef *init_struct)
{
    MODIFY_REG(tim->CCMR3, TIM_CCMR3_OC5M, (init_struct->TIM_OCMode) << 4);
    MODIFY_REG(tim->CCER, TIM_CCER_CC5EN | TIM_CCER_CC5P,
               (init_struct->TIM_OCPolarity << 16) | (init_struct->TIM_OutputState << 16));
    WRITE_REG(tim->CCR4, init_struct->TIM_Pulse);
    if ((tim == TIM1) || (tim == TIM8))
        MODIFY_REG(tim->CR2, TIM_CR2_OIS5, init_struct->TIM_OCIdleState << 8);
}