SPI library used to communicate with an altera development board attached to four zigbee-header pins.

mmSPI.h

Committer:
gatedClock
Date:
2013-08-14
Revision:
2:bebcf53b72dc
Parent:
1:15706d15d123
Child:
3:de99451ab3c0

File content as of revision 2:bebcf53b72dc:

#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 MOSI p9                             // SPI interface pin.
    #define MISO p10                            // SPI interface pin.
    #define SCLK p30                            // SPI interface pin.
    
    
//DigitalOut xbee_nrst(p30);
//DigitalOut xbee_tx(p9);
//DigitalOut xbee_rx(p10);
/*----------------------------------------------//------------------------------  
------------------------------------------------//----------------------------*/

//==============================================//==============================
    class mmSPI
    {
      public:
             mmSPI();                           // constructor.
            ~mmSPI();                           // destructor.
        char transceive_byte(char);             // byte transceive.
      private:
      
      DigitalOut * pSCLK;
      

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