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

}



             void  USART1_Configuration(void)  //  RFID  Reader  Connection
             {

                    USART_InitTypeDef  USART_InitStructure;
                    USART_InitStructure.USART_BaudRate                        =  9600;
                    USART_InitStructure.USART_WordLength             = USART_WordLength_8b;
                    USART_InitStructure.USART_StopBits                =  USART_StopBits_1;
                    USART_InitStructure.USART_Parity                   = USART_Parity_No;

                    USART_InitStructure.USART_HardwareFlowControl  =  USART_HardwareFlowControl_None;
                    USART_InitStructure.USART_Mode                     =  USART_Mode_Rx  | USART_Mode_Tx;
                    USART_Init(USART1,  &USART_InitStructure);

                    USART_ITConfig(USART1,  USART_IT_RXNE,  ENABLE);  //enable
                    USART_Cmd(USART1,  ENABLE);


                  NVIC_EnableIRQ(USART1_IRQn);
             }



               void  USART2_Configuration(void) //  Raspberry Pi  UART Connection
             {
                    USART_InitTypeDef  USART_InitStructure;

                    USART_InitStructure.USART_BaudRate                        =  115200;
                    USART_InitStructure.USART_WordLength             = USART_WordLength_8b;
                    USART_InitStructure.USART_StopBits                =  USART_StopBits_1;
                    USART_InitStructure.USART_Parity                   = USART_Parity_No ;
                    USART_InitStructure.USART_HardwareFlowControl  =  USART_HardwareFlowControl_None;

                    USART_InitStructure.USART_Mode                     =  USART_Mode_Rx  | USART_Mode_Tx;
                    USART_Init(USART2,  &USART_InitStructure);
                    USART_ITConfig(USART2,  USART_IT_RXNE,  ENABLE);

                    USART_Cmd(USART2,  ENABLE);


                  NVIC_EnableIRQ(USART2_IRQn);
             }
             void USART1_IRQHandler(void) //  RFID value read!

             {
                  int rfidValuePointNumber  =  0;    //  loop  value




                                                         -  587  -
   589   590   591   592   593   594   595   596   597   598   599