ButterflyMP3
|
00001 00037 #ifndef MAIN_H 00038 #define MAIN_H 00039 00040 //#define USE_MMC_CACHE 00041 00042 #define MODE_IDLE 0 00043 #define MODE_SLEEP 1 00044 #define MODE_PLAY 2 00045 #define MODE_PAUSE 3 00046 #define MODE_STOP 4 00047 #define MODE_POWEROFF 5 00048 00049 // Timers 00050 // Note undefine PWR_CHK_INTERVAL to remove any Battery voltage checking 00051 #define AUTOPOWEROFF_TIMEOUT 30 ///< define Number of seconds till power Off when idle. 0-255. 0 = no autopoweroff 00052 //#define PWR_CHK_INTERVAL 60 ///< number of seconds before checking Battery voltage 00053 #define STAT_DISPLAY_TIME 2 ///< number of seconds to display stats 00054 00055 #define DDR(x) ((x)-1) /* address of data direction register of port x */ 00056 #define PIN(x) ((x)-2) /* address of input register of port x */ 00057 00058 // player behaviour 00059 #define SCAN_JUMPTOSTART 1 ///< Return to first song after last when searching throught songs/ 00060 #define PLAY_NEXT_SONG 1 ///< Automatically select next song when finished. 00061 #define PLAY_REPEAT_ALL 1 ///< Automatically loop to start of MMC when end is reached. 00062 #define RECURSE_DIRECTORIES 0 ///< Automatically recurse directories 00063 #define EXPERIMENTAL_FF 0 ///< Experimental Fast Forward mode 00064 #define ID3_EN 1 ///< Enable ID3 Tag analysis 00065 #define DEFAULT_MUSIC_VOLUME 5 ///< Initial volume when player starts up and no saved state in eeprom 00066 00067 // Hardware Definitions 00068 #define REV 'F' ///< define Hardware PCB version 00069 #define FAT_ON_MMC ///< define storage hardware MMC or ATA (comming soon...) 00070 #define SW_MMC_IDENTIFY ///< define MMC identification method HW or SW. 00071 #define SERIAL_ENABLE ///< define Dubug output on Serial port 00072 #define SERIAL_EXTENDED ///< define enable extra functions available on the serial port 00073 // #define MATRIX_BUTTONS ///< define Use a matrix to multiplex buttons on PORTD 00074 00075 // Sample player mode options 00076 // In this mode the player can be used to trigger one shot samples 00077 // a controlout is set high if a second sample is triggered while another is playing 00078 // 00079 #define SAMPLEMODE_UNINTERUPTIBLE 0 ///< Cannot play track by number if player is currently playing 00080 #define SAMPLEMODE_CONTROLOUT_EN 0 ///< Enable external signal on sample trigger while playing. 00081 #define SAMPLEMODE_CONTROLOUT_PORT PORTD ///< use this port to signal a sample tried to play while one was already playing. 00082 #define SAMPLEMODE_CONTROLOUT_PIN 7 ///< use this pin to signal a sample tried to play while one was already playing. 00083 #define SAMPLEMODE_ALLBUTONS 0 ///< disable normal joystick functions all buttons play a sample 00084 00085 //include extra functions in FAT library if needed 00086 #define FAT_NumberedSong_EN (defined SERIAL_EXTENDED || defined MATRIX_BUTTONS || SAMPLEMODE_ALLBUTONS) 00087 00088 // EEPROM Location Definitions 00089 #define EEPROM_BFFRSZE 0x0F ///< size of ring buffer 00090 #define EEPROM_OPTIONS_INDEX 0xA0 ///< ring buffer index for player options 00091 #define EEPROM_VOL 0x10 00092 #define EEPROM_STATE_INDEX 0x90 ///< ring buffer index for player state. 00093 #define EEPROM_FILE 0x20 00094 #define EEPROM_MODE 0x30 00095 #define EEPROM_SECTOR 0x40 00096 #define EEPROM_PLAYED 0x50 00097 #define EEPROM_VALID 0x60 00098 #define EEPROM_TIME 0x70 00099 #define EEPROM_DIR 0x80 00100 #define USE_EEPROM ///< Enable eeprom usaage 00101 #define ENDURANCE_EEPROM ///< Use a ringbuffer in eeprom 00102 00103 /* 00104 VS1001 Connections Defined in "vs1001.h" 00105 DREQ PE6 00106 BSYNC PE5 00107 CS PB0 00108 RESET PB5 00109 SI/SDATA PB2 00110 SO PB3 00111 SCK/DCLK PB1 00112 00113 MMC Connections Defined in "mmc.h" 00114 MMC_cs PE4 00115 MOSI PB2 00116 MISO PB3 00117 SCK PB1 00118 00119 The NOKIA 3310 LCD is currently configured on PORTC with a Bit Banged SPI interface. 00120 NOTE: This changes with the NOKIA_ALTPINOUT definition 00121 00122 Defined in "pcd8544.h" 00123 #ifdef NOKIA_ALTPINOUT 00124 lcdPort PORTC // port that LCD is on; needs 5 free pins 00125 lcdPortD DDRC // 00126 SCLK PC3 00127 SDIN PC2 00128 DC PC7 00129 SCE_ PC6 00130 RES_ PC4 00131 #else 00132 lcdPort PORTC // port that LCD is on; needs 5 free pins 00133 lcdPortD DDRC // 00134 SCLK PC3 00135 SDIN PC5 00136 DC PC2 00137 SCE_ PC1 00138 RES_ PC4 00139 #endif 00140 00141 00142 Other connections 00143 DataFlash CS PB0 // DataFlash is held in reset 00144 */ 00145 00146 00147 00148 extern const char VERSIONINFO1[]; 00149 extern const char VERSIONINFO2[]; 00150 00151 00152 // SANITY CHECK!! 00153 #if defined NOKIA && defined ALPHA 00154 #error: "Too many display definitions. You can't have both " 00155 #endif 00156 00157 00158 #ifndef NOKIA 00159 #ifndef ALPHA 00160 #ifndef LED_MATRIX 00161 #warning: No dislpay defined 00162 #endif 00163 #endif 00164 #endif 00165 00166 #endif