108 lines
4.4 KiB
C
108 lines
4.4 KiB
C
|
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
|
||
|
|
||
|
File: OCTVC1_FILE.h
|
||
|
|
||
|
Copyright (c) 2014 Octasic Inc. All rights reserved.
|
||
|
|
||
|
Description:
|
||
|
|
||
|
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
|
||
|
Octasic_Release: OCTSDR-2G-01.08.05-B29-ALPHA (2014/08/14)
|
||
|
|
||
|
$Revision: $
|
||
|
|
||
|
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
|
||
|
|
||
|
#ifndef __OCTVC1_FILE_H__
|
||
|
#define __OCTVC1_FILE_H__
|
||
|
|
||
|
|
||
|
/***************************** INCLUDE FILES *******************************/
|
||
|
#include "../octdev_types.h"
|
||
|
|
||
|
|
||
|
/************************ COMMON DEFINITIONS *******************************/
|
||
|
|
||
|
/*-------------------------------------------------------------------------------------
|
||
|
File Header endian magic
|
||
|
"\x7F""OCT".
|
||
|
0x54434F7F on little endian machine.
|
||
|
0x7F4F4354 on big endian machine
|
||
|
-------------------------------------------------------------------------------------*/
|
||
|
#define cOCTVC1_FILE_MAGIC_BIG_ENDIAN 0x7F4F4354
|
||
|
#define cOCTVC1_FILE_MAGIC_LITTLE_ENDIAN 0x54434F7F
|
||
|
/*-------------------------------------------------------------------------------------
|
||
|
tOCTVC1_FILE_TYPE_ENUM : File Type description
|
||
|
-------------------------------------------------------------------------------------*/
|
||
|
#define tOCTVC1_FILE_TYPE_ENUM tOCT_UINT32
|
||
|
|
||
|
#define cOCTVC1_FILE_TYPE_ENUM_NONE 0
|
||
|
#define cOCTVC1_FILE_TYPE_ENUM_TEXT 1
|
||
|
#define cOCTVC1_FILE_TYPE_ENUM_BIN 1
|
||
|
|
||
|
/*-------------------------------------------------------------------------------------
|
||
|
tOCTVC1_FILE_FORMAT_ENUM : File Type description
|
||
|
-------------------------------------------------------------------------------------*/
|
||
|
#define tOCTVC1_FILE_FORMAT_ENUM tOCT_UINT32
|
||
|
|
||
|
#define cOCTVC1_FILE_FORMAT_ENUM_NONE 0
|
||
|
#define cOCTVC1_FILE_FORMAT_ENUM_LOG 1
|
||
|
|
||
|
/*-------------------------------------------------------------------------------------
|
||
|
File Header Type
|
||
|
-------------------------------------------------------------------------------------*/
|
||
|
#define cOCTVC1_FILE_TYPE_BIT_OFFSET 24
|
||
|
#define cOCTVC1_FILE_TYPE_BIT_MASK 0xFF000000
|
||
|
|
||
|
/*-------------------------------------------------------------------------------------
|
||
|
File Header Format Version
|
||
|
-------------------------------------------------------------------------------------*/
|
||
|
#define cOCTVC1_FILE_FORMAT_VERSION_BIT_OFFSET 16
|
||
|
#define cOCTVC1_FILE_FORMAT_VERSION_BIT_MASK 0x00FF0000
|
||
|
|
||
|
/*-------------------------------------------------------------------------------------
|
||
|
File Header Format
|
||
|
-------------------------------------------------------------------------------------*/
|
||
|
#define cOCTVC1_FILE_FORMAT_BIT_OFFSET 0
|
||
|
#define cOCTVC1_FILE_FORMAT_BIT_MASK 0x0000FFFF
|
||
|
|
||
|
/*-------------------------------------------------------------------------------------
|
||
|
File Header Size
|
||
|
-------------------------------------------------------------------------------------*/
|
||
|
#define cOCTVC1_FILE_HEADER_SIZE_BIT_OFFSET 0
|
||
|
#define cOCTVC1_FILE_HEADER_SIZE_BIT_MASK 0x0000FFFF
|
||
|
/*-------------------------------------------------------------------------------------
|
||
|
tOCTVC1_FILE_HEADER
|
||
|
Generic file header
|
||
|
|
||
|
Members:
|
||
|
ulMagic
|
||
|
Default: cOCTVC1_FILE_MAGIC_BIG_ENDIAN
|
||
|
Magic file number.
|
||
|
"\x7F""OCT".
|
||
|
0x54434F7F on little endian machine.
|
||
|
0x7F4F4354 on big endian machine
|
||
|
ul_Type_Ver
|
||
|
bits[31:24] = File Type.
|
||
|
bits[23:16] = File Format Version.
|
||
|
bits[15:0] = File Format.
|
||
|
ulReserved
|
||
|
ulHeaderSize
|
||
|
Header size with padding. This indicate where the file payload start (in byte).
|
||
|
bits[31:16] = Reserved.
|
||
|
bits[15:0] = Header Size with padding.
|
||
|
-------------------------------------------------------------------------------------*/
|
||
|
typedef struct
|
||
|
{
|
||
|
tOCT_UINT32 ulMagic;
|
||
|
tOCT_UINT32 ul_Type_Ver;
|
||
|
tOCT_UINT32 ulReserved;
|
||
|
tOCT_UINT32 ulHeaderSize;
|
||
|
|
||
|
} tOCTVC1_FILE_HEADER;
|
||
|
|
||
|
|
||
|
#endif /* __OCTVC1_FILE_H__ */
|
||
|
|