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

📄 nf_file.h

📁 通过车载终端采集GPS数据
💻 H
字号:
/*H**************************************************************************
* NAME:         bus_info.h        
*----------------------------------------------------------------------------
* Copyright (c) 
*----------------------------------------------------------------------------
* RELEASE:            
* REVISION:       
*----------------------------------------------------------------------------
* PURPOSE:
* This file contains the NF driver definitions
*****************************************************************************/
#ifndef BUS_INFORMATION
#define BUS_INFORMATION

#include "typedef.h"

#define ZONE_ONELINESIZE 0x00200000

//定义程序所在的基址
#define ZONE_PROGRAM_BASEADDR 0x00c80000
#define ONEBLOCK_SIZE 16384//32*512
#define PROGRAMBUF_NUMBER 4
typedef struct _program_bufpoint
{
    Uint32 curBlock;//当前所在的块,为实际的字节地址
    Byte bufvalid;//当前有几个buf中未写的数据
    Uint32 offset[PROGRAMBUF_NUMBER];//每个buf中对应的偏移地址
    Byte bufLen[PROGRAMBUF_NUMBER];
}PROGRAM_BUFPOINT;

/*******************定义各区域的起始地址****************************/
#define ZONE_HEAD 0x00000000 //文件头
#define ZONE_ADVERTIZE 0x00000400 //广告文字
#define ZONE_FIXEDTONE 0x00000600 //256条固定服务语音
#define ZONE_POSITIONDATA 0x00000800 //报站位置数据
#define ZONE_TONEPOINTER 0x00001000 //语音指针
#define ZONE_STATIONDATA 0x00002000 //上下行车站数据
#define ZONE_LINEDATA 0x00003000 //线路位置数据
#define ZONE_TONEARRAY 0x00005000 //语音串
#define ZONE_REVERSED 0x00006000 //保留
#define ZONE_TONEBASE 0x00010000 //语音库

#define KEY_SERVICETONE 40//服务用语在固定服务语音中的存储位置

/******************语音编码格式**********************************/
//文件类型
#define ZONE_TONE 1//语音文件
#define ZONE_PROGRAM 2//程序

//语音格式
#define ZONE_8PCM 1//8位PCM
#define ZONE_4ADPCM 2//4位ADPCM
#define ZONE_4ADPCM2 3//4为ADPCM2
#define ZONE_8ADPCM2 4//8位ADPCM2

//采样率
#define ZONE_4KHZ 1//4KHz
#define ZONE_8KHZ 2//8KHz
#define ZONE_16KHZ 3//16KHz
#define ZONE_32KHZ 4//32KHz


Byte init_filedata(Uint8 lineNum, Uint8 curMode, Uint8 curStation/*in。当前站点序号*/, Uint8 attrStation/*本站还是下一站*/);
Byte read_businfo(Uint8 lineNum, Uint8 curMode, Uint8 curStation/*in。当前站点序号*/, Uint8 attrStation/*本站还是下一站*/);
Byte read_fixtone();
Byte read_stationtone();
Byte read_stationdata();
Byte read_tonearray();
Byte read_tonepointer();
Byte read_linename(Uint8 lineNum/*in*/, Byte* pName/*名称*/, Uint8 nLen/*输入时为buf的长度*/);

/**************************根据线路号获取线路名称*********/
/*lineNum:线路序号,值从0开始
/*************************************************************/
Byte read_linename(Uint8 lineNum/*in*/, Byte* pName/*名称*/, Uint8 nLen/*输入时为buf的长度*/);

/**************************根据线路号获取线路ID*********/
/*lineNum:线路序号,值从0开始
/*************************************************************/
Byte read_lineID(Uint8 lineNum/*in*/, Byte* pID/*名称*/, Uint8 nLen/*输入时为buf的长度*/);

/**************读取语音库****************************/
/*nOffset:语音段序号(值从1开始)
/*nStart:读取该语音段时的起始位置,值从0开始
/*pBuf:存放语音的缓存的指针
/*pLen:输入时为缓存的长度,输出时为实际读至内存的长度
/*返回值:OK表示该段语音已经读完,KO表示该段语音没有读完
/**************************************/
Byte read_filetobuf(Uint16 nOffset, Uint32 nStart, Byte* pBuf, Byte* pLen,  Byte bFirstRead);

/***************设置模式***************/
/*nMode:模式编码,值从1开始
/**************************************/
Byte read_linemode(Uint8 nMode/*in*/);


/**************************获取所有的线路名称*************/
/*函数只在初始化时候调用,运行过程中不能调用
/*******************************************************/
void read_alllinename(Byte curLine);

/***********************改变某条线路的名称*************/
/*在发生语音更新以后进行,更改被更新线路的名称
*nValue :线路号,值从0开始
/*******************************************************/
void change_linename(Byte nValue);

#define PLAYSOUND_FIRSTREAD 0/*播放语音时,读取语音块的第一段*/
#define PLAYSOUNT_NEXTREAD 1/*播放语音时,读取后续的语音块*/


/*curNum:当前站的序号,序号值从1-128开始
返回值:下一站的序号值*/
Byte get_nextstationNum(Byte curNum);

/*curNum:当前站的序号,序号值从1-128开始
返回值:上一站的序号值*/
Byte get_laststationNum(Byte curNum);

/*****************以下是更新程序的代码************
*pBuf:数据内容
*nLen:pBuf的长度
*nOffset:该块程序的偏移地址
*返回值:OK,可以返回应答;KO
*************************************************/
#define NFUPDATE_REMOTE 1
#define NFUPDATE_SERIAL 2
Byte write_programtoFlash(Byte* pBuf, Uint16 nLen, Uint32 nOffset);
#define SERIAL_FIRSTUPDATE 1
#define SERIAL_FOLLOWUPDATE 2
/*通过串口更新程序时使用*/
void init_serialupdateprogram(Byte status);
#endif

⌨️ 快捷键说明

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