[[ファームウェア関数一覧>ファームウェア関数一覧#d5c56b4f]] *TIM_OC3Init [#n05f1acb] #contents **ヘッダ宣言 [#xa5dfbcb] **関数プロトタイプ [#he9725b9] void TIM_OC3Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct) **動作 [#f4f0a9c9] - -出力動作におけるタイマの詳細設定を行います。 **引数 [#i84df543] -TIMx&br; #include(Macro/TIMx,notitle) &br; -TIM_OCInitStruct --TIM_OCMode #include(Macro/TIM_OCMode,notitle) &br; --TIM_OutputState #include(Macro/TIM_OutputState,notitle) &br; --TIM_OutputNState #include(Macro/TIM_OutputNState,notitle) &br; --TIM_Pulse&br; キャプチャ・コンベア・レジスタ(TIMx_CCRx)の値を設定します。&br; 設定出来る値の範囲は0x0000 ~ 0xFFFFまでの間です。&br; &br; --TIM_OCPolarity #include(Macro/TIM_OCPolarity,notitle) &br; --TIM_OCNPolarity #include(Macro/TIM_OCNPolarity,notitle) &br; --TIM_OCIdleState #include(Macro/TIM_OCIdleState,notitle) &br; --TIM_OCNIdleState #include(Macro/TIM_OCNIdleState,notitle) &br; **戻り値 [#b4831877] -無し **呼び出し関数 [#i59b76c3] -無し **サンプル [#je16fb09] /* Configures the TIM1 Channel1 in PWM Mode */ TIM_OCInitTypeDef TIM_OCInitStructure; TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1; TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; TIM_OCInitStructure.TIM_OutputNState = TIM_OutputNState_Enable; TIM_OCInitStructure.TIM_Pulse = 0x7FF; TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_Low; TIM_OCInitStructure.TIM_OCNPolarity = TIM_OCNPolarity_Low; TIM_OCInitStructure.TIM_OCIdleState = TIM_OCIdleState_Set; TIM_OCInitStructure.TIM_OCNIdleState = TIM_OCIdleState_Reset; TIM_OC3Init(TIM1, &TIM_OCInitStructure); /* Configures the TIM3 Channel1 in Toggle Mode */ TIM_OCInitTypeDef TIM_OCInitStructure; TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_Toggle; TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; TIM_OCInitStructure.TIM_Pulse = 0x7FF; TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_Low; TIM_OC3Init(TIM3, &TIM_OCInitStructure); **参照 [#abd4841b] -[[RCC_APB1PeriphClockCmd]]→[[TIM_TimeBaseInit]]→[[TIM_ITConfig]]→[[TIM_Cmd]] -[[NVIC_Init]]→[[NVIC_IRQChannel]] -STMマイコン徹底入門 P. -STMマイコン徹底入門 P.141