Author | Matthew Schinkel, copyright (c) 2009, all rights reserved. |
Adapted-by | |
Compiler | >=2.4m |
example usage of the sta015 mp3 decoder. plays .mp3 files from a fat32 formatted sd card or hard disk
http://www.st.com/stonline/books/pdf/docs/7042.pdf http://www.pjrc.com/mp3/sta013.html
No dependency found
const byte _STA015_BASS_ENHANCE = 0x7C -- base enhance register
var byte sta015_left = 0 -- current left speaker volume
const byte _STA015_TREBLE_ENHANCE = 0x7B -- treble enhance register
const byte STA015_STOP_PLAY = 102 -- Tell device to stop playing. Or just stop sending data
const byte STA015_STEREO = 0 -- stereo
var byte _sta015_head_mid -- holds some mp3 info
const byte _STA015_RESET = 0x16 -- soft reset command register
const byte STA015_TREBLE_UP = 110 -- Turn up the treble (high frequency sounds)
const byte _STA015_DRB = 0x49 -- right volume register
const byte _STA015_TONE_ATTEN = 0x7D -- tone attenuation register
const byte STA015_SINGLE_CHANNEL = 3 -- single_channel (mono)
var byte _sta015_head_low -- holds some mp3 info
const byte STA015_VOLUME_DOWN = 105 -- Turn down the volume (more attenuation)
const byte STA015_DUAL_CHANNEL = 2 -- dual_channel
var byte sta015_crystal -- holds the crystal value chosen after init
var word sta015_bitrate
const byte _STA015_DRA = 0x48 -- left volume register
var byte sta015_mode -- holds the current mode, byte value from 0 to 3
const byte STA015_JOINT_STEREO = 1 -- joint stereo (intensity_stereo and/or ms_stereo)
const byte STA015_MUTE = 103 -- Mute (turn off volume but continue playing)
const byte _STA015_RUN = 0x72 -- run command register
const byte STA015_TREBLE_DOWN = 109 -- Turn down treble (high frequency sounds)
const byte STA015_BASE_UP = 108 -- Turn up base (low frequency sounds)
var sbyte sta015_base = 0 -- current base volume
const byte STA015_START_PLAY = 101 -- Tell the device to start playing. You need to send data after
const byte STA015_VOLUME_UP = 106 -- Turn up the volume (less attenuation)
const byte _STA015_MUTE = 0x14 -- mute command register
const byte STA015_NO_MUTE = 104 -- Turn off Mute (restore volume)
const byte STA015_LEFT_DOWN = 113 -- Turn down the left speaker volume
const byte STA015_READ_INFO = 115 -- Get mp3 bitrate and mode(mono/stereo) with sta015_read_mp3_info() command
const byte STA015_OSC_14_31818 = 2 -- 14.31818 mhz crystal
const byte _STA015_PLAY = 0x19 -- play command register
const byte STA015_BASE_DOWN = 107 -- Turn down base (low frequency sounds)
const byte STA015_LEFT_UP = 114 -- Turn up the left speaker volume
var byte sta015_right = 0 -- current right speaker volume
const byte STA015_RESET = 100 -- Reset the sta015 device
var byte sta015_attenuation = STA015_DEFAULT_ATTENUATION -- current attenuation / volume
var sbyte sta015_treble = 0 -- current treble volume
const byte STA015_OSC_14_7456 = 3 -- 14.7456 mhz crystal
const byte STA015_RIGHT_DOWN = 111 -- Turn down the right speaker volume
const byte STA015_RIGHT_UP = 112 -- Turn up the right speaker volume
var byte _sta015_head_high -- holds some mp3 info
const byte STA015_OSC_10 = 0 -- 10 mhz crystal
const byte STA015_OSC_20 = 1 -- 20 mhz crystal
sta015_read_mp3_info()
sta015_send(byte in data)
sta015_init(byte in crystal_speed)
sta015_send_volume()
sta015_read_register(byte in reg_address, byte out data)
sta015_write_command(byte in command)
sta015_write_register(byte in reg_address, byte in data)
const byte _STA015_BASS_ENHANCE = 0x7C -- base enhance register
No documentation found
var byte sta015_left = 0 -- current left speaker volume
No documentation found
const byte _STA015_TREBLE_ENHANCE = 0x7B -- treble enhance register
No documentation found
const byte STA015_STOP_PLAY = 102 -- Tell device to stop playing. Or just stop sending data
No documentation found
const byte STA015_STEREO = 0 -- stereo
No documentation found
var byte _sta015_head_mid -- holds some mp3 info
No documentation found
const byte _STA015_RESET = 0x16 -- soft reset command register
register addresses
const byte STA015_TREBLE_UP = 110 -- Turn up the treble (high frequency sounds)
No documentation found
const byte _STA015_DRB = 0x49 -- right volume register
No documentation found
const byte _STA015_TONE_ATTEN = 0x7D -- tone attenuation register
No documentation found
const byte STA015_SINGLE_CHANNEL = 3 -- single_channel (mono)
No documentation found
var byte _sta015_head_low -- holds some mp3 info
No documentation found
const byte STA015_VOLUME_DOWN = 105 -- Turn down the volume (more attenuation)
No documentation found
const byte STA015_DUAL_CHANNEL = 2 -- dual_channel
No documentation found
var byte sta015_crystal -- holds the crystal value chosen after init
No documentation found
var word sta015_bitrate
holds current playing mp3's bitrate or quality in kbps after sta015_write_command(STA015_READ_INFO)
const byte _STA015_DRA = 0x48 -- left volume register
No documentation found
var byte sta015_mode -- holds the current mode, byte value from 0 to 3
sta015_mode will equal current playing mp3's mode after sta015_write_command(STA015_READ_INFO) as seen below. example: if sta015_mode == STA015_STEREO then
const byte STA015_JOINT_STEREO = 1 -- joint stereo (intensity_stereo and/or ms_stereo)
No documentation found
const byte STA015_MUTE = 103 -- Mute (turn off volume but continue playing)
No documentation found
const byte _STA015_RUN = 0x72 -- run command register
No documentation found
const byte STA015_TREBLE_DOWN = 109 -- Turn down treble (high frequency sounds)
No documentation found
const byte STA015_BASE_UP = 108 -- Turn up base (low frequency sounds)
No documentation found
var sbyte sta015_base = 0 -- current base volume
No documentation found
const byte STA015_START_PLAY = 101 -- Tell the device to start playing. You need to send data after
No documentation found
const byte STA015_VOLUME_UP = 106 -- Turn up the volume (less attenuation)
No documentation found
const byte _STA015_MUTE = 0x14 -- mute command register
No documentation found
const byte STA015_NO_MUTE = 104 -- Turn off Mute (restore volume)
No documentation found
const byte STA015_LEFT_DOWN = 113 -- Turn down the left speaker volume
No documentation found
const byte STA015_READ_INFO = 115 -- Get mp3 bitrate and mode(mono/stereo) with sta015_read_mp3_info() command
No documentation found
const byte STA015_OSC_14_31818 = 2 -- 14.31818 mhz crystal
No documentation found
const byte _STA015_PLAY = 0x19 -- play command register
No documentation found
const byte STA015_BASE_DOWN = 107 -- Turn down base (low frequency sounds)
No documentation found
const byte STA015_LEFT_UP = 114 -- Turn up the left speaker volume
No documentation found
var byte sta015_right = 0 -- current right speaker volume
No documentation found
const byte STA015_RESET = 100 -- Reset the sta015 device
send one of the following constants to the sta015_write_command procedure
var byte sta015_attenuation = STA015_DEFAULT_ATTENUATION -- current attenuation / volume
volume control vars, read only. use sta015_write_command() procedure to change volume
var sbyte sta015_treble = 0 -- current treble volume
No documentation found
const byte STA015_OSC_14_7456 = 3 -- 14.7456 mhz crystal
No documentation found
const byte STA015_RIGHT_DOWN = 111 -- Turn down the right speaker volume
No documentation found
const byte STA015_RIGHT_UP = 112 -- Turn up the right speaker volume
No documentation found
var byte _sta015_head_high -- holds some mp3 info
No documentation found
const byte STA015_OSC_10 = 0 -- 10 mhz crystal
oscillators for the init procedure
const byte STA015_OSC_20 = 1 -- 20 mhz crystal
No documentation found
sta015_read_mp3_info()
No documentation found
sta015_send(byte in data)
No documentation found
sta015_init(byte in crystal_speed)
No documentation found
sta015_send_volume()
No documentation found
sta015_read_register(byte in reg_address, byte out data)
No documentation found
sta015_write_command(byte in command)
No documentation found
sta015_write_register(byte in reg_address, byte in data)
No documentation found
18f452 | 18f452_mp3_decoder_sta015_sd_card.jal |
18f452 | 18f452_mp3_decoder_sta015_pata_hard_disk.jal |
18f4620 | 18f4620_mp3_decoder_sta015_pata_hard_disk.jal |
18f4620 | 18f4620_mp3_decoder_sta015_sd_card.jal |