2017년도 1학기 중앙대학교 전자전기공학부 4학년 마이크로프로세서응용회로설계실습 결과보고서 [5주차]clcd-mm.c 코드 해석
- 최초 등록일
- 2017.06.25
- 최종 저작일
- 2017.05
- 7페이지/ 한컴오피스
- 가격 1,000원
목차
1. clcd_mm.c 파일 코드 해석
2. 추가 과제 코드 해석
본문내용
[1] clcd_mm.c 파일 코드 해석
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <asm/fcntl.h>
#include <string.h>
// 헤더파일을 선언합니다. 새롭게 등장한 string.h 라는 헤더파일이 있습니다. 이 헤더파일은 strlen과 strcpy 함수에 대한 정보를 담고 있습니다.
#define FPGA_CLCD_WR 0x12300000
#define FPGA_CLCD_RS 0x12380000
// FPGA_CLCD_WR과 FPGA_CLCD_RS의 물리적 주소를 정의해줍니다. WR은 Write/Read를 의미하며, RS는 Resister Select를 의미합니다.
static void setcommand(unsigned short command);
static void initialize_clcd(void);
static void function_set(int DL, int N, int F);
static void display_control(int D, int C, int B);
static void cursor_shift(int set_screen, int set_rightshift);
static void entry_mode_set(int ID, int S);
static void return_home(void);
static void clcd_clear(void);
static void set_RAM_address(int pos, int CG_or_DD);
static void clcd_exit(void);
void write_byte(char ch);
// 여러 가지 함수를 선언해줍니다. 각각의 함수에 대한 설명은 밑에서 하도록 하겠습니다.
unsigned short *CLCD_CMD, *CLCD_DATA;
int fd;
// 물리적 주소를 가상 주소에 대응시킬 때 사용되는 변수들을 선언해줍니다.
int main(int argc, char **argv)
// 두 개의 변수는 main함수에 전달되는 정보를 담게 되는 변수입니다. **argv 대신 *argv[]를 쓸수도 있습니다.
참고 자료
없음