《嵌入式系统开发与应用教程》/第五章 1. 《嵌入式系统开发与应用教程》/第五章/5.3 嵌入式C 语言程序设计基础/例程一44blib.h 例程一: “44blib.h” 以下是“44blib.h”的定义: /********************************************************************** * File: 44BLIB.H * Desc: Samsung 44B0X CPU function declare and common define **********************************************************************/ #ifndef __44BLIB_H__ #define __44BLIB_H__ #ifdef __cplusplus extern "C" { #endif //常量 本部分内容定义了一些常量 #define DebugOut Uart_Printf #define min(x1,x2) ((x1x2)? x1:x2) #define ONESEC0 (62500) //16us resolution, max 1.04 sec #define ONESEC1 (31250) //32us resolution, max 2.09 sec #define ONESEC2 (15625) //64us resolution, max 4.19 sec #define ONESEC3 (7812) //128us resolution, max 8.38 sec #define ONESEC4 (MCLK/128/(0xff+1)) //@60Mhz, 128*4us resolution, max 32.53 sec #define NULL 0 #define EnterPWDN(clkcon) ((void (*)(int))0xe0)(clkcon) #define DOWNLOAD_ADDRESS _RAM_STARTADDRESS /* 8led control register address */ #define LED8ADDR (*(volatile unsigned char *)(0x2140000)) #define LCD 0xFF #define UART 0xFE /*44blib.c 本部分内容对开发中用到的一些库函数作函数原型定义*/ void Delay(int time); //Watchdog Timer is used. void DelayMs(int ms_time); void *malloc(unsigned nbyte); void free(void *pt); void Port_Init(void); void Cache_Flush(void); void ChangeMemCon(unsigned *pMemCfg); void Uart_Select(int ch); void Uart_TxEmpty(int ch); void Uart_Init(int mclk,int baud); char Uart_Getch(void); char Uart_GetKey(void); int Uart_GetIntNum(void); void Uart_SendByte(int data); void Uart_Printf(char *fmt,...); void Uart_SendString(char *pt); void Timer_Start(int divider); //Watchdog Timer is used. int Timer_Stop(void); //Watchdog Timer is used. void Led_Display(int LedStatus)...