sam3 ethernet: remove kludge to fix early sam3x-ek ethernet.
[bertos.git] / bertos / cpu / cortex-m3 / io / sam3.h
index 59931f963c7e6eed0c4476d15c37613f76675ab3..beba679391074cd0bc1ceea4d17bf0fa1f0cf125 100644 (file)
 #include "sam3_adc.h"
 #include "sam3_dacc.h"
 #include "sam3_tc.h"
+#include "sam3_twi.h"
 
 /**
  * U(S)ART I/O pins
 /*\}*/
 
 /**
- * PIO I/O pins
+ * SPI I/O pins
  */
 /*\{*/
 #if CPU_CM3_SAM3U
        #define SPI0_MOSI   13
        #define SPI0_MISO   12
 #endif
+/*\}*/
+
+/**
+ * TWI I/O pins
+ */
+/*\{*/
+#if CPU_CM3_SAM3X
+       #define TWI0_PORT   PIOA_BASE
+       #define TWI1_PORT   PIOA_BASE
+
+       #define TWI0_PERIPH  PIO_PERIPH_A
+       #define TWI1_PERIPH  PIO_PERIPH_A
+
+       #define TWI0_TWD    17
+       #define TWI0_TWCK   18
+       #define TWI1_TWD    12
+       #define TWI1_TWCK   13
+#elif CPU_CM3_SAM3N || CPU_CM3_SAM3S
+       #define TWI0_PORT   PIOA_BASE
+       #define TWI1_PORT   PIOB_BASE
+
+       #define TWI0_PERIPH  PIO_PERIPH_A
+       #define TWI1_PERIPH  PIO_PERIPH_A
+
+       #define TWI0_TWD    3
+       #define TWI0_TWCK   4
+       #define TWI1_TWD    4
+       #define TWI1_TWCK   5
+#elif CPU_CM3_SAM3U
+       #define TWI0_PORT   PIOA_BASE
+       #define TWI1_PORT   PIOA_BASE
+
+       #define TWI0_PERIPH  PIO_PERIPH_A
+       #define TWI1_PERIPH  PIO_PERIPH_A
+
+       #define TWI0_TWD    9
+       #define TWI0_TWCK   10
+       #define TWI1_TWD    24
+       #define TWI1_TWCK   25
+#endif
+
 /*\}*/
 #endif /* SAM3_H */