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

📄 sta013.h

📁 mp3代码 要用的干净下啊 希望用东西共享啊
💻 H
字号:
/*********************************************************************************************************
**				          			sta013 mp3驱动程序头文件 
**                                  (c) Copyright 2006-2008, limaokui
**                                           All Rights Reserved
**
**                                             V1.0.0
**
**
**--------------文件信息--------------------------------------------------------------------------------
**文   件   名:sta013.h
**创   建   人: 李茂奎
**最后修改日期:  2006年9月2日
**描        述:  sta013驱动程序头文件
**
**--------------历史版本信息----------------------------------------------------------------------------
** 创建人: 李茂奎
** 版  本: V1.00
** 日 期: 2006年9月2日
** 描 述: 原始版本
**
**------------------------------------------------------------------------------------------------------
** 修改人: 李茂奎
** 版  本:
** 日 期:
** 描 述: 
**
**--------------当前版本修订------------------------------------------------------------------------------
** 修改人:    李茂奎																					  
** 日 期:	 2006年9月2日
** 描 述:   
**
**------------------------------------------------------------------------------------------------------
*********************************************************************************************************/
#ifndef __sta013_H__
#define __sta013_H__
//STA013 SPI接口
#define STA_SCK_DIR			DDRB
#define STA_SCK_OUT			PORTB
#define STA_SCK_IN			PINB
#define STA_SCK				7
#define STA_SDI_DIR			DDRB
#define STA_SDI_OUT			PORTB
#define STA_SDI_IN			PINB
#define STA_SDI				5
//STA013 BITEN、复位脚和数据请求引脚
#define STA_BITEN_DIR		DDRB
#define STA_BITEN_OUT		PORTB
#define STA_BITEN_IN		PINB
#define STA_BITEN			3        //bit_en

#define STA_REQ_DIR			DDRD
#define STA_REQ_OUT			PORTD
#define STA_REQ_IN			PIND
#define STA_REQ				2        //int0
#define STA_RST_DIR			DDRD
#define STA_RST_OUT			PORTD
#define STA_RST_IN			PIND
#define STA_RST				3        //int1
#define STA_LED_DIR			DDRD
#define STA_LED_OUT			PORTD
#define STA_LED_IN			PIND
#define STA_LED				5        


// STA013 I2C address
#define STA_I2C_DEV						0x86
#define STA_IDENT						0xAC

// STA013 register (sub)address
#define STA_REG_VERSION                0x00
#define STA_REG_IDENT                  0x01
#define STA_REG_PLLCTL_1               0x05
#define STA_REG_PLLCTL_2               0x06
#define STA_REG_PLLCTL_3               0x07
#define STA_REG_REQ_POL                0x0c
#define STA_REG_SCLK_POL               0x0d
#define STA_REG_ERROR_CODE             0x0f
#define STA_REG_SOFT_RESET             0x10
#define STA_REG_PLAY                   0x13
#define STA_REG_MUTE                   0x14
#define STA_REG_CMD_INTERRUPT          0x16
#define STA_REG_DATA_REQ_ENABLE        0x18
#define STA_REG_SYNCSTATUS             0x40
#define STA_REG_ANCCOUNT_L             0x41
#define STA_REG_ANCCOUNT_H             0x42
#define STA_REG_HEAD_H                 0x43
#define STA_REG_HEAD_M                 0x44
#define STA_REG_HEAD_L                 0x45
#define STA_REG_DLA                    0x46
#define STA_REG_DLB                    0x47
#define STA_REG_DRA                    0x48
#define STA_REG_DRB                    0x49
#define STA_REG_MFSDF_441              0x50
#define STA_REG_PLLFRAC_441_L          0x51
#define STA_REG_PLLFRAC_441_H          0x52
#define STA_REG_PCMDIVIDER             0x54
#define STA_REG_PCMCONF                0x55
#define STA_REG_PCMCROSS               0x56
#define STA_REG_ANC_DATA_1             0x59
#define STA_REG_ANC_DATA_2             0x5a
#define STA_REG_ANC_DATA_3             0x5b
#define STA_REG_ANC_DATA_4             0x5c
#define STA_REG_ANC_DATA_5             0x5d
#define STA_REG_MFSDF                  0x61
#define STA_REG_DAC_CLK_MODE           0x63
#define STA_REG_PLLFRAC_L              0x64
#define STA_REG_PLLFRAC_H              0x65
#define STA_REG_FRAME_CNT_L            0x67
#define STA_REG_FRAME_CNT_M            0x68
#define STA_REG_FRAME_CNT_H            0x69
#define STA_REG_AVERAGE_BITRATE        0x6a
#define STA_REG_SOFTVERSION            0x71
#define STA_REG_RUN                    0x72
#define STA_REG_TREBLE_FREQUENCY_LOW   0x77
#define STA_REG_TREBLE_FREQUENCY_HIGH  0x78
#define STA_REG_BASS_FREQUENCY_LOW     0x79
#define STA_REG_BASS_FREQUENCY_HIGH    0x7a
#define STA_REG_TREBLE_ENHANCE         0x7b
#define STA_REG_BASS_ENHANCE           0x7c
#define STA_REG_TONE_ATTEN             0x7d

#define MIN_VOLUME_ATTENUATION			0
#define MAX_VOLUME_ATTENUATION			96
#define MIN_TONE_ATTENUATION			0
#define MAX_TONE_ATTENUATION			96
#define MIN_BASS_FREQUENCY				100
#define MAX_BASS_FREQUENCY				500
#define MIN_BASS_ENHANCE				-12	// -18dB in 1.5 dB steps
#define MAX_BASS_ENHANCE				+12	// +18dB in 1.5 dB steps
#define MIN_TREBLE_FREQUENCY			1000
#define MAX_TREBLE_FREQUENCY			5000
#define MIN_TREBLE_ENHANCE				-12	// -18dB in 1.5 dB steps
#define MAX_TREBLE_ENHANCE				+12	// +18dB in 1.5 dB steps
#define SOFTMUTE_VOLUME_CHANGE			20


extern void sta_IoIni(void);
extern void sta_Reset(void);
extern uint8 sta_Init(void);
extern void sta_SetVolume(uint8 volume, int8 balance);
extern void sta_SendToDecoder(uint16 len);
extern void sta_StopDecoder(void);
extern void sta_StartDecoder(void);
#endif

⌨️ 快捷键说明

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