有效电平与极性的概念
TIM_OCMode_Active:set output on match low_true_pulse
TIM_OCMode_Inactive:clear output on match high_true_pulse
TIM_OCMode_Toggle:toggle TIM_OCMode_Toggle
规律:
low_true_pulse 表示初始到match是有效电平。(low是前面,high是后面)
high_true_pulse 表示match到mod是有效电平。
好记住:
low_true_pulse表示前面的(初始到match)是有效电平。
high_true_pulse表示后面的(match到mod)是有效电平
理解:
set on channel match 《==等价于==》 low_true_pulse(平时为低,匹配变高--平时true,所以是low_true_pulse)
clear on channel match 《==等价于==》 high_true_pulse(平时为高,匹配变低--平时true,所以是high_true_pulse)
规则1:
low_true_pulse 表示初始到match是有效电平。
polarity=low时,初始到match为低电平,match之后为高电平。
polarity=high时,初始到match为高电平,match之后为低电平。
规则2:
high_true_pulse 表示match到mod是有效电平。
polarity=low时,match到mod为低电平,初始到match为高电平。
polarity=high时,match到mod为高电平,初始到match为低电平。