Page 281 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 281
}
}
}
uint16_t USART1_ReceiveData()
{
while (!(USART1->SR & USART_FLAG_RXNE));
return (uint16_t)(USART1->DR & (uint16_t)0x01FF);
}
uint16_t USART2_ReceiveData()
{
while (!(USART2->SR & USART_FLAG_RXNE));
return (uint16_t)(USART2->DR & (uint16_t)0x01FF);
}
iii. 수신된 RFID값을 다른 문자열로 대치하여 출력함과 동시에 USART1번을 통해 라즈베리 파
이로 수신하는 프로그램+@(총 가격 계산 등)(테스트 프로그램)
바뀐 부분을 위주로 설명하겠다.
1. main.c
#include "stm32f10x.h"
#include "USART.h"
#include "GLCD.h"
#include "INTERRUPT.h"
#define Black 0x0000 /* 0, 0, 0 */
#define Navy 0x000F /* 0, 0, 128 */
#define DarkGreen 0x03E0 /* 0, 128, 0 */
#define DarkCyan 0x03EF /* 0, 128, 128 */
#define Maroon 0x7800 /* 128, 0, 0 */
#define Purple 0x780F /* 128, 0, 128 */
#define Olive 0x7BE0 /* 128, 128, 0 */
#define LightGrey 0xC618 /* 192, 192, 192 */
#define DarkGrey 0x7BEF /* 128, 128, 128 */
#define Blue 0x001F /* 0, 0, 255 */
#define Green 0x07E0 /* 0, 255, 0 */
#define Cyan 0x07FF /* 0, 255, 255 */
#define Red 0xF800 /* 255, 0, 0 */
- 274 -