Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
mmSPI.h@6:b480fc4e87e5, 2013-08-14 (annotated)
- Committer:
- gatedClock
- Date:
- Wed Aug 14 15:19:24 2013 +0000
- Revision:
- 6:b480fc4e87e5
- Parent:
- 5:b14dcaae260e
- Child:
- 7:b3e8b537d5c2
void mmSPI::transceive_byte(char *cReceive, char *cSend)
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 | 3:de99451ab3c0 | 14 | #define mmSPI_MOSI p9 // SPI interface pin. |
| gatedClock | 3:de99451ab3c0 | 15 | #define mmSPI_MISO p10 // SPI interface pin. |
| gatedClock | 3:de99451ab3c0 | 16 | #define mmSPI_SCLK p30 // SPI interface pin. |
| gatedClock | 2:bebcf53b72dc | 17 | |
| gatedClock | 2:bebcf53b72dc | 18 | |
| gatedClock | 3:de99451ab3c0 | 19 | |
| gatedClock | 0:fb42c5acf810 | 20 | /*----------------------------------------------//------------------------------ |
| gatedClock | 0:fb42c5acf810 | 21 | ------------------------------------------------//----------------------------*/ |
| gatedClock | 2:bebcf53b72dc | 22 | |
| gatedClock | 0:fb42c5acf810 | 23 | //==============================================//============================== |
| gatedClock | 0:fb42c5acf810 | 24 | class mmSPI |
| gatedClock | 0:fb42c5acf810 | 25 | { |
| gatedClock | 0:fb42c5acf810 | 26 | public: |
| gatedClock | 0:fb42c5acf810 | 27 | mmSPI(); // constructor. |
| gatedClock | 0:fb42c5acf810 | 28 | ~mmSPI(); // destructor. |
| gatedClock | 3:de99451ab3c0 | 29 | void allocations(); // object allocations. |
| gatedClock | 4:aa1fe8707bef | 30 | void setSPIfrequency(float); // set SPI clock frequency. |
| gatedClock | 6:b480fc4e87e5 | 31 | |
| gatedClock | 6:b480fc4e87e5 | 32 | // byte transceive. |
| gatedClock | 6:b480fc4e87e5 | 33 | void transceive_byte(char *cReceive, char *cSend); |
| gatedClock | 0:fb42c5acf810 | 34 | private: |
| gatedClock | 2:bebcf53b72dc | 35 | |
| gatedClock | 3:de99451ab3c0 | 36 | DigitalOut * pMOSI; // SPI pin. |
| gatedClock | 3:de99451ab3c0 | 37 | DigitalOut * pMISO; // SPI pin. |
| gatedClock | 3:de99451ab3c0 | 38 | DigitalOut * pSCLK; // SPI pin. |
| gatedClock | 4:aa1fe8707bef | 39 | float fSPIfreq; // SPI clock frequency. |
| gatedClock | 4:aa1fe8707bef | 40 | float fSPIquarterP; // SPI quarter period. |
| gatedClock | 5:b14dcaae260e | 41 | char cLoop01; // loop index. |
| gatedClock | 3:de99451ab3c0 | 42 | |
| gatedClock | 2:bebcf53b72dc | 43 | |
| gatedClock | 2:bebcf53b72dc | 44 | |
| gatedClock | 0:fb42c5acf810 | 45 | }; |
| gatedClock | 2:bebcf53b72dc | 46 | //----------------------------------------------//------------------------------ |
| gatedClock | 2:bebcf53b72dc | 47 | #endif // include guard. |