You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
MiniDexed/src/config.h

97 lines
2.5 KiB

//
// config.h
//
// MiniDexed - Dexed FM synthesizer for bare metal Raspberry Pi
// Copyright (C) 2022 The MiniDexed Team
//
// Original author of this class:
// R. Stange <rsta2@o2online.de>
//
// 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 3 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, see <http://www.gnu.org/licenses/>.
//
#ifndef _config_h
#define _config_h
#include <fatfs/ff.h>
#include <Properties/propertiesfatfsfile.h>
#include <string>
class CConfig // Configuration for MiniDexed
{
public:
static const unsigned MaxNotes = 16; // polyphony
#if RASPPI <= 3
static const unsigned MaxUSBMIDIDevices = 2;
#else
static const unsigned MaxUSBMIDIDevices = 4;
#endif
static const unsigned LCDColumns = 16; // HD44780 LCD
static const unsigned LCDRows = 2;
public:
CConfig (FATFS *pFileSystem);
~CConfig (void);
void Load (void);
// Sound device
const char *GetSoundDevice (void) const;
unsigned GetSampleRate (void) const;
unsigned GetChunkSize (void) const;
unsigned GetDACI2CAddress (void) const; // 0 for auto probing
// MIDI
unsigned GetMIDIBaudRate (void) const;
// HD44780 LCD
// GPIO pin numbers are chip numbers, not header positions
bool GetLCDEnabled (void) const;
unsigned GetLCDPinEnable (void) const;
unsigned GetLCDPinRegisterSelect (void) const;
unsigned GetLCDPinReadWrite (void) const; // set to 0 if not connected
unsigned GetLCDPinData4 (void) const;
unsigned GetLCDPinData5 (void) const;
unsigned GetLCDPinData6 (void) const;
unsigned GetLCDPinData7 (void) const;
// Debug
bool GetMIDIDumpEnabled (void) const;
bool GetProfileEnabled (void) const;
private:
CPropertiesFatFsFile m_Properties;
std::string m_SoundDevice;
unsigned m_nSampleRate;
unsigned m_nChunkSize;
unsigned m_nDACI2CAddress;
unsigned m_nMIDIBaudRate;
bool m_bLCDEnabled;
unsigned m_nLCDPinEnable;
unsigned m_nLCDPinRegisterSelect;
unsigned m_nLCDPinReadWrite;
unsigned m_nLCDPinData4;
unsigned m_nLCDPinData5;
unsigned m_nLCDPinData6;
unsigned m_nLCDPinData7;
bool m_bMIDIDumpEnabled;
bool m_bProfileEnabled;
};
#endif