?? 44b_lib.h
字號:
/******************************************************************************
Copyright (c) 2006 by RockOS.
All rights reserved.
This software is supported by Rock Software Workroom.
Any bugs please contact the author with e-mail or QQ:
E-mail : baobaoba520@yahoo.com.cn
QQ : 59681888
*******************************************************************************
File name : 44b_lib.h
Description : This is the hardware management libary for QW44B0x board, the CPU
: is ARM S3C44B0x, you should write a new hwlib.h when you are
: porting RockOS to other board.
:
Auther : sunxinqiu
History :
2006-3-15 first release.
******************************************************************************/
#ifndef __44B_LIB_H__
#define __44B_LIB_H__
#ifdef __cplusplus
extern "C" {
#endif
/*****************************************************************************
* Macro constant MCLK MUST keep consist with the system MCLK frequency. The
* Fin, Fout and M_DIV, P_DIV, S_DIV are defined in file 44b.inc
*****************************************************************************/
#define MCLK 32000000
#define TICK_INT_FREQ 100
#define BAUD_DEFAULT 115200
#define Non_Cache_Start ((unsigned)0x2000000)
#define Non_Cache_End ((unsigned)0xc000000)
/* UART options */
enum
{
UART_CH0,
UART_CH1
};
enum
{
PARITY_NONE = 0,
PARITY_ODD = 4,
PARITY_EVEN = 5,
PARITY_MARK = 6,
PARITY_CLR = 7
};
/* LEDs' identifies. */
enum
{
LED1 = 0,
LED2 = 1,
LED3 = 2,
LED4 = 3,
LED5 = 4
};
enum
{
LED_OFF = 0,
LED_ON = 1
};
/* PWM timer's identifies. */
enum
{
PWM_TIMER0 = 0,
PWM_TIMER1 = 1,
PWM_TIMER2 = 2,
PWM_TIMER3 = 3,
PWM_TIMER4 = 4,
PWM_TIMER5 = 5
};
enum
{
IRQ_ADC = 0,
IRQ_RTC = 1,
IRQ_UTXD1 = 2,
IRQ_UTXD0 = 3,
IRQ_SIO = 4,
IRQ_IIC = 5,
IRQ_URXD1 = 6,
IRQ_URXD0 = 7,
IRQ_TIMER5 = 8,
IRQ_TIMER4 = 9,
IRQ_TIMER3 = 10,
IRQ_TIMER2 = 11,
IRQ_TIMER1 = 12,
IRQ_TIMER0 = 13,
IRQ_UERR01 = 14,
IRQ_WDT = 15,
IRQ_BDMA1 = 16,
IRQ_BDMA0 = 17,
IRQ_ZDMA1 = 18,
IRQ_ZDMA0 = 19,
IRQ_TICK = 20,
IRQ_EINT4567 = 21,
IRQ_EINT3 = 22,
IRQ_EINT2 = 23,
IRQ_EINT1 = 24,
IRQ_EINT0 = 25,
IRQ_GLOBAL = 26
};
#define SET_COLOR_DEFAULT() OS_printf("\x1b[0m")
#define SET_COLOR_GRAY() OS_printf("\x1b[1;30m")
#define SET_COLOR_RED() OS_printf("\x1b[1;31m")
#define SET_COLOR_GREEN() OS_printf("\x1b[1;32m")
#define SET_COLOR_YELLOW() OS_printf("\x1b[1;33m")
#define SET_COLOR_BLUE() OS_printf("\x1b[1;34m")
#define SET_COLOR_PURPLE() OS_printf("\x1b[1;35m")
#define SET_COLOR_WATER() OS_printf("\x1b[1;36m")
#define SET_COLOR_WHITE() OS_printf("\x1b[1;37m")
#define SET_COLOR_DEEP_GRAY() OS_printf("\x1b[1;40m")
void init_gpio (void);
void light_led (int led, int action);
void init_rtc (void);
void init_pwm (void);
void pwm_start (int which, int tout, int periodly);
void pwm_stop(int which);
void init_uart(void);
void set_uart_mode(int which, unsigned baud, unsigned parity);
void UART_sendChar(int which, char ch);
void UART_sendString(int which, const char * pszstring);
void init_irq(void);
void enable_irq(void);
void disable_irq(void);
void add_irq(int irq);
void del_irq(int irq);
void init_watchdog(void);
void enable_watchdog(void);
void disable_watchdog(void);
void clear_watchdog(void);
void flash_led(void);
void delay(unsigned n);
#ifdef __cplusplus
}
#endif
#endif
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -