⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 netbox.h

📁 一个PPP上网协议源码,可通过GPRS网络接入因特网.
💻 H
字号:
#if !defined( _NB2003_H )
#define _NB2003_H

/*///////////////////////////////////////////////////////////
input:
   (1) CSIndex = 0: for CS0#; = 1: for CS1#
   (2) BufSize = 2, 4, 8 in KByte(1024)
   (3) WaitStates = 1 - 31. 1 wait state = 83ns
return:
   a far pointer to the beginning of selected memory
///////////////////////////////////////////////////////////*/
char far* SetCSAsMem( unsigned CSIndex, unsigned BufSize, unsigned WaitStates );

/*///////////////////////////////////////////////////////////
input:
   (1) CSIndex = 0: for CS0#; = 1: for CS1#
   (2) BasePort = not used IO port, 0x200-0x3FF
       default setting: CS0#: 0x300 - 0x301
			CS1#: 0x360 - 0x37F
   (3) IOSize = 2, 4, 8, 16, 32, 64 in byte
   (4) WaitStates = 1 - 31. 1 wait state = 42ns
///////////////////////////////////////////////////////////*/
int SetCSAsIO( unsigned CSIndex, unsigned BasePort,
	       unsigned IOSize, unsigned WaitStates );

/*///////////////////////////////////////////////////////////
input:
   (1) seconds: watch dog interval in seconds
///////////////////////////////////////////////////////////*/
int EnableWDT( float seconds );		// Watchdog setup
int ReloadWDT();			// Watchdog reload

/*///////////////////////////////////////////////////////////
return = 0: normal boot
       = 1: system boot by watch dog

NOTE: call only once
///////////////////////////////////////////////////////////*/
int  GetBootState( );

void         NB_Delay( unsigned int milliseconds );
void         SysReboot( );
unsigned int ReadTimer0( );

int  EnterPowerSaveMode( );

/*///////////////////////////////////////////////////////////
// enable GPIO; address bus A5 - A12 disabled
///////////////////////////////////////////////////////////*/
void EnableGPIO( );

/*///////////////////////////////////////////////////////////
// enable address bus A5 - A12; GPIO disabled
///////////////////////////////////////////////////////////*/
void AddressEnable( );

/*///////////////////////////////////////////////////////////
input:
   (1) DirByte.D0-D7 = 0: set as output bit;
       DirByte.D0-D7 = 1: set as input bit; default setting
///////////////////////////////////////////////////////////*/
void CfgGPIODir( unsigned char DirByte );
void SetGPIO( unsigned char OutByte );
unsigned char GetGPIO( );

/*///////////////////////////////////////////////////////////
// 4X5 keypad enabled (default setting)
///////////////////////////////////////////////////////////*/
void KeypadEnable( );

/*///////////////////////////////////////////////////////////
// KIN[0..3] as DI
// KOUT[0..4] as DO
///////////////////////////////////////////////////////////*/
void KIOasDIO( );

/*///////////////////////////////////////////////////////////
// expanded keypad enabled
///////////////////////////////////////////////////////////*/
void ExpandKeyEnable( );

/*///////////////////////////////////////////////////////////
// KOUT4 = COMCLK = 1.846MHz
///////////////////////////////////////////////////////////*/
void ComclkEnable( );

/*///////////////////////////////////////////////////////////
// KOUT3 = 24MHz
///////////////////////////////////////////////////////////*/
void CLK24MEnable( );

/*///////////////////////////////////////////////////////////
// SPI interface enable
// input: Mode = 4: 4-wire;
//        Mode = 3: 3-wire; connect KIN0 & KOUT0 together
// KIN0 = DIN		KOUT0 = DOUT
// KIN1 = BUSY		KOUT1 = SCLK
// KIN2 = INTR#         KOUT2 = CS#
///////////////////////////////////////////////////////////*/
void SPI_Enable( );

void SetIQR7AsDOUT( int L10 );	// normally as GPRS_AUX
void SetIRQ6AsDOUT( int L10 );	// normally as GPRS_STB
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -