摘要
在分析C程序和C++程序特点的基础上,以单片机系统多串口设备驱动程序的模块化设计为例,提出一种采用类设计思想,实现C程序模块封装的方案,以提高程序设计质量。该方法适用于嵌入式操作系统、设备驱动程序等复杂的C程序设计,特别是基于单片机系统等无法使用C++语言编程的驱动程序。
A design of module encapsulation of C programs by using class programming is proposed in this paper, based on analyzing the characteristics of C and C++ programs and illustrated by module encapsulation of multiple serial ports driver programming in single-chip computer system in order to improve the quality of programs. This approach can be used for complicated C programming such as embedded operating system, device driver design, especially when driver programming in which C++ is not available in some single-chip computer system.
出处
《光电子技术与信息》
2003年第6期44-48,共5页
Optoelectronic Technology & Information
关键词
程序设计
模块封装
单片机系统
串口驱动程序
programming
module encapsulation
single-chip computer system
serial port driver