ButterflyMP3
|
VS1001 interface library. More...
#include <avr/io.h>
#include <avr/pgmspace.h>
#include "types.h"
#include "delay.h"
#include "vs1001.h"
#include "mmc.h"
Go to the source code of this file.
Defines | |
#define | VS1001_READ 0x03 |
Modified on 13/07/2004 for ButterflyMP3 project ( atMega169 ) by Nick Lott. | |
#define | VS1001_WRITE 0x02 |
#define | write_byte_spi(data) (SpiByte(data)) |
Functions | |
const uint8 | __attribute__ ((progmem)) |
setup volume levels 0 1 2 3 4 5 6 7 8 9 | |
void | vs1001_read (uint8 address, uint16 count, uint16 *pData) |
read one or more word(s) from the VS1001 Control registers | |
void | vs1001_write (uint8 address, uint16 count, uint16 *pData) |
write one or more word(s) to the VS1001 Control registers | |
void | vs1001_send_data (unsigned char b) |
send a byte to the VS1001 MPEG stream | |
void | vs1001_send_32 (unsigned char *p) |
send a burst of 32 data bytes to the VS1001 MPEG stream | |
void | vs1001_init_io (void) |
setup I/O pins and directions for communicating with the VS1001 | |
void | vs1001_init_chip (void) |
setup the VS1001 chip for decoding | |
void | vs1001_reset (reset_e r) |
reset the VS1001 | |
void | vs1001_nulls (unsigned int nNulls) |
send a number of zero's to the VS1001 | |
void | vs_1001_setvolume (unsigned char left, unsigned char right) |
Set the VS1001 volume. | |
void | vs1001_sine_test (void) |
send a sine test (5 beeps) |
VS1001 interface library.
Copyright (C) 2000 Jesper Hansen <jesperh@telia.com>.
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.
Definition in file vs1001.c.
#define VS1001_READ 0x03 |
Modified on 13/07/2004 for ButterflyMP3 project ( atMega169 ) by Nick Lott.
Definition at line 43 of file vs1001.c.
Referenced by vs1001_read().
#define VS1001_WRITE 0x02 |
Definition at line 44 of file vs1001.c.
Referenced by vs1001_write().
#define write_byte_spi | ( | data | ) | (SpiByte(data)) |
Definition at line 46 of file vs1001.c.
Referenced by vs1001_read(), and vs1001_write().
const uint8 __attribute__ | ( | (progmem) | ) |
setup volume levels 0 1 2 3 4 5 6 7 8 9
Definition at line 60 of file vs1001.c.
References __attribute__().
void vs1001_init_chip | ( | void | ) |
setup the VS1001 chip for decoding
Definition at line 260 of file vs1001.c.
References Delay(), HARD_RESET, SOFT_RESET, vs1001_nulls(), vs1001_reset(), and vs1001_sine_test().
Referenced by init_HW().
void vs1001_init_io | ( | void | ) |
setup I/O pins and directions for communicating with the VS1001
Definition at line 233 of file vs1001.c.
References BSYNC_DDR, BSYNC_PIN, BSYNC_PORT, CBI, DREQ_DDR, DREQ_PIN, DREQ_PORT, MP3_DDR, MP3_PIN, MP3_PORT, RESET_DDR, RESET_PIN, RESET_PORT, SBI, xDCS_DDR, xDCS_PIN, and xDCS_PORT.
Referenced by init_HW().
void vs1001_nulls | ( | unsigned int | nNulls | ) |
send a number of zero's to the VS1001
Definition at line 327 of file vs1001.c.
References vs1001_send_data().
Referenced by vs1001_init_chip(), and vs1001_reset().
read one or more word(s) from the VS1001 Control registers
Definition at line 67 of file vs1001.c.
References BSYNC_PIN, BSYNC_PORT, CBI, MP3_PIN, MP3_PORT, SBI, VS1001_READ, write_byte_spi, xDCS_PIN, and xDCS_PORT.
Referenced by flush_decoder(), and Power_off().
void vs1001_reset | ( | reset_e | r | ) |
reset the VS1001
Definition at line 278 of file vs1001.c.
References CBI, Delay(), DREQ_PIN, DREQ_PORT, HARD_RESET, RESET_PIN, RESET_PORT, SBI, SCI_CLOCKF, SCI_MODE, SM_RESET, SM_SDINEW, SOFT_RESET, vs1001_nulls(), and vs1001_write().
Referenced by flush_decoder(), and vs1001_init_chip().
void vs1001_send_32 | ( | unsigned char * | p | ) | [inline] |
send a burst of 32 data bytes to the VS1001 MPEG stream
Definition at line 187 of file vs1001.c.
References BSYNC_PIN, BSYNC_PORT, CBI, SBI, xDCS_PIN, and xDCS_PORT.
Referenced by streaming().
void vs1001_send_data | ( | unsigned char | b | ) | [inline] |
send a byte to the VS1001 MPEG stream
Definition at line 153 of file vs1001.c.
References BSYNC_PIN, BSYNC_PORT, CBI, SBI, xDCS_PIN, and xDCS_PORT.
Referenced by vs1001_nulls(), and vs1001_sine_test().
void vs1001_sine_test | ( | void | ) |
send a sine test (5 beeps)
Definition at line 348 of file vs1001.c.
References Delay(), SCI_MODE, SM_SDINEW, SM_TESTS, vs1001_send_data(), and vs1001_write().
Referenced by handle_interface(), and vs1001_init_chip().
write one or more word(s) to the VS1001 Control registers
Definition at line 101 of file vs1001.c.
References BSYNC_PIN, BSYNC_PORT, CBI, MP3_PIN, MP3_PORT, SBI, VS1001_WRITE, write_byte_spi, xDCS_PIN, and xDCS_PORT.
Referenced by flush_decoder(), Power_off(), vs1001_reset(), vs1001_sine_test(), and vs_1001_setvolume().
void vs_1001_setvolume | ( | unsigned char | left, |
unsigned char | right | ||
) |
Set the VS1001 volume.
Definition at line 336 of file vs1001.c.
References SCI_VOL, and vs1001_write().
Referenced by flush_decoder(), init_HW(), volume_down(), and volume_up().