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

📄 vs1001.h

📁 Yet Another MP3 Player source code. It can be usefull as reference source for any project.
💻 H
字号:
/*
  Copyright (C) 2001 Jesper Hansen <jesperh@telia.com>.

  Rewritten by:	Nikolai Vorontsov <nickviz@mail.be>

  This file is part of the yampp system.

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software Foundation, 
  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

#ifndef __VS1001_H__
#define __VS1001_H__

#include "types.h"
#include "Constants.h"

#define MP3_PORT	PORTB
#define BSYNC_PORT	PORTB    
#define DREQ_PORT	PORTB

#define MP3_PIN		PB4				// MP3 control bit
#define	BSYNC_PIN	PB3				// BSYNC signal
#define DREQ_PIN	PB2				// DREQ signal

//
// VS1001 commands
//
#define VS1001_READ		0x03
#define VS1001_WRITE	0x02

//
// VS1001 registers
//
#define VS1001_MODE		0x00
#define VS1001_STATUS	0x01
#define VS1001_INTFCTLH	0x02
#define VS1001_CLOCKF	0x03
#define VS1001_PLAYTIME	0x04
#define VS1001_AUDATA	0x05
#define VS1001_VOLUME	0x0B


// setup I/O pins and directions for
// communicating with the VS1001
void vs1001_init_io(void);

// reset the VS1001
void vs1001_reset(bool bLoud);

// send a number of zero's to the VS1001
void vs1001_nulls(u16 nNulls);

// read word from the VS1001 Control registers
u16 vs1001_read(u08 address);

// write word to the VS1001 Control registers
void vs1001_write(u08 address, u16 data);

// set the VS1001 volume
void vs1001_setvolume(u08 left, u08 right);

// send MP3 data
void vs1001_send_data(u08 b);

// send MP3 data in 32 byte blocks
void vs1001_send_32(u08 *p);

#endif

⌨️ 快捷键说明

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