📄 uart_ev44b0.h
字号:
/*
* MICETEK International Inc., (shanghai)
* By Qinwei , 2003.05.28 (CopyRight)
*
* Version 0.1
*/
#ifndef __UART_EV4510_
#define __UART_EV4510_
int port_init(int ch);
int dev_uart_init (int sys_clock, int reg_base, int ch);
//dev_uart_init returns non-negative number on succuess, 0 on failing.
int crtio (int baund);
//crtio returns the old baund rate on success, 0 on failing.
void outbyte (int);
//outbyte returns the written char on success or EOF on failing.
int inbyte (void);
//inbyte returns the byte it reads on success or EOF on failing.
#define _ISR_STARTADDRESS 0xc7fff00 //GCS6:64M DRAM/SDRAM
//S3C44B0 uart register
void Delay(int time);
#define ULCON 0x0
#define UCON 0x4
#define UFCON 0x8
#define UMCON 0xC
#define UTRSTAT 0x10
#define UERSTAT 0x14
#define UFSTAT 0x18
#define UMSTAT 0x1C
#define UTXH 0x20
#define URXH 0x24
#define UBRDIV 0x28
//clock register
#define PLLCON 0x01D80000
#define DTR 0x00000010
#define RDV 0x00000001
#define TH_empty 0x00000002
#define TC 0x00000080
/* ISR */
#define pISR_EINT4567 (*(unsigned *)(_ISR_STARTADDRESS+0x74))
#define pISR_EINT3 (*(unsigned *)(_ISR_STARTADDRESS+0x78))
#define pISR_EINT2 (*(unsigned *)(_ISR_STARTADDRESS+0x7c))
#define pISR_EINT1 (*(unsigned *)(_ISR_STARTADDRESS+0x80))
#define pISR_EINT0 (*(unsigned *)(_ISR_STARTADDRESS+0x84))
//USE MCLK 40M
#define B9600 259
#define B19200 129
#define B38400 64
#define B57600 42
#define B115200 21
/* PENDING BIT */
//CAUTION:You must clear the pending bit as general special register.
// it's different way with KS32C6x00
#define BIT_ADC (0x1)
#define BIT_RTC (0x1<<1)
#define BIT_UTXD1 (0x1<<2)
#define BIT_UTXD0 (0x1<<3)
#define BIT_SIO (0x1<<4)
#define BIT_IIC (0x1<<5)
#define BIT_URXD1 (0x1<<6)
#define BIT_URXD0 (0x1<<7)
#define BIT_TIMER5 (0x1<<8)
#define BIT_TIMER4 (0x1<<9)
#define BIT_TIMER3 (0x1<<10)
#define BIT_TIMER2 (0x1<<11)
#define BIT_TIMER1 (0x1<<12)
#define BIT_TIMER0 (0x1<<13)
#define BIT_UERR01 (0x1<<14)
#define BIT_WDT (0x1<<15)
#define BIT_BDMA1 (0x1<<16)
#define BIT_BDMA0 (0x1<<17)
#define BIT_ZDMA1 (0x1<<18)
#define BIT_ZDMA0 (0x1<<19)
#define BIT_TICK (0x1<<20)
#define BIT_EINT4567 (0x1<<21)
#define BIT_EINT3 (0x1<<22)
#define BIT_EINT2 (0x1<<23)
#define BIT_EINT1 (0x1<<24)
#define BIT_EINT0 (0x1<<25)
#define BIT_GLOBAL (0x1<<26)
#endif //__UART_EV4510_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -