BastatDoreau / Mbed 2 deprecated MoveYourTetris

Dependencies:   mbed APDS_9960 mbed-rtos

Dependents:   MoveYourTetris_OK

include/cSPI.h

Committer:
clementdoreau
Date:
2016-04-20
Revision:
28:e932eb039271
Parent:
9:6f3d8b714a59
Child:
29:95469b25e187

File content as of revision 28:e932eb039271:

/*
 * cSPI.h
 *
 *  Created on: 5 avr. 2016
 *      Author: clement
 */

#ifndef CSPI_H_
#define CSPI_H_

#include "mbed.h"
#include "cMatrice.h"

class cSPI {
private:
    unsigned int _freq;
    unsigned char _mode;
    unsigned char _bits;
    unsigned char _nbMatrices;
public:
    // CONSTRUCTEURS
    cSPI();
    // DESTRUCTEUR
    ~cSPI();
    // GETTERS
    unsigned int getFrequence();
    unsigned int getMode();
    unsigned char getBits();
    unsigned char getNbMatrices();
    // SETTERS
    void setFrequence(unsigned int freq);
    void setMode(unsigned int mode);
    void setBits(unsigned char bits);
    void setNbMatrices(unsigned char nb);
    // METHODES
    void initSPI(unsigned int frequence, unsigned int bits, unsigned int mode);
    int envoyerMatrice(cMatrice &); // Renvoi la reponse SPI
    void configurerNbMatrices(const char* nb);

};

#endif /* CSPI_H_ */