Page 529 - MDP2020-1
P. 529

················································································  명장양성프로젝트  【MDP】  과제발표회  자료집  Ⅰ    |  523


            /**
                *  @brief  GPIO  Initialization  Function
                *  @param  None
                *  @retval  None

                */
            static  void  MX_GPIO_Init(void)
            {
                GPIO_InitTypeDef  GPIO_InitStruct  =  {0};



                /*  GPIO  Ports  Clock  Enable  */
                __HAL_RCC_GPIOA_CLK_ENABLE();
                __HAL_RCC_GPIOE_CLK_ENABLE();


                /*Configure  GPIO  pin  Output  Level  */

                HAL_GPIO_WritePin(GPIOA,  GPIO_PIN_1,  GPIO_PIN_RESET);


                /*Configure  GPIO  pin  :  PA0  */
                GPIO_InitStruct.Pin  =  GPIO_PIN_0;

                GPIO_InitStruct.Mode  =  GPIO_MODE_IT_RISING;
                GPIO_InitStruct.Pull  =  GPIO_NOPULL;
                HAL_GPIO_Init(GPIOA,  &GPIO_InitStruct);


                /*Configure  GPIO  pin  :  PA1  */
                GPIO_InitStruct.Pin  =  GPIO_PIN_1;

                GPIO_InitStruct.Mode  =  GPIO_MODE_OUTPUT_PP;
                GPIO_InitStruct.Pull  =  GPIO_NOPULL;
                GPIO_InitStruct.Speed  =  GPIO_SPEED_FREQ_LOW;
                HAL_GPIO_Init(GPIOA,  &GPIO_InitStruct);



            }


            /*  USER  CODE  BEGIN  4  */
            void  HAL_GPIO_EXTI_Callback(uint16_t  GPIO_Pin)
            {

                    if(GPIO_Pin  ==  GPIO_PIN_0){
                                    HAL_UART_Transmit(&huart1,  (uint8_t  *)tx_buffer,    tx_buffer_size,
            0xffff);


                    }

            }
            /*  USER  CODE  END  4  */
   524   525   526   527   528   529   530   531   532   533   534