diff options
author | Rocco Marco Guglielmi <roccomarco.guglielmi@gmail.com> | 2017-09-17 17:11:26 +0000 |
---|---|---|
committer | Rocco Marco Guglielmi <roccomarco.guglielmi@gmail.com> | 2017-09-17 17:11:26 +0000 |
commit | a60222ee6ec36b0a08b53defbf6bf82fed4b2acb (patch) | |
tree | 45883166b0d9f189e45e6d3838c3e52d3fd41cdd /os/hal/boards/ATSAMA5D2_XULT/board.h | |
parent | e77c71f96a2aa0f0a24985d957b0add42d05b2ac (diff) | |
download | ChibiOS-a60222ee6ec36b0a08b53defbf6bf82fed4b2acb.tar.gz ChibiOS-a60222ee6ec36b0a08b53defbf6bf82fed4b2acb.tar.bz2 ChibiOS-a60222ee6ec36b0a08b53defbf6bf82fed4b2acb.zip |
Added board init mechanism for SAMA5D27
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10623 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/boards/ATSAMA5D2_XULT/board.h')
-rw-r--r-- | os/hal/boards/ATSAMA5D2_XULT/board.h | 163 |
1 files changed, 163 insertions, 0 deletions
diff --git a/os/hal/boards/ATSAMA5D2_XULT/board.h b/os/hal/boards/ATSAMA5D2_XULT/board.h index 8f4f7a662..3a72e7551 100644 --- a/os/hal/boards/ATSAMA5D2_XULT/board.h +++ b/os/hal/boards/ATSAMA5D2_XULT/board.h @@ -43,6 +43,169 @@ */
#define SAMA5D27
+/**
+ * Port identifiers.
+ */
+#define SAMA_PIOA 0U
+#define SAMA_PIOB 1U
+#define SAMA_PIOC 2U
+#define SAMA_PIOD 3U
+
+/*
+ * Forms a line identifier. In this driver the pad number is encoded in the
+ * lower 5 bits of line and the port in sixth and seventh bits.
+ */
+#define SAMA_LINE(port, pad) \
+ ((uint32_t)((uint32_t)(port << 5U)) | ((uint32_t)(pad)))
+
+/*
+ * Decodes a port identifier from a line identifier.
+ */
+#define SAMA_PORT(line) \
+ ((uint32_t)((line & 0xFFFFFFE0U) >> 5U)
+
+/**
+ * Decodes a pad identifier from a line identifier.
+ */
+#define SAMA_PAD(line) \
+ ((uint32_t)(line & 0x0000001FU))
+
+
+/*
+ * IO pins assignments.
+ */
+#define PIOA_PIO0 0U
+#define PIOA_PIN1 1U
+#define PIOA_PIN2 2U
+#define PIOA_PIN3 3U
+#define PIOA_PIN4 4U
+#define PIOA_PIN5 5U
+#define PIOA_PIN6 6U
+#define PIOA_PIN7 7U
+#define PIOA_PIN8 8U
+#define PIOA_PIN9 9U
+#define PIOA_PIN10 10U
+#define PIOA_PIN11 11U
+#define PIOA_PIN12 12U
+#define PIOA_PIN13 13U
+#define PIOA_PIN14 14U
+#define PIOA_PIN15 15U
+#define PIOA_PIN16 16U
+#define PIOA_PIN17 17U
+#define PIOA_PIN18 18U
+#define PIOA_PIN19 19U
+#define PIOA_PIN20 20U
+#define PIOA_PIN21 21U
+#define PIOA_PIN22 22U
+#define PIOA_PIN23 23U
+#define PIOA_PIN24 24U
+#define PIOA_PIN25 25U
+#define PIOA_PIN26 26U
+#define PIOA_PIN27 27U
+#define PIOA_PIN28 28U
+#define PIOA_PIN29 29U
+#define PIOA_PIN30 30U
+#define PIOA_PIN31 31U
+
+#define PIOB_LED_BLUE 0U
+#define PIOB_PIN1 1U
+#define PIOB_PIN2 2U
+#define PIOB_PIN3 3U
+#define PIOB_PIN4 4U
+#define PIOB_LED_GREEN 5U
+#define PIOB_LED_RED 6U
+#define PIOB_PIN7 7U
+#define PIOB_PIN8 8U
+#define PIOB_PIN9 9U
+#define PIOB_PIN10 10U
+#define PIOB_PIN11 11U
+#define PIOB_PIN12 12U
+#define PIOB_PIN13 13U
+#define PIOB_PIN14 14U
+#define PIOB_PIN15 15U
+#define PIOB_PIN16 16U
+#define PIOB_PIN17 17U
+#define PIOB_PIN18 18U
+#define PIOB_PIN19 19U
+#define PIOB_PIN20 20U
+#define PIOB_PIN21 21U
+#define PIOB_PIN22 22U
+#define PIOB_PIN23 23U
+#define PIOB_PIN24 24U
+#define PIOB_PIN25 25U
+#define PIOB_PIN26 26U
+#define PIOB_PIN27 27U
+#define PIOB_PIN28 28U
+#define PIOB_PIN29 29U
+#define PIOB_PIN30 30U
+#define PIOB_PIN31 31U
+
+#define PIOC_PIO0 0U
+#define PIOC_PIN1 1U
+#define PIOC_PIN2 2U
+#define PIOC_PIN3 3U
+#define PIOC_PIN4 4U
+#define PIOC_PIN5 5U
+#define PIOC_PIN6 6U
+#define PIOC_PIN7 7U
+#define PIOC_PIN8 8U
+#define PIOC_PIN9 9U
+#define PIOC_PIN10 10U
+#define PIOC_PIN11 11U
+#define PIOC_PIN12 12U
+#define PIOC_PIN13 13U
+#define PIOC_PIN14 14U
+#define PIOC_PIN15 15U
+#define PIOC_PIN16 16U
+#define PIOC_PIN17 17U
+#define PIOC_PIN18 18U
+#define PIOC_PIN19 19U
+#define PIOC_PIN20 20U
+#define PIOC_PIN21 21U
+#define PIOC_PIN22 22U
+#define PIOC_PIN23 23U
+#define PIOC_PIN24 24U
+#define PIOC_PIN25 25U
+#define PIOC_PIN26 26U
+#define PIOC_PIN27 27U
+#define PIOC_PIN28 28U
+#define PIOC_PIN29 29U
+#define PIOC_PIN30 30U
+#define PIOC_PIN31 31U
+
+#define PIOD_PIO0 0U
+#define PIOD_PIN1 1U
+#define PIOD_PIN2 2U
+#define PIOD_PIN3 3U
+#define PIOD_PIN4 4U
+#define PIOD_PIN5 5U
+#define PIOD_PIN6 6U
+#define PIOD_PIN7 7U
+#define PIOD_PIN8 8U
+#define PIOD_PIN9 9U
+#define PIOD_PIN10 10U
+#define PIOD_PIN11 11U
+#define PIOD_PIN12 12U
+#define PIOD_PIN13 13U
+#define PIOD_PIN14 14U
+#define PIOD_PIN15 15U
+#define PIOD_PIN16 16U
+#define PIOD_PIN17 17U
+#define PIOD_PIN18 18U
+#define PIOD_PIN19 19U
+#define PIOD_PIN20 20U
+#define PIOD_PIN21 21U
+#define PIOD_PIN22 22U
+#define PIOD_PIN23 23U
+#define PIOD_PIN24 24U
+#define PIOD_PIN25 25U
+#define PIOD_PIN26 26U
+#define PIOD_PIN27 27U
+#define PIOD_PIN28 28U
+#define PIOD_PIN29 29U
+#define PIOD_PIN30 30U
+#define PIOD_PIN31 31U
+
#if !defined(_FROM_ASM_)
#ifdef __cplusplus
extern "C" {
|