From 7dff07b2a890ada8bdce1f4a89f143b621660835 Mon Sep 17 00:00:00 2001 From: aleph Date: Mon, 6 Jun 2011 11:06:59 +0000 Subject: [PATCH] sam3: add twi definitions for SAM3N, SAM3S and SAM3U git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4941 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cpu/cortex-m3/io/sam3.h | 22 ++++++++++++++++++++++ bertos/cpu/cortex-m3/io/sam3_twi.h | 6 ++++++ 2 files changed, 28 insertions(+) diff --git a/bertos/cpu/cortex-m3/io/sam3.h b/bertos/cpu/cortex-m3/io/sam3.h index 94a72f77..beba6793 100644 --- a/bertos/cpu/cortex-m3/io/sam3.h +++ b/bertos/cpu/cortex-m3/io/sam3.h @@ -280,6 +280,28 @@ #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 /*\}*/ diff --git a/bertos/cpu/cortex-m3/io/sam3_twi.h b/bertos/cpu/cortex-m3/io/sam3_twi.h index f9ea16bf..48b0eb6d 100644 --- a/bertos/cpu/cortex-m3/io/sam3_twi.h +++ b/bertos/cpu/cortex-m3/io/sam3_twi.h @@ -40,6 +40,12 @@ #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 -- 2.25.1