Page 239 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 239

sMasterConfig.MasterOutputTrigger  =  TIM_TRGO_RESET;
                sMasterConfig.MasterSlaveMode  =  TIM_MASTERSLAVEMODE_DISABLE;

                if  (HAL_TIMEx_MasterConfigSynchronization(&htim4,  &sMasterConfig)  !=  HAL_OK)
               {
                 Error_Handler();
               }



                sConfigOC.OCMode = TIM_OCMODE_PWM1;
                sConfigOC.Pulse  =  0;
               sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
               sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
                if  (HAL_TIM_PWM_ConfigChannel(&htim4,  &sConfigOC,  TIM_CHANNEL_1)  !=  HAL_OK)

               {
                 Error_Handler();
               }



                if  (HAL_TIM_PWM_ConfigChannel(&htim4,  &sConfigOC,  TIM_CHANNEL_2)  !=  HAL_OK)
               {
                 Error_Handler();
               }


                HAL_TIM_MspPostInit(&htim4);



            }


            /*  USART2  init  function  */

            static  void  MX_USART2_UART_Init(void)
            {


                huart2.Instance  =  USART2;
                huart2.Init.BaudRate  =  115200;
                huart2.Init.WordLength  =  UART_WORDLENGTH_8B;

               huart2.Init.StopBits = UART_STOPBITS_1;
               huart2.Init.Parity = UART_PARITY_NONE;
               huart2.Init.Mode = UART_MODE_TX_RX;
                huart2.Init.HwFlowCtl  =  UART_HWCONTROL_NONE;





                                                         -  232  -
   234   235   236   237   238   239   240   241   242   243   244