[[ファームウェア関数一覧>ファームウェア関数一覧#d5c56b4f]] *TIM_OC4Init [#v7f4b434] #contents **ヘッダ宣言 [#u06ea261] **関数プロトタイプ [#x146d993] void TIM_OC4Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct) **動作 [#n8b01cb2] -出力動作におけるタイマの詳細設定を行います。 **引数 [#q0d77813] -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; **戻り値 [#y7b3888e] -無し **呼び出し関数 [#l0f556da] -無し **サンプル [#w7e84a0c] /* Configures the TIM1 Channel4 in PWM Mode */ TIM_OCInitTypeDef TIM_OCInitStructure; TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1; TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; TIM_OCInitStructure.TIM_Pulse = 0x7FF; TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_Low; TIM_OCInitStructure.TIM_OCIdleState = TIM_OCIdleState_Set; TIM_OC4Init(TIM1, &TIM_OCInitStructure); /* Configures the TIM3 Channel4 in PWM Mode */ TIM_OCInitTypeDef TIM_OCInitStructure; TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1; TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; TIM_OCInitStructure.TIM_Pulse = 0x7FF; TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_Low; TIM_OC4Init(TIM3, &TIM_OCInitStructure); **参照 [#h4f334ab] -[[RCC_APB1PeriphClockCmd]]→[[TIM_TimeBaseInit]]→[[TIM_ITConfig]]→[[TIM_Cmd]] -[[NVIC_Init]]→[[NVIC_IRQChannel]] -STMマイコン徹底入門 P. -STMマイコン徹底入門 P.141