This is an involuntary fork, created because the repository would not update mmSPI. SPI library used to communicate with an altera development board attached to four zigbee-header pins.

Dependents:   Embedded_RTOS_Project

Fork of mmSPI by Mike Moore

mmSPI.h

Committer:
gatedClock
Date:
2013-08-14
Revision:
3:de99451ab3c0
Parent:
2:bebcf53b72dc
Child:
4:aa1fe8707bef

File content as of revision 3:de99451ab3c0:

#ifndef mmSPI_H                                 // include guard.
#define mmSPI_H                                 // include guard.
/*----------------------------------------------//------------------------------
    student   : m-moore
    class     : external SPI interface
    directory : mmSPI
    file      : mmSPI.h
----description---------------------------------//------------------------------    
----notes---------------------------------------//------------------------------ 
    1. the SPI interface pins are routed to the zigbee header.
------------------------------------------------//----------------------------*/
    #include "mbed.h"                           // standard mbed.org class.
//---defines------------------------------------//------------------------------
    #define mmSPI_MOSI p9                       // SPI interface pin.
    #define mmSPI_MISO p10                      // SPI interface pin.
    #define mmSPI_SCLK p30                      // SPI interface pin.
    
    

/*----------------------------------------------//------------------------------  
------------------------------------------------//----------------------------*/

//==============================================//==============================
    class mmSPI
    {
      public:
             mmSPI();                           // constructor.
            ~mmSPI();                           // destructor.
        void allocations();                     // object allocations.
        char transceive_byte(char);             // byte transceive.
      private:
      
      DigitalOut * pMOSI;                       // SPI pin.
      DigitalOut * pMISO;                       // SPI pin.
      DigitalOut * pSCLK;                       // SPI pin.
      
      

    };
//----------------------------------------------//------------------------------
#endif                                          // include guard.