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

if(USART_GetITStatus(USART2,  USART_IT_RXNE)  !=RESET)
                    {
                                Usart2_rfid();
                                USART_ClearITPendingBit(USART2,  USART_IT_RXNE);
                    }
            }


            uint16_t  USART1_ReceiveData()
            {
                while  (!(USART1->SR  &  USART_FLAG_RXNE));  //받을준비완료=0일시  교착
                return  (uint16_t)(USART1->DR  &  (uint16_t)0x01FF);
                //받을준비완료=1이면  이  항목으로  내려와  DR값을  리턴함.
            }


            uint16_t  USART2_ReceiveData()
            {
                while  (!(USART2->SR  &  USART_FLAG_RXNE));
                return  (uint16_t)(USART2->DR  &  (uint16_t)0x01FF);
            }


            3)GLCD.c
            #include  "stm32f10x.h"
            #include  "GLCD.h"
            #include  "font.h"


            unsigned int text;
            unsigned int back;
            unsigned short DeviceCode;


            void  GLCD_init  (void)
            {
                /*  Enable  clock  for  GPIOA,B,C,D,E  AFIO  and  SPI3.  */
                RCC->APB2ENR  |=  0x0000007D;


               /*  NCS is  PB2, GPIO  output  set to  high.  */
                GPIOE->CRL  =  0x33333333;          //
                GPIOE->CRH  =  0x33333333;


                GPIOD->CRH  &=  0x0000ffff;          //PD12,PD13,14,15
                GPIOD->CRH  |=  0x33330000;






                                                         -  714  -
   716   717   718   719   720   721   722   723   724   725   726