An floppy drive audio generator using dsp on live audio

Dependencies:   Terminal asyncADC mbed-dsp mbed

moppy.h

Committer:
Condo2k4
Date:
2017-05-24
Revision:
1:02553973d9cf
Parent:
0:84c336a81482

File content as of revision 1:02553973d9cf:

#ifndef _MOPPY_H__
#define _MOPPY_H__

#include "mbed.h"

class Moppy {
    
public:
    
    Moppy(PinName tx, PinName rx, int baud);
    
    uint8_t getFloppyDrives() {
        return driveCount;
    }
    
    void setFrequency(int drive, int frequency);
    
    void flush();

    bool silence();
    
private:

    void consumeAndCheck(int event);
    
    Serial serial;
    uint8_t driveCount;
    char* str_buffer;
    uint16_t* freqs;
    bool* pair_changed;
    
    int expectedSyncs;
    event_callback_t read_callback;
    
};

//struct Profile {
//    int minFreq, maxFreq;
//}
//
//class MoppyController {
//public:
//    MoppyController(PinName tx, PinName rx, int baud);
//    
//    uint8_t getDeviceCount();
//    
//    void readProfile(int device, Profile &profile);
//    
//    void setDeviceFrequency(int device, int frequency);;
//    
//    void silence();
//    
//    void flush();
//    
//private:
//    
//    Serial _serial;
//    char* _buffer;
//    int _bufferSize;
//    
//    
//}

#endif // _MOPPY_H__