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

#define DELAY_2N    18


             /*------------- GLCD 크기  정의  -----------*/


             #define WIDTH       320      /* 화면  너비  (pixel 단위) */
             #define HEIGHT      240      /* 화면  높이  (pixel 단위) */
             #define BPP         16        /* 비트당  픽셀  */
             #define BYPP   ((BPP+7)/8)    /* 바이트당  픽셀*/


             /*------ GLCD 인터페이스  하드웨어  정의  ----*/


             #define SPI_START   (0x70)    /* Start byte for SPI transfer*/
             #define SPI_RD       (0x01)    /* WR bit 1 within start*/
             #define SPI_WR      (0x00)    /* WR bit 0 within start*/
             #define SPI_DATA    (0x02)   /* RS bit 1 within start byte*/
             #define SPI_INDEX   (0x00)   /* RS bit 0 within start byte*/

             /*------------- Global variables -----------------*/


             static volatile unsigned short TextColor = Black, BackColor = White;
             unsigned short DeviceCode;


             static void delay (int cnt) {           //delay함수


               cnt <<= DELAY_2N;
               while (cnt--);
             }


             __inline void wr_dat (unsigned short c) {       //LCD제어  데이터


                     Set_Rs;
                     Set_nRd;
                     GPIOE->ODR = c;
                     Clr_nWr;
                     Set_nWr;
             }


             __inline void wr_cmd (unsigned char c) {        //LCD제어  명령


                     Clr_Rs;



                                                         -  829  -
   831   832   833   834   835   836   837   838   839   840   841