From c4d7ccd784343a57497438a5d39ed6d12c5a72fe Mon Sep 17 00:00:00 2001 From: aleph Date: Wed, 2 Mar 2011 15:47:01 +0000 Subject: [PATCH] sam3 pio: add definitions for ports D, E and F. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4735 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cpu/cortex-m3/io/sam3_pio.h | 147 ++++++++++++++++++++++++++--- 1 file changed, 134 insertions(+), 13 deletions(-) diff --git a/bertos/cpu/cortex-m3/io/sam3_pio.h b/bertos/cpu/cortex-m3/io/sam3_pio.h index 498c2463..47bfd4ab 100644 --- a/bertos/cpu/cortex-m3/io/sam3_pio.h +++ b/bertos/cpu/cortex-m3/io/sam3_pio.h @@ -126,9 +126,9 @@ /*\}*/ -/** PIO A Register Addresses */ -/*\{*/ #if defined(PIOA_BASE) + /** PIO A Register Addresses */ + /*\{*/ #define PIOA_ACCESS(offset) (*((reg32_t *)(PIOA_BASE + (offset)))) #define PIOA_PER PIOA_ACCESS(PIO_PER_OFF) ///< PIO enable register address. @@ -163,12 +163,12 @@ #define PIOA_OWER PIOA_ACCESS(PIO_OWER_OFF) ///< PIO output write enable register address. #define PIOA_OWDR PIOA_ACCESS(PIO_OWDR_OFF) ///< PIO output write disable register address. #define PIOA_OWSR PIOA_ACCESS(PIO_OWSR_OFF) ///< PIO output write status register address. + /*\}*/ #endif /* PIOA_BASE */ -/*\}*/ -/** PIO B Register Addresses */ -/*\{*/ #if defined(PIOB_BASE) + /** PIO B Register Addresses */ + /*\{*/ #define PIOB_ACCESS(offset) (*((reg32_t *)(PIOB_BASE + (offset)))) #define PIOB_PER PIOB_ACCESS(PIO_PER_OFF) ///< PIO enable register address. @@ -203,12 +203,12 @@ #define PIOB_OWER PIOB_ACCESS(PIO_OWER_OFF) ///< PIO output write enable register address. #define PIOB_OWDR PIOB_ACCESS(PIO_OWDR_OFF) ///< PIO output write disable register address. #define PIOB_OWSR PIOB_ACCESS(PIO_OWSR_OFF) ///< PIO output write status register address. + /*\}*/ #endif /* PIOB_BASE */ -/*\}*/ -/** PIO C Register Addresses */ -/*\{*/ #if defined(PIOC_BASE) + /** PIO C Register Addresses */ + /*\{*/ #define PIOC_ACCESS(offset) (*((reg32_t *)(PIOC_BASE + (offset)))) #define PIOC_PER PIOC_ACCESS(PIO_PER_OFF) ///< PIO enable register address. @@ -243,14 +243,135 @@ #define PIOC_OWER PIOC_ACCESS(PIO_OWER_OFF) ///< PIO output write enable register address. #define PIOC_OWDR PIOC_ACCESS(PIO_OWDR_OFF) ///< PIO output write disable register address. #define PIOC_OWSR PIOC_ACCESS(PIO_OWSR_OFF) ///< PIO output write status register address. + /*\}*/ #endif /* PIOC_BASE */ -/*\}*/ -#define PIO_PERIPH_A 0 -#define PIO_PERIPH_B 1 +#if defined(PIOD_BASE) + /** PIO C Register Addresses */ + /*\{*/ + #define PIOD_ACCESS(offset) (*((reg32_t *)(PIOD_BASE + (offset)))) + + #define PIOD_PER PIOD_ACCESS(PIO_PER_OFF) ///< PIO enable register address. + #define PIOD_PDR PIOD_ACCESS(PIO_PDR_OFF) ///< PIO disable register address. + #define PIOD_PSR PIOD_ACCESS(PIO_PSR_OFF) ///< PIO status register address. + #define PIOD_OER PIOD_ACCESS(PIO_OER_OFF) ///< Output enable register address. + #define PIOD_ODR PIOD_ACCESS(PIO_ODR_OFF) ///< Output disable register address. + #define PIOD_OSR PIOD_ACCESS(PIO_OSR_OFF) ///< Output status register address. + #define PIOD_IFER PIOD_ACCESS(PIO_IFER_OFF) ///< Input filter enable register address. + #define PIOD_IFDR PIOD_ACCESS(PIO_IFDR_OFF) ///< Input filter disable register address. + #define PIOD_IFSR PIOD_ACCESS(PIO_IFSR_OFF) ///< Input filter status register address. + #define PIOD_SODR PIOD_ACCESS(PIO_SODR_OFF) ///< Set output data register address. + #define PIOD_CODR PIOD_ACCESS(PIO_CODR_OFF) ///< Clear output data register address. + #define PIOD_ODSR PIOD_ACCESS(PIO_ODSR_OFF) ///< Output data status register address. + #define PIOD_PDSR PIOD_ACCESS(PIO_PDSR_OFF) ///< Pin data status register address. + #define PIOD_IER PIOD_ACCESS(PIO_IER_OFF) ///< Interrupt enable register address. + #define PIOD_IDR PIOD_ACCESS(PIO_IDR_OFF) ///< Interrupt disable register address. + #define PIOD_IMR PIOD_ACCESS(PIO_IMR_OFF) ///< Interrupt mask register address. + #define PIOD_ISR PIOD_ACCESS(PIO_ISR_OFF) ///< Interrupt status register address. + #define PIOD_MDER PIOD_ACCESS(PIO_MDER_OFF) ///< Multi-driver enable register address. + #define PIOD_MDDR PIOD_ACCESS(PIO_MDDR_OFF) ///< Multi-driver disable register address. + #define PIOD_MDSR PIOD_ACCESS(PIO_MDSR_OFF) ///< Multi-driver status register address. + #define PIOD_PUDR PIOD_ACCESS(PIO_PUDR_OFF) ///< Pull-up disable register address. + #define PIOD_PUER PIOD_ACCESS(PIO_PUER_OFF) ///< Pull-up enable register address. + #define PIOD_PUSR PIOD_ACCESS(PIO_PUSR_OFF) ///< Pull-up status register address. +#ifdef PIO_ABSR_OFF + #define PIOD_ABSR PIOD_ACCESS(PIO_ABSR_OFF) ///< PIO peripheral select register address. +#else + #define PIOD_ABCDSR1 PIOD_ACCESS(PIO_ABCDSR1_OFF) ///< PIO peripheral select register 1 address. + #define PIOD_ABCDSR2 PIOD_ACCESS(PIO_ABCDSR2_OFF) ///< PIO peripheral select register 2 address. +#endif + #define PIOD_OWER PIOD_ACCESS(PIO_OWER_OFF) ///< PIO output write enable register address. + #define PIOD_OWDR PIOD_ACCESS(PIO_OWDR_OFF) ///< PIO output write disable register address. + #define PIOD_OWSR PIOD_ACCESS(PIO_OWSR_OFF) ///< PIO output write status register address. + /*\}*/ +#endif /* PIOD_BASE */ + +#if defined(PIOE_BASE) + /** PIO C Register Addresses */ + /*\{*/ + #define PIOE_ACCESS(offset) (*((reg32_t *)(PIOE_BASE + (offset)))) + + #define PIOE_PER PIOE_ACCESS(PIO_PER_OFF) ///< PIO enable register address. + #define PIOE_PDR PIOE_ACCESS(PIO_PDR_OFF) ///< PIO disable register address. + #define PIOE_PSR PIOE_ACCESS(PIO_PSR_OFF) ///< PIO status register address. + #define PIOE_OER PIOE_ACCESS(PIO_OER_OFF) ///< Output enable register address. + #define PIOE_ODR PIOE_ACCESS(PIO_ODR_OFF) ///< Output disable register address. + #define PIOE_OSR PIOE_ACCESS(PIO_OSR_OFF) ///< Output status register address. + #define PIOE_IFER PIOE_ACCESS(PIO_IFER_OFF) ///< Input filter enable register address. + #define PIOE_IFDR PIOE_ACCESS(PIO_IFDR_OFF) ///< Input filter disable register address. + #define PIOE_IFSR PIOE_ACCESS(PIO_IFSR_OFF) ///< Input filter status register address. + #define PIOE_SODR PIOE_ACCESS(PIO_SODR_OFF) ///< Set output data register address. + #define PIOE_CODR PIOE_ACCESS(PIO_CODR_OFF) ///< Clear output data register address. + #define PIOE_ODSR PIOE_ACCESS(PIO_ODSR_OFF) ///< Output data status register address. + #define PIOE_PDSR PIOE_ACCESS(PIO_PDSR_OFF) ///< Pin data status register address. + #define PIOE_IER PIOE_ACCESS(PIO_IER_OFF) ///< Interrupt enable register address. + #define PIOE_IDR PIOE_ACCESS(PIO_IDR_OFF) ///< Interrupt disable register address. + #define PIOE_IMR PIOE_ACCESS(PIO_IMR_OFF) ///< Interrupt mask register address. + #define PIOE_ISR PIOE_ACCESS(PIO_ISR_OFF) ///< Interrupt status register address. + #define PIOE_MDER PIOE_ACCESS(PIO_MDER_OFF) ///< Multi-driver enable register address. + #define PIOE_MDDR PIOE_ACCESS(PIO_MDDR_OFF) ///< Multi-driver disable register address. + #define PIOE_MDSR PIOE_ACCESS(PIO_MDSR_OFF) ///< Multi-driver status register address. + #define PIOE_PUDR PIOE_ACCESS(PIO_PUDR_OFF) ///< Pull-up disable register address. + #define PIOE_PUER PIOE_ACCESS(PIO_PUER_OFF) ///< Pull-up enable register address. + #define PIOE_PUSR PIOE_ACCESS(PIO_PUSR_OFF) ///< Pull-up status register address. +#ifdef PIO_ABSR_OFF + #define PIOE_ABSR PIOE_ACCESS(PIO_ABSR_OFF) ///< PIO peripheral select register address. +#else + #define PIOE_ABCDSR1 PIOE_ACCESS(PIO_ABCDSR1_OFF) ///< PIO peripheral select register 1 address. + #define PIOE_ABCDSR2 PIOE_ACCESS(PIO_ABCDSR2_OFF) ///< PIO peripheral select register 2 address. +#endif + #define PIOE_OWER PIOE_ACCESS(PIO_OWER_OFF) ///< PIO output write enable register address. + #define PIOE_OWDR PIOE_ACCESS(PIO_OWDR_OFF) ///< PIO output write disable register address. + #define PIOE_OWSR PIOE_ACCESS(PIO_OWSR_OFF) ///< PIO output write status register address. + /*\}*/ +#endif /* PIOE_BASE */ + +#if defined(PIOF_BASE) + /** PIO C Register Addresses */ + /*\{*/ + #define PIOF_ACCESS(offset) (*((reg32_t *)(PIOF_BASE + (offset)))) + + #define PIOF_PER PIOF_ACCESS(PIO_PER_OFF) ///< PIO enable register address. + #define PIOF_PDR PIOF_ACCESS(PIO_PDR_OFF) ///< PIO disable register address. + #define PIOF_PSR PIOF_ACCESS(PIO_PSR_OFF) ///< PIO status register address. + #define PIOF_OER PIOF_ACCESS(PIO_OER_OFF) ///< Output enable register address. + #define PIOF_ODR PIOF_ACCESS(PIO_ODR_OFF) ///< Output disable register address. + #define PIOF_OSR PIOF_ACCESS(PIO_OSR_OFF) ///< Output status register address. + #define PIOF_IFER PIOF_ACCESS(PIO_IFER_OFF) ///< Input filter enable register address. + #define PIOF_IFDR PIOF_ACCESS(PIO_IFDR_OFF) ///< Input filter disable register address. + #define PIOF_IFSR PIOF_ACCESS(PIO_IFSR_OFF) ///< Input filter status register address. + #define PIOF_SODR PIOF_ACCESS(PIO_SODR_OFF) ///< Set output data register address. + #define PIOF_CODR PIOF_ACCESS(PIO_CODR_OFF) ///< Clear output data register address. + #define PIOF_ODSR PIOF_ACCESS(PIO_ODSR_OFF) ///< Output data status register address. + #define PIOF_PDSR PIOF_ACCESS(PIO_PDSR_OFF) ///< Pin data status register address. + #define PIOF_IER PIOF_ACCESS(PIO_IER_OFF) ///< Interrupt enable register address. + #define PIOF_IDR PIOF_ACCESS(PIO_IDR_OFF) ///< Interrupt disable register address. + #define PIOF_IMR PIOF_ACCESS(PIO_IMR_OFF) ///< Interrupt mask register address. + #define PIOF_ISR PIOF_ACCESS(PIO_ISR_OFF) ///< Interrupt status register address. + #define PIOF_MDER PIOF_ACCESS(PIO_MDER_OFF) ///< Multi-driver enable register address. + #define PIOF_MDDR PIOF_ACCESS(PIO_MDDR_OFF) ///< Multi-driver disable register address. + #define PIOF_MDSR PIOF_ACCESS(PIO_MDSR_OFF) ///< Multi-driver status register address. + #define PIOF_PUDR PIOF_ACCESS(PIO_PUDR_OFF) ///< Pull-up disable register address. + #define PIOF_PUER PIOF_ACCESS(PIO_PUER_OFF) ///< Pull-up enable register address. + #define PIOF_PUSR PIOF_ACCESS(PIO_PUSR_OFF) ///< Pull-up status register address. +#ifdef PIO_ABSR_OFF + #define PIOF_ABSR PIOF_ACCESS(PIO_ABSR_OFF) ///< PIO peripheral select register address. +#else + #define PIOF_ABCDSR1 PIOF_ACCESS(PIO_ABCDSR1_OFF) ///< PIO peripheral select register 1 address. + #define PIOF_ABCDSR2 PIOF_ACCESS(PIO_ABCDSR2_OFF) ///< PIO peripheral select register 2 address. +#endif + #define PIOF_OWER PIOF_ACCESS(PIO_OWER_OFF) ///< PIO output write enable register address. + #define PIOF_OWDR PIOF_ACCESS(PIO_OWDR_OFF) ///< PIO output write disable register address. + #define PIOF_OWSR PIOF_ACCESS(PIO_OWSR_OFF) ///< PIO output write status register address. + /*\}*/ +#endif /* PIOF_BASE */ + + +#define PIO_PERIPH_A 0 +#define PIO_PERIPH_B 1 #ifdef PIO_ABCDSR1_OFF - #define PIO_PERIPH_C 2 - #define PIO_PERIPH_D 3 + #define PIO_PERIPH_C 2 + #define PIO_PERIPH_D 3 #endif /** -- 2.25.1