As well as the ARR register, there are four Capture/Compare channels, each with its own register, CCR1, CCR2, CCR3, CCR4. These are also compared continuously with the value in the CNT register and each can be configured for a variety of behaviours when there is a match. Note that a...
Status StartCompareTimer(int channel, int ticks) { Status status = OK; switch (channel) { case TIMER_CHANNEL_1: TIM_SetCompare1(COMPARE_TIMER, (uint16_t) (TIM_GetCounter(COMPARE_TIMER) + ticks)); break; case TIMER_CHANNEL_2: TIM_SetCompare2(COMPARE_TIMER, (uint16_t) (TIM_GetCounter...
capture = TIM_GetCapture4(TIM3); TIM_SetCompare4(TIM3, capture + CCR4_Val); } } 开发者ID:DerekTan,项目名称:STM32F107_ucosIII,代码行数:39,代码来源:stm32f10x_it.c 示例4: TIM_GetCapture1 ▲点赞 1▼ uint16_tServo::readMicroseconds()const{if(!this->attached()) {return0; }uint16_t...