📄 player.h
字号:
//++
//player.h
//
// Copyright (C) 2005 by Spare Time Gizmos. All rights reserved.
//
// This file is part of the Spare Time Gizmos' MP3 Player firmware.
//
// This firmware 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.
//
// DESCRIPTION
// This file contans mostly hardware related defintions (e.g. I/O ports and
// bits, clock speeds, memory sizes, etc) for the MP3 player project.
//
// IMPORTANT - there is a companion to this file, PLAYER.INC, which contains
// a duplicated subset of this information for the convenience of the assembly
// language modules. IF YOU CHANGE THIS FILE, YOU'LL WANT TO CHANGE PLAYER.INC
// TOO! Sorry about this, but I know of no better way to handle it!
//
// REVISION HISTORY:
// dd-mmm-yy who description
// 15-May-05 RLA New file.
// 19-Oct-05 RLA Change STA013_CLOCK to 14.31818MHz
//--
#ifndef _player_h_
#define _player_h_
// System clock information...
#define CPU_CLOCK 18432000L // 8051 CPU crystal frequency
#define CPU_CLOCKS_PER_CYCLE 6 // CPU clocks per machine cycle
// ( 6 for Philips high speed parts)
// (12 for traditional 8051s)
#define STA013_CLOCK 14318180L // STA013 crystal frequency (used to program PLL)
// System configuration parameters...
#ifndef VERSION
#define VERSION 000 // version number of this firmware
#endif
#ifndef ROMSIZE
#error Define ROMSIZE!!! // size of the Flash ROM used ...
#endif
// I2C interface...
#define I2C_SDA P1_7 // I/O port pin used for I2C data
#define I2C_SCL P1_6 // " " " " " " clock
#define STA013_ADDR 0x86 // default I2C address for STA013 chip
// STA013 interface...
#define STA013_RESET P1_3 // asserted to reset the STA013
#define STA013_DATAREQ P3_2 // STA013 data request input (also INT0!)
#define STA013_ALT_SDI P1_2 // (alternate) serial data input to STA013
#define STA013_ALT_SCK P1_1 // ( " " ) " " clock
// Status LED definitions...
#define LED_BIT P2_3
#define LED_ON {LED_BIT = 1;}
#define LED_OFF {LED_BIT = 0;}
// Hardware definitions for the LCD/VFD display player...
#define DISPLAY_DATA P0 // data port used by the display
#ifdef PCBV1
#define DISPLAY_ENABLE P2_4 // display enable flag (active low)
#else
#define DISPLAY_ENABLE P1_5 // display enable flag (active low)
#endif
#define DISPLAY_RS P2_0 // display register select (data/control)
#define DISPLAY_RW P3_6 // display write flag (active low)
#define DISPLAY_BUSY P1_0 // display busy flag (VFDs only!)
#ifdef PCBV1
#define DISPLAY_RESET P1_5 // display hardware reset (VFDs only!)
#endif
// Hardware definitions for the CompactFlash (CF) card...
#define CARD_DATA P0 // data port used by the CF card (shared with DISPLAY_DATA)
#define CARD_RS0 P2_0 // IDE register select, LSB (shared with DISPLAY_RS)
#define CARD_RS1 P2_1 // " " " " "
#define CARD_RS2 P2_2 // " " " " " MSB
#define CARD_CS1FX P2_5 // IDE register set 1 (0x1Fx) select
#ifdef PCBV1
#define CARD_CS3FX P2_6 // " " " " 2 (0x3Fx) select
#define CARD_DETECT P2_7 // low when a card is inserted
#else
#define CARD_CS3FX P2_4 // " " " " 2 (0x3Fx) select
#define CARD_DETECT P3_3 // low when a card is inserted
#endif
#define CARD_IOWR P3_6 // card write data strobe
#define CARD_IORD P3_7 // " read " " (shared with DISPLAY_RW)
#define CARD_RESET P1_4 // card hardware reset
// Hardware definitions for the rotary encoder and push button...
#define ENCODER_A P3_5 // rotary encoder phase A
#define ENCODER_B P3_4 // " " " " " " B
#ifdef PCBV1
#define PUSH_BUTTON P3_3 // push button (part of the rotary encoder)
#else
#define PUSH_BUTTON P2_7 // push button (part of the rotary encoder)
#endif
// Public variables in the main module...
extern char const code g_szFirmware[];
extern char const code g_szCopyright[];
#define g_wROMChecksum (*((PCWORD) (ROMSIZE-2)))
#endif // _player_h_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -