📄 vs1003.h
字号:
#ifndef VS1003_H
#define VS1003_H
#include <avr/io.h>
#include "../global.h"
#define VS1003_COMMAND_WRITE 0x02
#define VS1003_COMMAND_READ 0x03
// SCI Register Address
#define VS1003_BASS 0x02 // Bass, treble enhancer
#define VS1003_CLOCKF 0x03 // Clock freq + Multiplier
#define VS1003_DCTIME 0x04 // Decode Time(in Second)
#define VS1003_AUDATA 0x05
#define VS1003_HEDATA0 0x08
#define VS1003_HEDATA1 0x09
#define VS1003_VOLUME 0x0B
#define VS1003_DDR DDRE
#define VS1003_PORT PORTE
#define VS1003_PIN PINE
#define VS1003_xCS 2
#define VS1003_xDCS 3
#define VS1003_DREQ 4
#define VS1003_RESET 5
#define VS1003_XCS_HIGH() sbi(VS1003_PORT, VS1003_xCS)
#define VS1003_XCS_LOW() cbi(VS1003_PORT, VS1003_xCS)
#define VS1003_XDCS_HIGH() sbi(VS1003_PORT, VS1003_xDCS)
#define VS1003_XDCS_LOW() cbi(VS1003_PORT, VS1003_xDCS)
#define VS1003_RESET_HIGH() sbi(VS1003_PORT, VS1003_RESET)
#define VS1003_RESET_LOW() cbi(VS1003_PORT, VS1003_RESET)
#define VS1003_DREQ_PIN (VS1003_PIN & 0x10)
struct VS1003_Mp3Info
{
U8 mp3_ID;
U8 sample_rate;
U8 bit_rate;
};
void VS1003_Init(void);
void VS1003_Reset(void);
U16 VS1003_Read_SCI_data(U8 address);
void VS1003_Write_SCI_Data(U8 address, U16 data);
void VS1003_Set_Volume(U16 volume);
void VS1003_Get_Mp3info(struct VS1003_Mp3Info* Mp3Info);
U16 VS1003_Get_DecodeTime(void);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -