ButterflyMP3

vs1001.h File Reference

VS1001 interface library. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define DREQ_DDR   DDRE
#define BSYNC_DDR   DDRE
#define xDCS_DDR   DDRE
#define MP3_DDR   DDRB
#define RESET_DDR   DDRB
#define DREQ_PORT   PINE
#define BSYNC_PORT   PORTE
#define xDCS_PORT   PORTE
#define MP3_PORT   PORTB
#define RESET_PORT   PORTB
#define DREQ_PIN   PE6
#define BSYNC_PIN   PE5
#define xDCS_PIN   PE5
#define MP3_PIN   PB0
#define RESET_PIN   PB5
#define VS1011
#define SM_DIFF   (1<<0)
#define SM_LAYER12   (1<<1)
#define SM_RESET   (1<<2)
#define SM_OUTOFWAV   (1<<3)
#define SM_SETTOZERO1   (1<<4)
#define SM_TESTS   (1<<5)
#define SM_STREAM   (1<<6)
#define SM_SETTOZERO2   (1<<7)
#define SM_DACT   (1<<8)
#define SM_SDIORD   (1<<9)
#define SM_SDISHARE   (1<<10)
#define SM_SDINEW   (1<<11)
#define SM_SETTOZERO3   (1<<12)
#define SM_SETTOZERO4   (1<<13)
#define SCI_MODE   0x0
#define SCI_STATUS   0x1
#define SCI_BASS   0x2
#define SCI_CLOCKF   0x3
#define SCI_DECODE_TIME   0x4
#define SCI_AUDATA   0x5
#define SCI_WRAM   0x6
#define SCI_WRAMADDR   0x7
#define SCI_HDAT0   0x8
#define SCI_HDAT1   0x9
#define SCI_AIADDR   0xA
#define SCI_VOL   0xB
#define SCI_AICTRL0   0xC
#define SCI_AICTRL1   0xD
#define SCI_AICTRL2   0xE
#define SCI_AICTRL3   0xF

Enumerations

enum  reset_e { SOFT_RESET, HARD_RESET }

Functions

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 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 vs_1001_setvolume (unsigned char left, unsigned char right)
 Set the VS1001 volume.
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_sine_test (void)
 send a sine test (5 beeps)

Detailed Description

VS1001 interface library.

Author:
Jesper Hansen
Date:
2000
Id:
vs1001.h,v 1.6 2009/01/10 22:38:51 brokentoaster Exp

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.h.


Define Documentation

#define BSYNC_DDR   DDRE

Definition at line 35 of file vs1001.h.

Referenced by vs1001_init_io().

#define BSYNC_PIN   PE5

Definition at line 47 of file vs1001.h.

Referenced by vs1001_init_io(), vs1001_read(), vs1001_send_32(), vs1001_send_data(), and vs1001_write().

#define BSYNC_PORT   PORTE

Definition at line 41 of file vs1001.h.

Referenced by vs1001_init_io(), vs1001_read(), vs1001_send_32(), vs1001_send_data(), and vs1001_write().

#define DREQ_DDR   DDRE

Definition at line 34 of file vs1001.h.

Referenced by vs1001_init_io().

#define DREQ_PIN   PE6

Definition at line 46 of file vs1001.h.

Referenced by main(), streaming(), vs1001_init_io(), and vs1001_reset().

#define DREQ_PORT   PINE

Definition at line 40 of file vs1001.h.

Referenced by main(), streaming(), vs1001_init_io(), and vs1001_reset().

#define MP3_DDR   DDRB

Definition at line 37 of file vs1001.h.

Referenced by vs1001_init_io().

#define MP3_PIN   PB0

Definition at line 49 of file vs1001.h.

Referenced by vs1001_init_io(), vs1001_read(), and vs1001_write().

#define MP3_PORT   PORTB

Definition at line 43 of file vs1001.h.

Referenced by vs1001_init_io(), vs1001_read(), and vs1001_write().

#define RESET_DDR   DDRB

Definition at line 38 of file vs1001.h.

Referenced by vs1001_init_io().

#define RESET_PIN   PB5

Definition at line 50 of file vs1001.h.

Referenced by Power_off(), vs1001_init_io(), and vs1001_reset().

#define RESET_PORT   PORTB

Definition at line 44 of file vs1001.h.

Referenced by Power_off(), vs1001_init_io(), and vs1001_reset().

#define SCI_AIADDR   0xA

Definition at line 138 of file vs1001.h.

#define SCI_AICTRL0   0xC

Definition at line 140 of file vs1001.h.

#define SCI_AICTRL1   0xD

Definition at line 141 of file vs1001.h.

#define SCI_AICTRL2   0xE

Definition at line 142 of file vs1001.h.

#define SCI_AICTRL3   0xF

Definition at line 143 of file vs1001.h.

#define SCI_AUDATA   0x5

Definition at line 133 of file vs1001.h.

#define SCI_BASS   0x2

Definition at line 130 of file vs1001.h.

#define SCI_CLOCKF   0x3

Definition at line 131 of file vs1001.h.

Referenced by flush_decoder(), and vs1001_reset().

#define SCI_DECODE_TIME   0x4

Definition at line 132 of file vs1001.h.

#define SCI_HDAT0   0x8

Definition at line 136 of file vs1001.h.

#define SCI_HDAT1   0x9

Definition at line 137 of file vs1001.h.

#define SCI_MODE   0x0

Definition at line 128 of file vs1001.h.

Referenced by flush_decoder(), Power_off(), vs1001_reset(), and vs1001_sine_test().

#define SCI_STATUS   0x1

Definition at line 129 of file vs1001.h.

#define SCI_VOL   0xB

Definition at line 139 of file vs1001.h.

Referenced by vs_1001_setvolume().

#define SCI_WRAM   0x6

Definition at line 134 of file vs1001.h.

#define SCI_WRAMADDR   0x7

Definition at line 135 of file vs1001.h.

#define SM_DACT   (1<<8)

Definition at line 84 of file vs1001.h.

#define SM_DIFF   (1<<0)

Definition at line 76 of file vs1001.h.

#define SM_LAYER12   (1<<1)

Definition at line 77 of file vs1001.h.

#define SM_OUTOFWAV   (1<<3)

Definition at line 79 of file vs1001.h.

#define SM_RESET   (1<<2)

Definition at line 78 of file vs1001.h.

Referenced by vs1001_reset().

#define SM_SDINEW   (1<<11)

Definition at line 87 of file vs1001.h.

Referenced by flush_decoder(), vs1001_reset(), and vs1001_sine_test().

#define SM_SDIORD   (1<<9)

Definition at line 85 of file vs1001.h.

#define SM_SDISHARE   (1<<10)

Definition at line 86 of file vs1001.h.

#define SM_SETTOZERO1   (1<<4)

Definition at line 80 of file vs1001.h.

#define SM_SETTOZERO2   (1<<7)

Definition at line 83 of file vs1001.h.

#define SM_SETTOZERO3   (1<<12)

Definition at line 88 of file vs1001.h.

#define SM_SETTOZERO4   (1<<13)

Definition at line 89 of file vs1001.h.

#define SM_STREAM   (1<<6)

Definition at line 82 of file vs1001.h.

#define SM_TESTS   (1<<5)

Definition at line 81 of file vs1001.h.

Referenced by vs1001_sine_test().

#define VS1011

Definition at line 56 of file vs1001.h.

#define xDCS_DDR   DDRE

Definition at line 36 of file vs1001.h.

Referenced by vs1001_init_io().

#define xDCS_PIN   PE5

Definition at line 48 of file vs1001.h.

Referenced by vs1001_init_io(), vs1001_read(), vs1001_send_32(), vs1001_send_data(), and vs1001_write().

#define xDCS_PORT   PORTE

Definition at line 42 of file vs1001.h.

Referenced by vs1001_init_io(), vs1001_read(), vs1001_send_32(), vs1001_send_data(), and vs1001_write().


Enumeration Type Documentation

enum reset_e
Enumerator:
SOFT_RESET 
HARD_RESET 

Definition at line 146 of file vs1001.h.


Function Documentation

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

void vs1001_read ( uint8  address,
uint16  count,
uint16 pData 
)

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

void vs1001_write ( uint8  address,
uint16  count,
uint16 pData 
)

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().

Here is the call graph for this function:

 All Files Functions Variables Typedefs Enumerations Enumerator Defines