嵌入式C语言(44blib)

本文详细介绍了基于三星SC2410平台的RAM开发过程中的基础库实现方法,包括延迟函数、内存分配、端口初始化等核心功能,并提供了具体的函数定义与使用说明。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值