mbed-os

Fork of mbed-os by erkin yucel

Committer:
elessair
Date:
Sun Oct 23 15:10:02 2016 +0000
Revision:
0:f269e3021894
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
elessair 0:f269e3021894 1 /**
elessair 0:f269e3021894 2 ******************************************************************************
elessair 0:f269e3021894 3 * @file pad_map.h
elessair 0:f269e3021894 4 * @brief PAD hw module register map
elessair 0:f269e3021894 5 * @internal
elessair 0:f269e3021894 6 * @author ON Semiconductor
elessair 0:f269e3021894 7 * $Rev: 3166 $
elessair 0:f269e3021894 8 * $Date: 2015-01-19 11:28:08 +0530 (Mon, 19 Jan 2015) $
elessair 0:f269e3021894 9 ******************************************************************************
elessair 0:f269e3021894 10 * Copyright 2016 Semiconductor Components Industries LLC (d/b/a “ON Semiconductor”).
elessair 0:f269e3021894 11 * All rights reserved. This software and/or documentation is licensed by ON Semiconductor
elessair 0:f269e3021894 12 * under limited terms and conditions. The terms and conditions pertaining to the software
elessair 0:f269e3021894 13 * and/or documentation are available at http://www.onsemi.com/site/pdf/ONSEMI_T&C.pdf
elessair 0:f269e3021894 14 * (“ON Semiconductor Standard Terms and Conditions of Sale, Section 8 Software”) and
elessair 0:f269e3021894 15 * if applicable the software license agreement. Do not use this software and/or
elessair 0:f269e3021894 16 * documentation unless you have carefully read and you agree to the limited terms and
elessair 0:f269e3021894 17 * conditions. By using this software and/or documentation, you agree to the limited
elessair 0:f269e3021894 18 * terms and conditions.
elessair 0:f269e3021894 19 *
elessair 0:f269e3021894 20 * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
elessair 0:f269e3021894 21 * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
elessair 0:f269e3021894 22 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
elessair 0:f269e3021894 23 * ON SEMICONDUCTOR SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL,
elessair 0:f269e3021894 24 * INCIDENTAL, OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
elessair 0:f269e3021894 25 * @endinternal
elessair 0:f269e3021894 26 *
elessair 0:f269e3021894 27 * @ingroup pad
elessair 0:f269e3021894 28 *
elessair 0:f269e3021894 29 * @details
elessair 0:f269e3021894 30 */
elessair 0:f269e3021894 31
elessair 0:f269e3021894 32 #ifndef PAD_MAP_H_
elessair 0:f269e3021894 33 #define PAD_MAP_H_
elessair 0:f269e3021894 34
elessair 0:f269e3021894 35 /*************************************************************************************************
elessair 0:f269e3021894 36 * *
elessair 0:f269e3021894 37 * Header files *
elessair 0:f269e3021894 38 * *
elessair 0:f269e3021894 39 *************************************************************************************************/
elessair 0:f269e3021894 40
elessair 0:f269e3021894 41 #include "architecture.h"
elessair 0:f269e3021894 42
elessair 0:f269e3021894 43 /*************************************************************************************************
elessair 0:f269e3021894 44 * *
elessair 0:f269e3021894 45 * Symbolic Constants *
elessair 0:f269e3021894 46 * *
elessair 0:f269e3021894 47 *************************************************************************************************/
elessair 0:f269e3021894 48
elessair 0:f269e3021894 49 /** no pull up nor pull down */
elessair 0:f269e3021894 50 #define PAD_PULL_NONE (uint8_t)0x01
elessair 0:f269e3021894 51 /** pull down */
elessair 0:f269e3021894 52 #define PAD_PULL_DOWN (uint8_t)0x00
elessair 0:f269e3021894 53 /** pull up */
elessair 0:f269e3021894 54 #define PAD_PULL_UP (uint8_t)0x03
elessair 0:f269e3021894 55
elessair 0:f269e3021894 56 /** Drive strength */
elessair 0:f269e3021894 57 #define PAD_DRIVE_L0 (uint8_t)0x00
elessair 0:f269e3021894 58 #define PAD_DRIVE_L1 (uint8_t)0x01
elessair 0:f269e3021894 59 #define PAD_DRIVE_L2 (uint8_t)0x02
elessair 0:f269e3021894 60 #define PAD_DRIVE_L3 (uint8_t)0x03
elessair 0:f269e3021894 61 #define PAD_DRIVE_L4 (uint8_t)0x04
elessair 0:f269e3021894 62 #define PAD_DRIVE_L5 (uint8_t)0x05
elessair 0:f269e3021894 63 #define PAD_DRIVE_L6 (uint8_t)0x06
elessair 0:f269e3021894 64
elessair 0:f269e3021894 65 /** output configuration push/pull */
elessair 0:f269e3021894 66 #define PAD_OUTCFG_PUSHPULL (uint8_t)0x00
elessair 0:f269e3021894 67 /** output configuration open drain */
elessair 0:f269e3021894 68 #define PAD_OOUTCFG_OPENDRAIN (uint8_t)0x01
elessair 0:f269e3021894 69
elessair 0:f269e3021894 70 /** lowest power PAD configuration, shall be the default */
elessair 0:f269e3021894 71 #define PAD_LOW_POWER (PAD_PULL_NONE | (PAD_DRIVE_L0<<2) | (PAD_OOUTCFG_OPENDRAIN<<5))
elessair 0:f269e3021894 72
elessair 0:f269e3021894 73 /** custom Power PAD configuration */
elessair 0:f269e3021894 74 #ifdef REVD
elessair 0:f269e3021894 75 #define PAD_OUTPUT_PN_L1_OD (PAD_PULL_NONE | (PAD_DRIVE_L1<<2) | (PAD_OOUTCFG_OPENDRAIN<<5))
elessair 0:f269e3021894 76 #define PAD_INPUT_PD_L1_PP (PAD_PULL_DOWN | (PAD_DRIVE_L1<<2) | (PAD_OUTCFG_PUSHPULL<<5))
elessair 0:f269e3021894 77 #define PAD_UNUSED_PD_L0_PP (PAD_PULL_DOWN | (PAD_DRIVE_L0<<2) | (PAD_OUTCFG_PUSHPULL<<5))
elessair 0:f269e3021894 78
elessair 0:f269e3021894 79 #define PAD_UART_TX (PAD_PULL_UP | (PAD_DRIVE_L1<<2) | (PAD_OUTCFG_PUSHPULL<<5))
elessair 0:f269e3021894 80 #define PAD_UART_RX (PAD_PULL_UP | (PAD_DRIVE_L1<<2) | (PAD_OOUTCFG_OPENDRAIN<<5))
elessair 0:f269e3021894 81 #endif /* REVD */
elessair 0:f269e3021894 82
elessair 0:f269e3021894 83 /**************************************************************************************************
elessair 0:f269e3021894 84 * *
elessair 0:f269e3021894 85 * Type definitions *
elessair 0:f269e3021894 86 * *
elessair 0:f269e3021894 87 **************************************************************************************************/
elessair 0:f269e3021894 88
elessair 0:f269e3021894 89 /** Pad control
elessair 0:f269e3021894 90 * The pad control peripheral is used to setup any necessary pad parameters
elessair 0:f269e3021894 91 * not controlled directly via the cross-bar: output drive strength,
elessair 0:f269e3021894 92 * push/pull control and output drive type.
elessair 0:f269e3021894 93 */
elessair 0:f269e3021894 94 typedef struct {
elessair 0:f269e3021894 95 union {
elessair 0:f269e3021894 96 struct {
elessair 0:f269e3021894 97 __IO uint32_t PULL :2; /**< 00 – Pull-down active, 01 – No pull active, 10 – No pull active, 11 – Pull-up active*/
elessair 0:f269e3021894 98 __IO uint32_t POWER :3; /**< Output Drive Strength*/
elessair 0:f269e3021894 99 __IO uint32_t TYPE :1; /**< Output Type: 0 – Push/Pull, 1 – Open Drain*/
elessair 0:f269e3021894 100 } BITS;
elessair 0:f269e3021894 101 __IO uint32_t WORD;
elessair 0:f269e3021894 102 } PADIO0;
elessair 0:f269e3021894 103 union {
elessair 0:f269e3021894 104 struct {
elessair 0:f269e3021894 105 __IO uint32_t PULL :2; /**< 00 – Pull-down active, 01 – No pull active, 10 – No pull active, 11 – Pull-up active*/
elessair 0:f269e3021894 106 __IO uint32_t POWER :3; /**< Output Drive Strength*/
elessair 0:f269e3021894 107 __IO uint32_t TYPE :1; /**< Output Type: 0 – Push/Pull, 1 – Open Drain*/
elessair 0:f269e3021894 108 } BITS;
elessair 0:f269e3021894 109 __IO uint32_t WORD;
elessair 0:f269e3021894 110 } PADIO1;
elessair 0:f269e3021894 111 union {
elessair 0:f269e3021894 112 struct {
elessair 0:f269e3021894 113 __IO uint32_t PULL :2; /**< 00 – Pull-down active, 01 – No pull active, 10 – No pull active, 11 – Pull-up active*/
elessair 0:f269e3021894 114 __IO uint32_t POWER :3; /**< Output Drive Strength*/
elessair 0:f269e3021894 115 __IO uint32_t TYPE :1; /**< Output Type: 0 – Push/Pull, 1 – Open Drain*/
elessair 0:f269e3021894 116 } BITS;
elessair 0:f269e3021894 117 __IO uint32_t WORD;
elessair 0:f269e3021894 118 } PADIO2;
elessair 0:f269e3021894 119 union {
elessair 0:f269e3021894 120 struct {
elessair 0:f269e3021894 121 __IO uint32_t PULL :2; /**< 00 – Pull-down active, 01 – No pull active, 10 – No pull active, 11 – Pull-up active*/
elessair 0:f269e3021894 122 __IO uint32_t POWER :3; /**< Output Drive Strength*/
elessair 0:f269e3021894 123 __IO uint32_t TYPE :1; /**< Output Type: 0 – Push/Pull, 1 – Open Drain*/
elessair 0:f269e3021894 124 } BITS;
elessair 0:f269e3021894 125 __IO uint32_t WORD;
elessair 0:f269e3021894 126 } PADIO3;
elessair 0:f269e3021894 127 union {
elessair 0:f269e3021894 128 struct {
elessair 0:f269e3021894 129 __IO uint32_t PULL :2; /**< 00 – Pull-down active, 01 – No pull active, 10 – No pull active, 11 – Pull-up active*/
elessair 0:f269e3021894 130 __IO uint32_t POWER :3; /**< Output Drive Strength*/
elessair 0:f269e3021894 131 __IO uint32_t TYPE :1; /**< Output Type: 0 – Push/Pull, 1 – Open Drain*/
elessair 0:f269e3021894 132 } BITS;
elessair 0:f269e3021894 133 __IO uint32_t WORD;
elessair 0:f269e3021894 134 } PADIO4;
elessair 0:f269e3021894 135 union {
elessair 0:f269e3021894 136 struct {
elessair 0:f269e3021894 137 __IO uint32_t PULL :2; /**< 00 – Pull-down active, 01 – No pull active, 10 – No pull active, 11 – Pull-up active*/
elessair 0:f269e3021894 138 __IO uint32_t POWER :3; /**< Output Drive Strength*/
elessair 0:f269e3021894 139 __IO uint32_t TYPE :1; /**< Output Type: 0 – Push/Pull, 1 – Open Drain*/
elessair 0:f269e3021894 140 } BITS;
elessair 0:f269e3021894 141 __IO uint32_t WORD;
elessair 0:f269e3021894 142 } PADIO5;
elessair 0:f269e3021894 143 union {
elessair 0:f269e3021894 144 struct {
elessair 0:f269e3021894 145 __IO uint32_t PULL :2; /**< 00 – Pull-down active, 01 – No pull active, 10 – No pull active, 11 – Pull-up active*/
elessair 0:f269e3021894 146 __IO uint32_t POWER :3; /**< Output Drive Strength*/
elessair 0:f269e3021894 147 __IO uint32_t TYPE :1; /**< Output Type: 0 – Push/Pull, 1 – Open Drain*/
elessair 0:f269e3021894 148 } BITS;
elessair 0:f269e3021894 149 __IO uint32_t WORD;
elessair 0:f269e3021894 150 } PADIO6;
elessair 0:f269e3021894 151 union {
elessair 0:f269e3021894 152 struct {
elessair 0:f269e3021894 153 __IO uint32_t PULL :2; /**< 00 – Pull-down active, 01 – No pull active, 10 – No pull active, 11 – Pull-up active*/
elessair 0:f269e3021894 154 __IO uint32_t POWER :3; /**< Output Drive Strength*/
elessair 0:f269e3021894 155 __IO uint32_t TYPE :1; /**< Output Type: 0 – Push/Pull, 1 – Open Drain*/
elessair 0:f269e3021894 156 } BITS;
elessair 0:f269e3021894 157 __IO uint32_t WORD;
elessair 0:f269e3021894 158 } PADIO7;
elessair 0:f269e3021894 159 union {
elessair 0:f269e3021894 160 struct {
elessair 0:f269e3021894 161 __IO uint32_t PULL :2; /**< 00 – Pull-down active, 01 – No pull active, 10 – No pull active, 11 – Pull-up active*/
elessair 0:f269e3021894 162 __IO uint32_t POWER :3; /**< Output Drive Strength*/
elessair 0:f269e3021894 163 __IO uint32_t TYPE :1; /**< Output Type: 0 – Push/Pull, 1 – Open Drain*/
elessair 0:f269e3021894 164 } BITS;
elessair 0:f269e3021894 165 __IO uint32_t WORD;
elessair 0:f269e3021894 166 } PADIO8;
elessair 0:f269e3021894 167 union {
elessair 0:f269e3021894 168 struct {
elessair 0:f269e3021894 169 __IO uint32_t PULL :2; /**< 00 – Pull-down active, 01 – No pull active, 10 – No pull active, 11 – Pull-up active*/
elessair 0:f269e3021894 170 __IO uint32_t POWER :3; /**< Output Drive Strength*/
elessair 0:f269e3021894 171 __IO uint32_t TYPE :1; /**< Output Type: 0 – Push/Pull, 1 – Open Drain*/
elessair 0:f269e3021894 172 } BITS;
elessair 0:f269e3021894 173 __IO uint32_t WORD;
elessair 0:f269e3021894 174 } PADIO9;
elessair 0:f269e3021894 175 union {
elessair 0:f269e3021894 176 struct {
elessair 0:f269e3021894 177 __IO uint32_t PULL :2; /**< 00 – Pull-down active, 01 – No pull active, 10 – No pull active, 11 – Pull-up active*/
elessair 0:f269e3021894 178 __IO uint32_t POWER :3; /**< Output Drive Strength*/
elessair 0:f269e3021894 179 __IO uint32_t TYPE :1; /**< Output Type: 0 – Push/Pull, 1 – Open Drain*/
elessair 0:f269e3021894 180 } BITS;
elessair 0:f269e3021894 181 __IO uint32_t WORD;
elessair 0:f269e3021894 182 } PADIO10;
elessair 0:f269e3021894 183 union {
elessair 0:f269e3021894 184 struct {
elessair 0:f269e3021894 185 __IO uint32_t PULL :2; /**< 00 – Pull-down active, 01 – No pull active, 10 – No pull active, 11 – Pull-up active*/
elessair 0:f269e3021894 186 __IO uint32_t POWER :3; /**< Output Drive Strength*/
elessair 0:f269e3021894 187 __IO uint32_t TYPE :1; /**< Output Type: 0 – Push/Pull, 1 – Open Drain*/
elessair 0:f269e3021894 188 } BITS;
elessair 0:f269e3021894 189 __IO uint32_t WORD;
elessair 0:f269e3021894 190 } PADIO11;
elessair 0:f269e3021894 191 union {
elessair 0:f269e3021894 192 struct {
elessair 0:f269e3021894 193 __IO uint32_t PULL :2; /**< 00 – Pull-down active, 01 – No pull active, 10 – No pull active, 11 – Pull-up active*/
elessair 0:f269e3021894 194 __IO uint32_t POWER :3; /**< Output Drive Strength*/
elessair 0:f269e3021894 195 __IO uint32_t TYPE :1; /**< Output Type: 0 – Push/Pull, 1 – Open Drain*/
elessair 0:f269e3021894 196 } BITS;
elessair 0:f269e3021894 197 __IO uint32_t WORD;
elessair 0:f269e3021894 198 } PADIO12;
elessair 0:f269e3021894 199 union {
elessair 0:f269e3021894 200 struct {
elessair 0:f269e3021894 201 __IO uint32_t PULL :2; /**< 00 – Pull-down active, 01 – No pull active, 10 – No pull active, 11 – Pull-up active*/
elessair 0:f269e3021894 202 __IO uint32_t POWER :3; /**< Output Drive Strength*/
elessair 0:f269e3021894 203 __IO uint32_t TYPE :1; /**< Output Type: 0 – Push/Pull, 1 – Open Drain*/
elessair 0:f269e3021894 204 } BITS;
elessair 0:f269e3021894 205 __IO uint32_t WORD;
elessair 0:f269e3021894 206 } PADIO13;
elessair 0:f269e3021894 207 union {
elessair 0:f269e3021894 208 struct {
elessair 0:f269e3021894 209 __IO uint32_t PULL :2; /**< 00 – Pull-down active, 01 – No pull active, 10 – No pull active, 11 – Pull-up active*/
elessair 0:f269e3021894 210 __IO uint32_t POWER :3; /**< Output Drive Strength*/
elessair 0:f269e3021894 211 __IO uint32_t TYPE :1; /**< Output Type: 0 – Push/Pull, 1 – Open Drain*/
elessair 0:f269e3021894 212 } BITS;
elessair 0:f269e3021894 213 __IO uint32_t WORD;
elessair 0:f269e3021894 214 } PADIO14;
elessair 0:f269e3021894 215 union {
elessair 0:f269e3021894 216 struct {
elessair 0:f269e3021894 217 __IO uint32_t PULL :2; /**< 00 – Pull-down active, 01 – No pull active, 10 – No pull active, 11 – Pull-up active*/
elessair 0:f269e3021894 218 __IO uint32_t POWER :3; /**< Output Drive Strength*/
elessair 0:f269e3021894 219 __IO uint32_t TYPE :1; /**< Output Type: 0 – Push/Pull, 1 – Open Drain*/
elessair 0:f269e3021894 220 } BITS;
elessair 0:f269e3021894 221 __IO uint32_t WORD;
elessair 0:f269e3021894 222 } PADIO15;
elessair 0:f269e3021894 223 union {
elessair 0:f269e3021894 224 struct {
elessair 0:f269e3021894 225 __IO uint32_t PULL :2; /**< 00 – Pull-down active, 01 – No pull active, 10 – No pull active, 11 – Pull-up active*/
elessair 0:f269e3021894 226 __IO uint32_t POWER :3; /**< Output Drive Strength*/
elessair 0:f269e3021894 227 __IO uint32_t TYPE :1; /**< Output Type: 0 – Push/Pull, 1 – Open Drain*/
elessair 0:f269e3021894 228 } BITS;
elessair 0:f269e3021894 229 __IO uint32_t WORD;
elessair 0:f269e3021894 230 } PADIO16;
elessair 0:f269e3021894 231 union {
elessair 0:f269e3021894 232 struct {
elessair 0:f269e3021894 233 __IO uint32_t PULL :2; /**< 00 – Pull-down active, 01 – No pull active, 10 – No pull active, 11 – Pull-up active*/
elessair 0:f269e3021894 234 __IO uint32_t POWER :3; /**< Output Drive Strength*/
elessair 0:f269e3021894 235 __IO uint32_t TYPE :1; /**< Output Type: 0 – Push/Pull, 1 – Open Drain*/
elessair 0:f269e3021894 236 } BITS;
elessair 0:f269e3021894 237 __IO uint32_t WORD;
elessair 0:f269e3021894 238 } PADIO17;
elessair 0:f269e3021894 239 } PadReg_t, *PadReg_pt;
elessair 0:f269e3021894 240
elessair 0:f269e3021894 241 #endif /* PAD_MAP_H_ */