White Wizard SPI Chip Select test program. I changed chip select signal timing.

Dependencies:   mbed

Committer:
halfpitch
Date:
Thu Sep 01 10:05:25 2011 +0000
Revision:
2:5312f16c3ee8
Parent:
1:048ae028f72d
Rev.B

Who changed what in which revision?

UserRevisionLine numberNew contents of line
halfpitch 1:048ae028f72d 1 #include "mbed.h"
halfpitch 1:048ae028f72d 2 #include "wwChipSelect.h"
halfpitch 1:048ae028f72d 3
halfpitch 1:048ae028f72d 4 //Nest Egg Inc.
halfpitch 1:048ae028f72d 5 //http://nestegg.jp/
halfpitch 1:048ae028f72d 6 //channel No must be A1 A2 A3 A4
halfpitch 1:048ae028f72d 7 //#define ch_num 0x05 //channel No 0101, depend on your SPI module setting.
halfpitch 1:048ae028f72d 8 #define ch_num 0x0A //channel No 1010, depend on your SPI module setting.
halfpitch 1:048ae028f72d 9 #define reset_ch 0x00 //channel No 0000, for reset.
halfpitch 1:048ae028f72d 10
halfpitch 1:048ae028f72d 11 DigitalOut myled(LED1);
halfpitch 1:048ae028f72d 12
halfpitch 1:048ae028f72d 13 int main() {
halfpitch 1:048ae028f72d 14
halfpitch 1:048ae028f72d 15 wwChipSelect wwcs(p8);
halfpitch 1:048ae028f72d 16
halfpitch 1:048ae028f72d 17 while(1) {
halfpitch 1:048ae028f72d 18 wwcs.wwCSwrite(ch_num);
halfpitch 1:048ae028f72d 19 myled = 1;
halfpitch 1:048ae028f72d 20 wait(0.2);
halfpitch 1:048ae028f72d 21
halfpitch 1:048ae028f72d 22 wwcs.wwCSwrite(reset_ch);
halfpitch 1:048ae028f72d 23 myled = 0;
halfpitch 1:048ae028f72d 24 wait(0.2);
halfpitch 1:048ae028f72d 25 }
halfpitch 1:048ae028f72d 26 }