资深版主
 
- 积分
- 5781
- 金钱
- 5781
- 注册时间
- 2013-11-22
- 在线时间
- 1212 小时
|
发表于 2015-9-26 18:27:40
|
显示全部楼层
回复【3楼】a85921819:
---------------------------------
不好意思 之前看错了 你可以点开TIM_DMAConfig()函数 里面配置的就是DMA连续传送长度和DMA 基地址 默认长度一个字节 以及基地址TIMx_CR1
如果你要配置TIM1的DMA搬运CCR1, 1个字节长度 那么你可以配置TIM_DMAConfig(TIM1,TIM_DMABase_CCR1,TIM_DMABurstLength_1Transfer);
具体的配置可以看这个函数的注释
/**
* @brief Configures the TIMx's DMA interface.
* @param TIMx: where x can be 1, 2, 3, 4, 5, 8, 15, 16 or 17 to select
* the TIM peripheral.
* @param TIM_DMABase: DMA Base address.
* This parameter can be one of the following values:
* @arg TIM_DMABase_CR, TIM_DMABase_CR2, TIM_DMABase_SMCR,
* TIM_DMABase_DIER, TIM1_DMABase_SR, TIM_DMABase_EGR,
* TIM_DMABase_CCMR1, TIM_DMABase_CCMR2, TIM_DMABase_CCER,
* TIM_DMABase_CNT, TIM_DMABase_PSC, TIM_DMABase_ARR,
* TIM_DMABase_RCR, TIM_DMABase_CCR1, TIM_DMABase_CCR2,
* TIM_DMABase_CCR3, TIM_DMABase_CCR4, TIM_DMABase_BDTR,
* TIM_DMABase_DCR.
* @param TIM_DMABurstLength: DMA Burst length.
* This parameter can be one value between:
* TIM_DMABurstLength_1Transfer and TIM_DMABurstLength_18Transfers.
* @retval None
*/
void TIM_DMAConfig(TIM_TypeDef* TIMx, uint16_t TIM_DMABase, uint16_t TIM_DMABurstLength)
{
/* Check the parameters */
assert_param(IS_TIM_LIST4_PERIPH(TIMx));
assert_param(IS_TIM_DMA_BASE(TIM_DMABase));
assert_param(IS_TIM_DMA_LENGTH(TIM_DMABurstLength));
/* Set the DMA Base and the DMA Burst Length */
TIMx->DCR = TIM_DMABase | TIM_DMABurstLength;
} |
|