goodfet needs SS not CS for nrf application
[goodfet] / firmware / include / spi.h
index cede5c4..097510e 100644 (file)
 # define SS   (1 << PA3)
 # define TST  (1 << PA4)
 # define XRST (1 << PA5)
+#elif (platform == arduino)
+// pin Arduini - nrf pin
+//                                      - nrf 1 GND
+//                                      - nrf 2 +3.3V
+# define CE   (1 << PB1) // pin 9       - nrf 3 CE
+# define SS   (1 << PB2) // pin 10 CS   - nrf 4 CSN
+# define MOSI (1 << PB3) // pin 11 MOSI - nrf 6 MOSI
+# define MISO (1 << PB4) // pin 12 MISO - nrf 7 MISO
+# define SCK  (1 << PB5) // pin 13 SCL  - nrf 5 CLK
+//                                      - nrf 8 IRQ
+//# define TST  (1 << PA4)
+//# define XRST (1 << PA5)
 #else
 # define MOSI BIT1
 # define MISO BIT2
 # define SCK  BIT3
+# define TST  BIT0
+# define RST  BIT6
 #endif
+//Apimotev2 SET/CLRRST needs to be on pin 21, so 2.1 -- just redefine RST to BIT0
 
 #define SETMOSI SPIOUT|=MOSI
 #define CLRMOSI SPIOUT&=~MOSI
 # define CLRTST PORTA&=~(1 << PA4);
 # define SETRST PORTA|=(1 << PA5);
 # define CLRRST PORTA&=~(1 << PA5);
+#elif (platform == arduino)
+//# define SETTST PORTA|=(1 << PA4);
+//# define CLRTST PORTA&=~(1 << PA4);
+//# define SETRST PORTA|=(1 << PA5);
+//# define CLRRST PORTA&=~(1 << PA5);
 #else
 # define SETTST P4OUT|=TST
 # define CLRTST P4OUT&=~TST