Move m_LCD to CMiniDexed, does not build yet

pull/30/head
probonopd 3 years ago committed by GitHub
parent bdf6aabe15
commit a5395c978c
  1. 20
      src/kernel.cpp
  2. 5
      src/kernel.h
  3. 6
      src/minidexed.cpp
  4. 21
      src/minidexed.h

@ -7,18 +7,6 @@
#include <circle/logger.h>
#include "voices.c"
// HD44780 LCD configuration
#define COLUMNS 16
#define ROWS 2
// GPIO pins (Brcm numbering)
#define EN_PIN 17 // Enable
#define RS_PIN 18 // Register Select
#define RW_PIN 19 // Read/Write (set to 0 if not connected)
#define D4_PIN 22 // Data 4
#define D5_PIN 23 // Data 5
#define D6_PIN 24 // Data 6
#define D7_PIN 25 // Data 7
uint8_t fmpiano_sysex[156] = {
95, 29, 20, 50, 99, 95, 00, 00, 41, 00, 19, 00, 00, 03, 00, 06, 79, 00, 01, 00, 14, // OP6 eg_rate_1-4, level_1-4, kbd_lev_scl_brk_pt, kbd_lev_scl_lft_depth, kbd_lev_scl_rht_depth, kbd_lev_scl_lft_curve, kbd_lev_scl_rht_curve, kbd_rate_scaling, amp_mod_sensitivity, key_vel_sensitivity, operator_output_level, osc_mode, osc_freq_coarse, osc_freq_fine, osc_detune
95, 20, 20, 50, 99, 95, 00, 00, 00, 00, 00, 00, 00, 03, 00, 00, 99, 00, 01, 00, 00, // OP5
@ -39,8 +27,7 @@ LOGMODULE ("kernel");
CKernel::CKernel (void)
: CStdlibAppStdio ("minidexed"),
m_I2CMaster (CMachineInfo::Get ()->GetDevice (DeviceI2CMaster), TRUE),
m_pDexed (0),
m_LCD (COLUMNS, ROWS, D4_PIN, D5_PIN, D6_PIN, D7_PIN, EN_PIN, RS_PIN, RW_PIN)
m_pDexed (0)
{
// mActLED.Blink (5); // show we are alive
}
@ -56,11 +43,6 @@ bool CKernel::Initialize (void)
return FALSE;
}
if (!m_LCD.Initialize ())
{
return FALSE;
}
// select the sound device
const char *pSoundDevice = mOptions.GetSoundDevice ();
if (strcmp (pSoundDevice, "sndi2s") == 0)

@ -7,7 +7,6 @@
#include "circle_stdlib_app.h"
#include <circle/i2cmaster.h>
#include "minidexed.h"
#include <display/hd44780device.h>
enum TShutdownMode
{
@ -26,14 +25,10 @@ public:
TShutdownMode Run (void);
private:
void LCDWrite (const char *pString);
private:
// do not change this order
CI2CMaster m_I2CMaster;
CMiniDexed *m_pDexed;
CHD44780Device m_LCD;
};
#endif

@ -30,6 +30,12 @@ bool CMiniDexed::Initialize (void)
return false;
}
if (!m_LCD.Initialize ())
{
return FALSE;
}
m_bUseSerial = true;
activate();

@ -16,6 +16,7 @@
#include <circle/i2ssoundbasedevice.h>
#include <circle/hdmisoundbasedevice.h>
#include "pckeyboard.h"
#include <display/hd44780device.h>
#define SAMPLE_RATE 48000
@ -24,6 +25,18 @@
#define DAC_I2C_ADDRESS 0 // I2C slave address of the DAC (0 for auto probing)
// HD44780 LCD configuration
#define COLUMNS 16
#define ROWS 2
// GPIO pins (Brcm numbering)
#define EN_PIN 17 // Enable
#define RS_PIN 18 // Register Select
#define RW_PIN 19 // Read/Write (set to 0 if not connected)
#define D4_PIN 22 // Data 4
#define D5_PIN 23 // Data 5
#define D6_PIN 24 // Data 6
#define D7_PIN 25 // Data 7
class CMiniDexed : public Dexed
{
public:
@ -33,14 +46,18 @@ class CMiniDexed : public Dexed
m_PCKeyboard (this),
m_Serial (pInterrupt, TRUE),
m_bUseSerial (FALSE),
m_nSerialState (0)
m_nSerialState (0),
m_LCD (COLUMNS, ROWS, D4_PIN, D5_PIN, D6_PIN, D7_PIN, EN_PIN, RS_PIN, RW_PIN)
{
s_pThis = this;
};
virtual bool Initialize (void);
void Process(boolean bPlugAndPlayUpdated);
private:
void LCDWrite (const char *pString);
private:
CHD44780Device m_LCD;
protected:
static void MIDIPacketHandler (unsigned nCable, u8 *pPacket, unsigned nLength);
static void KeyStatusHandlerRaw (unsigned char ucModifiers, const unsigned char RawKeys[6]);

Loading…
Cancel
Save