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

📄 dataperstruct.h

📁 zilog的实时操作系统RZK,可以移植到多种处理器上
💻 H
字号:
/*
 * File       : DataPerStruct.h
 * Description: This file contains the data structures required for
 *				data persistance of different values.
 * Author     : Mahadev K C
 * Created on : 3-FEB-2005
 *
 * Copyright 2004-2005 ZiLOG Inc.  ALL RIGHTS RESERVED.
 *
 * This file contains unpublished confidential and proprietary information
 * of ZiLOG, Inc.
 * NO PART OF THIS WORK MAY BE DUPLICATED, STORED, PUBLISHED OR DISCLOSED 
 * IN ANY FORM WITHOUT THE PRIOR WRITTEN CONSENT OF ZiLOG, INC.
 * This is not a license and no use of any kind of this work is authorized
 * in the absence of a written license granted by ZiLOG, Inc. in ZiLOG's 
 * sole discretion 
 */
/*
 * Revision History:
 * MKC: CR# 5449: The fields in DATA_PER_t are changed to contain the values
 *  in network foromat and not in string format.
 */

#ifndef _DATAPERSTRUCT_H_
#define _DATAPERSTRUCT_H_

/*
 * standard header files
 */
#include <stdio.h>

/*
 * system header files
 */
#include "ZSysgen.h"
#include "ZTypes.h"


/*
 * data structure that contains different fields to store values required
 * by ZTP data persistence
 */
/*
typedef struct {
	UINT8 c_EmacAddr[6] ;
	UINT8 c_IsDhcpEnabled ;
	UINT32 ul_IPAddr ;
	UINT32 ul_NetMask ;
	UINT32 ul_GateWay ;
	UINT8 c_userdata[ 128 ] ;
} DATA_PER_t, *PDATA_PER_t ;
*/
typedef struct {           //gym modify  2006.10.19
	UINT8 c_EmacAddr[6] ;
	UINT8 c_IsDhcpEnabled ;
	UINT32 ul_IPAddr ;
	UINT32 ul_NetMask ;
	UINT32 ul_GateWay ;
	UINT32 ul_DNSServer;
	UINT32 ul_ListenPort;
	UINT8  c_EnablePing[2];
	UINT8  c_userdata[ 128 ] ;
} DATA_PER_t, *PDATA_PER_t ;

/*
 * data structure that contains different driver entry functions required
 * to write the values into FLASH/STORAGE device
 */
// driver related functions
typedef INT (*DEV_INIT)( void *paddr, UINT32 num_bytes ) ;
typedef INT32 (*DEV_READ)( void *paddr, void *pbuf, UINT num_bytes ) ;
typedef INT32 (*DEV_WRITE)( void *paddr, void *pbuf, UINT num_bytes ) ;
typedef INT (*DEV_ERASE)( void *paddr, UINT32 num_bytes ) ;
typedef INT (*DEV_CLOSE)( void ) ;

typedef struct  {
	void *      p_start_addr ;	/* start address of the location where data
								   need to be stored */
	UINT32      ul_size ;       /* size of the eraseable block */
	DEV_INIT	pfn_dev_init ;  
	DEV_READ	pfn_dev_read ;
	DEV_WRITE	pfn_dev_write ;
	DEV_ERASE	pfn_dev_erase ;
	DEV_CLOSE	pfn_dev_close ;

} DATA_PER_CFG_t, *PDATA_PER_CFG_t ;


/*
 * extern variables
 */
extern DATA_PER_CFG_t g_data_per_cfg ;

/*
 * API prototypes:
 */
INT8 GetDataPersistence( PDATA_PER_t p_data_per ) ;
INT8 SetDataPersistence( PDATA_PER_t p_data_per ) ;
UINTRMASK Per_DI( void ) ;
void Per_EI( UINTRMASK  ) ;
/*
 * Support functions
 */
UINT8 ValidateNConvertEmacAddress( INT8 *psz_emac, INT8 *p_emac_addr ) ;
UINT8 Validate_IP_Params( PDATA_PER_t pst_data_per ) ;


#endif

⌨️ 快捷键说明

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