📄 board.h
字号:
#ifndef __BOARD_H
#define __BOARD_H
#include "../inc/def.h"
#ifdef __cplusplus
extern "C"
{
#endif
extern void __ENTRY( void );
void DisableInt( void );
void EnableInt( void );
void EnterCritical( U32* );
void ExitCritical( U32* );
void outportb( U8 , U32 );
void outportw( U16 , U32 );
void outportl( U32 , U32 );
U8 inportb( U32 );
U16 inportw( U32 );
U32 inportl( U32 );
extern U32 SysRstVector;
extern U32 UdfInsVector;
extern U32 SwiSvcVector;
extern U32 InsAbtVector;
extern U32 DatAbtVector;
extern U32 ReservedVector;
extern U32 IrqSvcVector;
extern U32 FiqSvcVector;
extern char Image$$RO$$Limit[];
extern char Image$$RO$$Base[];
extern char Image$$RW$$Limit[];
extern char Image$$RW$$Base[];
extern char Image$$ZI$$Limit[];
extern char Image$$ZI$$Base[];
void CacheDisable( void );
void CacheEnable( void );
void CacheFlush( void );
#define min(x1,x2) ((x1<x2)? x1:x2)
#define max(x1,x2) ((x1>x2)? x1:x2)
void PortInit( void );
void SystemClockInit( void );
U32 GetSysClock( SysClock* );
void SetSysClockPara( void* );
void GetSysClockPara( void* );
int SetSysClock( void );
U32 GetCpuClock( void );
U32 GetMasterClock( void );
void SerialTxChar( char );
void SerialTxString( char* );
void SerialTxEmpty( void );
int SerialRxReady( void );
char SerialRxKey( void );
char SerialRxChar( void );
int SerialRxToBuf( char* );
void SerialChgBaud( U32 mclk , U32 baud ) ;
U16 SerialSwitch( U16 );
#define kbhit SerialRxReady
#define getkey SerialRxKey
#define getch SerialRxChar
#define putch SerialTxChar
#define putchar putch
#define puts SerialTxString
#define DebugOut printf
#define ERROR printf
//led,key,buzzer,etc...
void Beep( U32 time ); //蜂鸣器鸣叫
void LedSet( U32 m ); //四个LED 点亮/熄灭状态设置
void LedDisp( U32 m , U32 delay_time ); //跑马灯程序
U16 GetKeyStatus( void );
#define KEY1_DOWN() (!(GetKeyStatus()&1))
#define KEY2_DOWN() (!(GetKeyStatus()&2))
#define KEY3_DOWN() (!(GetKeyStatus()&4))
#define KEY4_DOWN() (!(GetKeyStatus()&8))
//Timer
void Delay( U32 time );
void Delay_uS( U32 us ) ; //以uS为延时单位
int WaitEventWithTimeout( int ( *event ) ( void ) , int cond , U32 ms );
//RTC timer
void RtcSetDay( TIME_STRUC* time );
void RtcSetWeek( TIME_STRUC* time );
void RtcSetTime( TIME_STRUC* time );
void RtcGetTime( TIME_STRUC* time );
void RTC_Initial( void ) ;
void RTC_Def_Time_Set( void ) ;
//extern void (*pNorFlashInit)(void);
//extern void (*pNorFlashProg)(U32, U32, U32);
void NorFlashInit( void );
void NorFlashStatusRep( void );
void NorFlashProg( U32 dst , U32 src , U32 size ) ;
#define NorFlashRead(dst, src, size) memcpy((char *)(dst), (char *)(src), (int)(size))
U32 NFSaveParams( char* pEnv );
U32 NFSearchParams( char* pEnv );
//
//extern void (*pNandFlashInit)(void);
void NandFlashInit( void );
void NandFlashStatusRep( void );
//
int LoadEnv( void );
//Nand Flash operation
int WrFileToNF( U32 , U32 );
int RdFileFrNF( U32 , U32 );
int EraseNandPart( void );
//
int XModemReceive( char* bufBase , int bufLen );
//
int BoardUsbDownload( U32 );
//
int eth_init( void );
int arp_init( void );
void tftp_main( U32 addr , U32 dummy );
//
void EnableIrq( int );
void DisableIrq( int );
void AckAndClrIrq( int );
//
void MemCfgInit( void );
//
void BoardInitStart( void );
void BoardInitEnd( void );
void BoardPrepareRun( void );
//Show boot information
void ShowBootInfo( void );
//LCD YM12864
void Lcd_YM12864_Init( void ) ;
//IDE
void IdeHardReset( void );
//Shell
void ShellIn( void );
#ifdef __cplusplus
}
#endif
#endif /*__BOARD_H*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -