RAM开发中,对于以三星SC2410开发平台,为例子介绍实际的开发。比较重要的是基础库。以下做以介绍:
1,44blib.h
//===========================================================
/***
* @file : 44blib.h
*
* 44blib.h v1.0 Samsung 44B0X CPU function declara and common define
*
* @author : daihw 2007/05/14
*/
//===========================================================
#ifndef __44BLIB_H__
#define __44BLIB_H__
#ifdef (__cpluscplus)
extern "C" {
#endif
//define const
#define DebugOut Uart_Printf
#define min(x1,x2) ((x1<x2)?x1:x2)
#define max(x1,x2)((x1>x2)?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
/* 8 led control register address */
#define LED8ADDR (*(volatitle unsigned char * ) (0x2140000))
#define LCD oxFF
#define UART oxFE
/*define libaray function */
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);
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 Uart_SendString (char *pt);
void Timer_Start(int divider);
int Timer_Stop(void);
void Led_Display (int LedStatus);
void Beep(int BeepStatus);
void ChangePllValue (int m,int p,int s);
#endif