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

📄 msm9841.h

📁 通过车载终端采集GPS数据
💻 H
字号:
#ifndef DRIVER_MSM9841
#define DRIVER_MSM9841

#include "w77e532.h"
#define MSM_FULL P3_2

/***************command definition**************/
#define NOP 0x00
#define RECORD_START 0x10
#define PLAYBACK_START 0x20 
#define STOP 0x30
#define PAUSE 0x40 
#define VOLUME_SETTING 0x50 
#define PD_MODE 0x60 /*power-down mode*/
#define VOICE_SYN 0x70 /*voice synthesis method*/
#define ANALOG_SPEC1 0x80 /*analog specification 1*/
#define ANALOG_SPEC2 0x90 /*analog specification 2 and bus width*/
#define FIFO_CONFIG 0xA0 /*fifo memory configuration*/
#define SIGNAL_FORMAT 0xB0 /*signal output format*/
#define DMA_TRANSFER 0xC0 /*DMA transfer*/

/*****************voice synthesis method**********/
#define BIT4_ADPCM2 0x0
#define BIT5_ADPCM2 0x1
#define BIT6_ADPCM2 0x2
#define BIT7_ADPCM2 0x3
#define BIT8_ADPCM2 0x4
#define BIT4_ADPCM  0x5
#define BIT8_PCM    0x6
#define BIT8_NOLINEAR_PCM 0x7
#define BIT16_PCM   0x8

/****************volume setting*****************/
#define DB_0 0x0
#define DB_3 0x1
#define DB_6 0x2
#define DB_9 0x3
#define DB_12 0x4
#define DB_15 0x5
#define DB_18 0x6
#define DB_21 0x7


/****************sampling frequency*************/
#define HZ80K 0x0
#define HZ128K 0x1
#define HZ160K 0x2
#define HZ320K 0x3
#define HZ64K 0x4
#define HZ40K 0x5

/***************voice output setting***********/
#define LEFT_VOICE 0x0
#define RIGHT_VOICE 0x2
#define BOTH_SIDEVOICE 0x1

/*****************pause setting****************/
#define START_PAUSE 0x0
#define CANCEL_PAUSE 0x1

/******************fifo memory configuration***/
#define BIT512 0x0
#define BIT1024 0x1
#define BIT256 0x2
#define FIFO_NOTUSED 0x3

/*******************analog specification 2*****/
#define WITH_AMP 0
#define WITHOUT_AMP 1
#define WITH_LPF 0
#define WITHOUT_LPF 1
#define BIT8_BUS 0
#define BIT16_BUS 1
#define HITH_BUS 0/*D15 to D8 */
#define LOW_BUS 1/*D7 to D0*/

/********************analog specification 1*****/
#define OUTPUT_COMPLEMENTARY 0
#define OUTPUT_BINARY 1
#define INTERNAL_DAC 0
#define EXTERNAL_DAC 1
#define INTERNAL_ADC 0
#define EXTERNAL_ADC 1
#define MONAURAL 0
#define STEREO 1


/********************signal output format*****/
#define EMP_ACTIVE_HIGH 0
#define EMP_ACTIVE_LOW 1
#define DERQL_ACTIVE_HIGH 0
#define DERQL_ACTIVE_LOW 1
#define DACKL_ACTIVE_LOW 0
#define DACKL_ACTIVE_HIGH 1
#define NO_FUNCTION 0
#define FOR_TESTING 1

/********************power down*****/
#define CANCEL_POWERDOWN 0
#define START_POWERDOWN 1
#define RETAIN_LSI 0
#define INIT_LSI 1


/********************DMA transfer*****/
#define WITHOUT_DMA 0x0
#define DMA_SIGNAL_MODE 0x4
#define DMA_BLOCK_MODE 0x5

void msm_set_toneformat();

Byte msm_is_full();

void msm_input_command(Uint8 command);

void msm_input_data(Uint8 databuf);

void msm_read_status(Byte* pbuf);

void msm_stop_playback();

void msm_change_volume(Byte volume);

void msm9841_init();

void msm_start_playback();


Byte msm_senddata(Byte* pBuf, Byte nLen);
void init_test_buf();

//void tts_reset();

void msm9841_reset_init();
#endif

⌨️ 快捷键说明

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