
White Wizard SPI Chip Select test program. I changed chip select signal timing.
wwChipSelect.cpp
- Committer:
- halfpitch
- Date:
- 2011-07-25
- Revision:
- 1:048ae028f72d
- Parent:
- 0:1d2148b42390
- Child:
- 2:5312f16c3ee8
File content as of revision 1:048ae028f72d:
//Nest Egg Inc. //http://wizard.nestegg.jp/ //White Wizard Board SPI Chip Select Code //Auther : Yoshinari kou //2010/10/03 #include "wwChipSelect.h" wwChipSelect :: wwChipSelect(PinName cs): ChipSelect(cs){ } void wwChipSelect :: wwCSwrite(int ch){ //start ChipSelect.write(1); wait_us(20); ChipSelect.write(0); wait_us(26);//26 //A1 ChipSelect.write(0x01 & ch); wait_us(20);//46 //A2 ChipSelect.write((0x02 & ch)>>1); wait_us(20);//66 //A3 ChipSelect.write((0x04 & ch)>>2); wait_us(20);//86 //A4 ChipSelect.write((0x08 & ch)>>3); wait_us(20);//106 ChipSelect.write(1); }