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
mmSPI.h@2:bebcf53b72dc, 2013-08-14 (annotated)
- Committer:
- gatedClock
- Date:
- Wed Aug 14 10:30:30 2013 +0000
- Revision:
- 2:bebcf53b72dc
- Parent:
- 1:15706d15d123
- Child:
- 3:de99451ab3c0
toward defining DigitalOut objects within a class. it doesn't look to be working with straight instantiation, so use allocation instead.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gatedClock | 2:bebcf53b72dc | 1 | #ifndef mmSPI_H // include guard. |
gatedClock | 2:bebcf53b72dc | 2 | #define mmSPI_H // include guard. |
gatedClock | 0:fb42c5acf810 | 3 | /*----------------------------------------------//------------------------------ |
gatedClock | 0:fb42c5acf810 | 4 | student : m-moore |
gatedClock | 0:fb42c5acf810 | 5 | class : external SPI interface |
gatedClock | 0:fb42c5acf810 | 6 | directory : mmSPI |
gatedClock | 0:fb42c5acf810 | 7 | file : mmSPI.h |
gatedClock | 1:15706d15d123 | 8 | ----description---------------------------------//------------------------------ |
gatedClock | 1:15706d15d123 | 9 | ----notes---------------------------------------//------------------------------ |
gatedClock | 1:15706d15d123 | 10 | 1. the SPI interface pins are routed to the zigbee header. |
gatedClock | 0:fb42c5acf810 | 11 | ------------------------------------------------//----------------------------*/ |
gatedClock | 0:fb42c5acf810 | 12 | #include "mbed.h" // standard mbed.org class. |
gatedClock | 1:15706d15d123 | 13 | //---defines------------------------------------//------------------------------ |
gatedClock | 1:15706d15d123 | 14 | #define MOSI p9 // SPI interface pin. |
gatedClock | 1:15706d15d123 | 15 | #define MISO p10 // SPI interface pin. |
gatedClock | 1:15706d15d123 | 16 | #define SCLK p30 // SPI interface pin. |
gatedClock | 2:bebcf53b72dc | 17 | |
gatedClock | 2:bebcf53b72dc | 18 | |
gatedClock | 2:bebcf53b72dc | 19 | //DigitalOut xbee_nrst(p30); |
gatedClock | 2:bebcf53b72dc | 20 | //DigitalOut xbee_tx(p9); |
gatedClock | 2:bebcf53b72dc | 21 | //DigitalOut xbee_rx(p10); |
gatedClock | 0:fb42c5acf810 | 22 | /*----------------------------------------------//------------------------------ |
gatedClock | 0:fb42c5acf810 | 23 | ------------------------------------------------//----------------------------*/ |
gatedClock | 2:bebcf53b72dc | 24 | |
gatedClock | 0:fb42c5acf810 | 25 | //==============================================//============================== |
gatedClock | 0:fb42c5acf810 | 26 | class mmSPI |
gatedClock | 0:fb42c5acf810 | 27 | { |
gatedClock | 0:fb42c5acf810 | 28 | public: |
gatedClock | 0:fb42c5acf810 | 29 | mmSPI(); // constructor. |
gatedClock | 0:fb42c5acf810 | 30 | ~mmSPI(); // destructor. |
gatedClock | 1:15706d15d123 | 31 | char transceive_byte(char); // byte transceive. |
gatedClock | 0:fb42c5acf810 | 32 | private: |
gatedClock | 2:bebcf53b72dc | 33 | |
gatedClock | 2:bebcf53b72dc | 34 | DigitalOut * pSCLK; |
gatedClock | 2:bebcf53b72dc | 35 | |
gatedClock | 2:bebcf53b72dc | 36 | |
gatedClock | 0:fb42c5acf810 | 37 | }; |
gatedClock | 2:bebcf53b72dc | 38 | //----------------------------------------------//------------------------------ |
gatedClock | 2:bebcf53b72dc | 39 | #endif // include guard. |