SPI library used to communicate with an altera development board attached to four zigbee-header pins.
Diff: mmSPI.h
- Revision:
- 22:7524dee5c753
- Parent:
- 21:e90dd0f8aaa1
- Child:
- 23:dbd89a56716d
--- a/mmSPI.h Tue Aug 20 14:02:56 2013 +0000 +++ b/mmSPI.h Tue Aug 20 14:13:32 2013 +0000 @@ -33,7 +33,7 @@ // byte transceive. - void transceive_vector2(char *cReceive, char *cSend, int cNumBytes); + void transceive_vector(char *cReceive, char *cSend, int cNumBytes); @@ -42,6 +42,10 @@ void write_memory(char, char, char, char *, char *); unsigned int read_memory(char, char *, char *); + + void setSendBuffer(char * pcSendBuffer); + void setReceiveBuffer(char * pcReceiveBuffer); + void setNumberOfBytes(int dNumberOfBytes); private: @@ -49,8 +53,11 @@ DigitalOut * pMISO; // SPI pin. DigitalOut * pSCLK; // SPI pin. DigitalOut * pCPUclk; // soft cpu clock. + char * pcSend; // SPI transmit vector. + char * pcReceive; // SPI receive vector. float fSPIfreq; // SPI clock frequency. float fSPIquarterP; // SPI quarter period. + int dNumBytes; // number of SPI bytes. int dLoop01; // loop index. int dLoop02; // loop index.