aswersf

Dependents:   p31_SerielDirectwithBytes_Generatoren_Rampe_Sinus_usw

FuncGenFSST3.h

Committer:
ogris
Date:
2017-04-25
Revision:
0:2e0be62147b1

File content as of revision 0:2e0be62147b1:


#ifndef FuncGenFSST_h
#define FuncGenFSST_h

//Sägezahn
class SingnedRampGen {
  public:
    float val; // momentaner Ausgangswert
  private:
    float _inc;
  public:
    SingnedRampGen();

    void SetPointsPerPeriod(float aPoints);
    
    // bezogen auf Fsample 0..0.5
      void SetFrequ(float aFrequ);

    // Einen Abtastwert berechnen
      // wird bei z.B. Fsample=100Hz  100x pro sec afgerufen
        void CalcOneStep();
};

//Dreieck
class TriangleGen {
    public:
        float val; // momentaner Ausgangswert
  private:
    float _inc;
    int   _state;
    public:
        TriangleGen();
    
        void SetPointsPerPeriod(float aPoints);
    
        // bezogen auf Fsample 0..0.5
      void SetFrequ(float aFrequ);
    
        // Einen Abtastwert berechnen
        void CalcOneStep();
};

//Rechteck
class RectGen {
    public:
        float val; // momentaner Ausgangswert
    private:
        float _inc;
        float _phase;
    public:
        RectGen();
    
        void SetPointsPerPeriod(float aPoints);
    
        void SetFrequ(float aFrequ);

    // Dauer des ON-Pulses in Prozent ( 0..1 )
        void SetPulsWidth(float aPercent);

    // Einen Abtastwert berechnen
        void CalcOneStep();
};

#endif