sam3: add twi definitions for SAM3N, SAM3S and SAM3U
authoraleph <aleph@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 6 Jun 2011 11:06:59 +0000 (11:06 +0000)
committeraleph <aleph@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 6 Jun 2011 11:06:59 +0000 (11:06 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4941 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/cpu/cortex-m3/io/sam3.h
bertos/cpu/cortex-m3/io/sam3_twi.h

index 94a72f77c944f7c93d071e60fc47899e6caf57aa..beba679391074cd0bc1ceea4d17bf0fa1f0cf125 100644 (file)
        #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
 
 /*\}*/
index f9ea16bf151820d390c0d998fceb88ce5ea62fa4..48b0eb6d01475063a580b142417c55a7cad9f3da 100644 (file)
 #if CPU_CM3_SAM3X
        #define TWI0_BASE  0x4008C000
        #define TWI1_BASE  0x40090000
+#elif CPU_CM3_SAM3N || CPU_CM3_SAM3S
+       #define TWI0_BASE  0x40018000
+       #define TWI1_BASE  0x4001C000
+#elif CPU_CM3_SAM3U
+       #define TWI0_BASE  0x40084000
+       #define TWI1_BASE  0x40088000
 #else
        #error TWI registers not defined for selected CPU
 #endif