IO spi

temp/IOgpiospi.h

Committer:
bosko001
Date:
2021-03-21
Revision:
7:4aa3dac73b66

File content as of revision 7:4aa3dac73b66:

#ifndef IOGPIOSPI_H
#define IOGPIOSPI_H


#include "mbed.h"

//typedef void (*pf_pc_c)(char* tx, char rx);


class C_gpioSpi
{
    private:
        DigitalIn *p_MOSI;
        DigitalOut *p_MISO; 
        InterruptIn *p_SpiClock;

        char bitCount = 0;
        char readData;
        char writeData = 0; 
 //       pf_pc_c transfer_fun = nullptr;

    void (*pfv) (void);
    void spiClockCount_fun(void);
 
    public:
    C_gpioSpi( /*PinName Mosi, PinName Miso, PinName spiClock*/ );
 //   void attach( pf_pc_c fun) { transfer_fun = fun;}
    virtual void spiByteTransfer( char * tx, char rx) = 0;
    char get_bitCount( void ) { return bitCount;}
    void clear_bitCount( void ) { bitCount = 0;}

    void spi_monitor( void );

};




#endif