📄 sssmp3_regs.h
字号:
#ifndef __SSSMP3_REGS_H__
#define __SSSMP3_REGS_H__
#include "sdhost.h"
// Class-D Codec Register
#define CLASS_D_DAC_CTL (*(UCHAR volatile xdata*)0x600) // Class-D Register
#define CLASS_D_VOL_CTL (*(char volatile xdata*)0x601) // Class-D Register
//***********************************************
//2006-10-30增加
//CLASS_D_DAC_CTL
#define SUSPEND 0x01 //suspend
#define PAUSE 0x02 //pause
#define OVINT 0x04 //SRC overflow flag
#define CEB 0x08 //ceb/ceb_ClassD:enable VCM function
//ceb_ClassD = ceb + OSEL
#define SAMPF0 0x10 //sample rate selection (EN8K = 0)
#define SAMPF1 0x20
#define SAMPF2 0x40
#define EN8K 0x80 //8KHz sample rate,sampf will be ignored
//sample rate (KHz)
#define SAMPF_0 0x00 //22.05
#define SAMPF_1 SAMPF0 //24
#define SAMPF_2 SAMPF1 //16
#define SAMPF_4 SAMPF2 //44.1
#define SAMPF_5 (SAMPF0 | SAMPF2) //48
#define SAMPF_6 (SAMPF1 | SAMPF2) //32
//MP3_INT_EN
#define EIL 0x01 //Enable of input Right DMA Empty interrupt
#define EIR 0x02 //Enable of input Left DMA Empty interrupt
#define EIFS 0x04 //Enable of Frame Lock rising interrupt
#define EIFC 0x08 //Enable of Frame Lock falling interrupt
#define EIOK 0x10 //Enable of output FIFO OK interrupt
#define EIEMPTY 0x20 //Enable of output FIFO Empty interrupt
#define EIMP3 0x40 //Enable of global MP3 interrupt
//MP3_CTL
#define MP3_CLR 0x01 //Software reset for MP3 Decoder
#define MUTE 0x02 //Mute for play back, keep playing
#define MP3_PAUSE 0x04 //Pause for play back
#define MP3_WAVE 0x08 //input format MP3(default) or WAV
//0: MP3 mode; 1: WAV mode
#define L_ENDIAN 0x10 //Little Endian format for input data(Low Byte in Low Byte position)
//0: Big Endian mode; 1: Little Endian mode
#define STEREO_WAVE 0x20 //set by user at WAV play back mode
//0: Mono mode; 1: Stereo mode
#define STEREO 0x40 //MP3 or WAV mode
//0: Mono mode; 1: Stereo mode
//MP3_FIFOCTL
#define FIFO_EN 0x01 //PCM output FIFO enable
#define EMPTY 0x10 //Set when PCM output FIFO is empty
#define OK_BUFFER 0x20 //Set when PCM output FIFO is full at 1st time
//MP3_I2S_CTL
#define I2S_EN 0x01 //I2S output enable
#define I2S_MODE 0x02 //0: Parallel Mode; 1: I2S Mode
#define BIT_LENGTH0 0x40 //Audio Data Bit Length
#define BIT_LENGTH1 0x80
#define BIT_LENGTH_0 0x00 //16 bits
#define BIT_LENGTH_1 BIT_LENGTH0 //20 bits
#define BIT_LENGTH_2 BIT_LENGTH1 //24 bits
#define BIT_LENGTH_3 (BIT_LENGTH0 | BIT_LENGTH1) //24 bits
//MP3_DMACTL
#define DMA_READY_L 0x01 //Set by user if left DMA is ready
#define DMA_READY_R 0x02 //Set by user if right DMA is ready
#define DMA_EMPTY_L 0x04 //Set if left DMA is empty
#define DMA_EMPTY_R 0x08 //Set if right DMA is empty
#define DMA_CLR 0x80 //Clear DMA STM
//MP3_INT_CLR
//MP3_INT_FLAG
#define IFL 0x01 //Flag of input Left DMA Empty interrupt
#define IFR 0x02 //Flag of input Right DMA Empty interrupt
#define IFFS 0x04 //Flag of Frame Lock rising interrupt
#define IFFC 0x08 //Flag of Frame Lock falling interrupt
#define IFOK 0x10 //Flag of output FIFO OK interrupt
#define IFEMPTY 0x20 //Flag of output FIFO Empty interrupt
//***********************************************
#define MP3_REGBASE 0x400
// MP3 Decoder Registers Map
#define MP3_CTL XBYTE[MP3_REGBASE + 0x00]
#define MP3_STATUS0 XBYTE[MP3_REGBASE + 0x01]
#define MP3_STATUS1 XBYTE[MP3_REGBASE + 0x02]
#define MP3_STATUS2 XBYTE[MP3_REGBASE + 0x03]
#define MP3_VOLUME XBYTE[MP3_REGBASE + 0x04]
#define MP3_EQBAND060 XBYTE[MP3_REGBASE + 0x05]
#define MP3_EQBAND170 XBYTE[MP3_REGBASE + 0x06]
#define MP3_EQBAND310 XBYTE[MP3_REGBASE + 0x07]
#define MP3_EQBAND600 XBYTE[MP3_REGBASE + 0x08]
#define MP3_EQBAND01K XBYTE[MP3_REGBASE + 0x09]
#define MP3_EQBAND03K XBYTE[MP3_REGBASE + 0x0A]
#define MP3_EQBAND06K XBYTE[MP3_REGBASE + 0x0B]
#define MP3_EQBAND12K XBYTE[MP3_REGBASE + 0x0C]
#define MP3_EQBAND14K XBYTE[MP3_REGBASE + 0x0D]
#define MP3_EQBAND16K XBYTE[MP3_REGBASE + 0x0E]
#define MP3_FIFOCTL XBYTE[MP3_REGBASE + 0x0F]
#define MP3_DMACTL XBYTE[MP3_REGBASE + 0x10]
#define MP3_DMASTART0700_LEFT XBYTE[MP3_REGBASE + 0x11]
#define MP3_DMASTART1508_LEFT XBYTE[MP3_REGBASE + 0x12]
#define MP3_DMALEN0700_LEFT XBYTE[MP3_REGBASE + 0x13]
#define MP3_DMALEN1508_LEFT XBYTE[MP3_REGBASE + 0x14]
#define MP3_DMASTART0700_RIGHT XBYTE[MP3_REGBASE + 0x15]
#define MP3_DMASTART1508_RIGHT XBYTE[MP3_REGBASE + 0x16]
#define MP3_DMALEN0700_RIGHT XBYTE[MP3_REGBASE + 0x17]
#define MP3_DMALEN1508_RIGHT XBYTE[MP3_REGBASE + 0x18]
#define MP3_I2S_CTL XBYTE[MP3_REGBASE + 0x19]
#define MP3_I2S_RATE XBYTE[MP3_REGBASE + 0x1A]
#define MP3_I2S_DUTY XBYTE[MP3_REGBASE + 0x1B]
#define MP3_INT_EN XBYTE[MP3_REGBASE + 0x1C]
#define MP3_INT_MASK XBYTE[MP3_REGBASE + 0x1D]
#define MP3_INT_FLAG XBYTE[MP3_REGBASE + 0x1E]
#define MP3_INT_CLR XBYTE[MP3_REGBASE + 0x1F]
#define MP3_ExROM_BASE 0x700
#define LROM_RD XBYTE[MP3_ExROM_BASE + 0x00]
#define LROM_WR XBYTE[MP3_ExROM_BASE + 0x01]
#define LROM_STATUS XBYTE[MP3_ExROM_BASE + 0x02]
#define LROM_SCRAMBLE XBYTE[MP3_ExROM_BASE + 0x03]
#define LROM_EXCHANGE XBYTE[MP3_ExROM_BASE + 0x04]
#define LROM_XADS_S2 XBYTE[MP3_ExROM_BASE + 0x05]
#define LROM_XADS_S1 XBYTE[MP3_ExROM_BASE + 0x06]
#define LROM_XADS_S0 XBYTE[MP3_ExROM_BASE + 0x07]
#define LROM_XADS_E2 XBYTE[MP3_ExROM_BASE + 0x09]
#define LROM_XADS_E1 XBYTE[MP3_ExROM_BASE + 0x0A]
#define LROM_XADS_E0 XBYTE[MP3_ExROM_BASE + 0x0B]
#define LROM_DADS_S1 XBYTE[MP3_ExROM_BASE + 0x0C]
#define LROM_DADS_S0 XBYTE[MP3_ExROM_BASE + 0x0D]
#define LROM_DADS_E1 XBYTE[MP3_ExROM_BASE + 0x0E]
#define LROM_DADS_E0 XBYTE[MP3_ExROM_BASE + 0x0F]
#define IO_PORT1_0 XBYTE[MP3_ExROM_BASE + 0x10]
#define IO_PORT1_1 XBYTE[MP3_ExROM_BASE + 0x11]
#define IO_PORT1_2 XBYTE[MP3_ExROM_BASE + 0x12]
#define IO_PORT1_3 XBYTE[MP3_ExROM_BASE + 0x13]
#define IO_PORT1_4 XBYTE[MP3_ExROM_BASE + 0x14]
#define IO_PORT1_5 XBYTE[MP3_ExROM_BASE + 0x15]
#define IO_PORT1_6 XBYTE[MP3_ExROM_BASE + 0x16]
#define IO_PORT1_7 XBYTE[MP3_ExROM_BASE + 0x17]
#define IO_PORT3_0 XBYTE[MP3_ExROM_BASE + 0x18]
#define IO_PORT3_1 XBYTE[MP3_ExROM_BASE + 0x19]
#define IO_PORT3_2 XBYTE[MP3_ExROM_BASE + 0x1A]
#define IO_PORT3_3 XBYTE[MP3_ExROM_BASE + 0x1B]
#define IO_PORT3_4 XBYTE[MP3_ExROM_BASE + 0x1C]
#define IO_PORT3_5 XBYTE[MP3_ExROM_BASE + 0x1D]
#define IO_ADS XBYTE[MP3_ExROM_BASE + 0x1E]
#define IO_DATA XBYTE[MP3_ExROM_BASE + 0x1F]
//***********************************************
//***********************************************
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -