Arrow / Mbed OS DAPLink Reset
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers IO_Config_Override.h Source File

IO_Config_Override.h

00001 /**
00002  * @file    IO_Config_Override.h
00003  * @brief   Alternative IO for LPC11U35 based Hardware Interface Circuit
00004  *
00005  * DAPLink Interface Firmware
00006  * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved
00007  * SPDX-License-Identifier: Apache-2.0
00008  *
00009  * Licensed under the Apache License, Version 2.0 (the "License"); you may
00010  * not use this file except in compliance with the License.
00011  * You may obtain a copy of the License at
00012  *
00013  * http://www.apache.org/licenses/LICENSE-2.0
00014  *
00015  * Unless required by applicable law or agreed to in writing, software
00016  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
00017  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00018  * See the License for the specific language governing permissions and
00019  * limitations under the License.
00020  */
00021 
00022 #ifndef __IO_CONFIG_H__
00023 #define __IO_CONFIG_H__
00024 
00025 #include "LPC11Uxx.h"
00026 #include "daplink.h"
00027 
00028 // This GPIO configuration is only valid for the LPC11U35 HIC
00029 COMPILER_ASSERT(DAPLINK_HIC_ID == DAPLINK_HIC_ID_LPC11U35);
00030 
00031 // Enable Musca A specific code
00032 #define MUSCA_A_BOARD                   1
00033 
00034 // Musca A board has PBON button
00035 #define PBON_BUTTON                     1
00036 
00037 // Peripheral register bit masks (used for pin inits)
00038 #define FUNC_0                          0           // Primary function
00039 #define FUNC_1                          1           // Secondary function
00040 #define PULL_DOWN_ENABLED               (1 << 3)
00041 #define PULL_UP_ENABLED                 (2 << 3)
00042 #define OPENDRAIN                       (1 << 10)
00043 #define DIGITAL_IN                      (1 << 7)
00044 
00045 // DAP LED                              PIO0_21
00046 #define PIN_DAP_LED_PORT                0
00047 #define PIN_DAP_LED_BIT                 21
00048 #define PIN_DAP_LED                     (1 << PIN_DAP_LED_BIT)
00049 #define PIN_DAP_LED_IOCON               LPC_IOCON->PIO0_21
00050 #define PIN_DAP_LED_IOCON_INIT          (FUNC_0 | PULL_UP_ENABLED)
00051 
00052 // MSD LED                              PIO0_20
00053 #define PIN_MSD_LED_PORT                0
00054 #define PIN_MSD_LED_BIT                 20
00055 #define PIN_MSD_LED                     (1 << PIN_MSD_LED_BIT)
00056 #define PIN_MSD_LED_IOCON               LPC_IOCON->PIO0_20
00057 #define PIN_MSD_LED_IOCON_INIT          (FUNC_0 | PULL_UP_ENABLED)
00058 
00059 // CDC LED                              PIO0_11
00060 #define PIN_CDC_LED_PORT                0
00061 #define PIN_CDC_LED_BIT                 11
00062 #define PIN_CDC_LED                     (1 << PIN_CDC_LED_BIT)
00063 #define PIN_CDC_LED_IOCON               LPC_IOCON->TDI_PIO0_11
00064 #define PIN_CDC_LED_IOCON_INIT          (FUNC_1 | PULL_UP_ENABLED)
00065 
00066 // CM_nISP / Non-Forwarded Reset in PIN PIO0_1
00067 #define PIN_RESET_IN_PORT               0
00068 #define PIN_RESET_IN_BIT                1
00069 #define PIN_RESET_IN                    (1 << PIN_RESET_IN_BIT)
00070 #define PIN_RESET_IN_IOCON              LPC_IOCON->PIO0_1
00071 #define PIN_RESET_IN_IOCON_INIT         (FUNC_0 | OPENDRAIN | PULL_UP_ENABLED)
00072 
00073 // Forwarded Reset in PIN               PIO1_19
00074 #define PIN_RESET_IN_FWRD_PORT          0 //1
00075 #define PIN_RESET_IN_FWRD_BIT           1 //19
00076 #define PIN_RESET_IN_FWRD               (1 << PIN_RESET_IN_FWRD_BIT)
00077 #define PIN_RESET_IN_FWRD_IOCON         LPC_IOCON->PIO0_1 //1_19
00078 #define PIN_RESET_IN_FWRD_IOCON_INIT    (FUNC_0 | OPENDRAIN | PULL_UP_ENABLED)
00079 
00080 // CS_nSRST / nRESET OUT Pin            PIO0_2
00081 #define PIN_nRESET_PORT                 0
00082 #define PIN_nRESET_BIT                  2
00083 #define PIN_nRESET                      (1 << PIN_nRESET_BIT)
00084 #define PIN_nRESET_IOCON                LPC_IOCON->PIO0_2
00085 #define PIN_nRESET_IOCON_INIT           (FUNC_0 | OPENDRAIN | PULL_UP_ENABLED)
00086 
00087 // SWCLK                                PIO0_7
00088 #define PIN_SWCLK_PORT                  0
00089 #define PIN_SWCLK_BIT                   7
00090 #define PIN_SWCLK                       (1 << PIN_SWCLK_BIT)
00091 #define PIN_SWCLK_TCK_IOCON             LPC_IOCON->PIO0_7
00092 #define PIN_SWCLK_TCK_IOCON_INIT        (FUNC_0 | PULL_UP_ENABLED)
00093 
00094 // SWDIO In/Out Pin                     PIO0_8
00095 #define PIN_SWDIO_PORT                  0
00096 #define PIN_SWDIO_BIT                   8
00097 #define PIN_SWDIO                       (1 << PIN_SWDIO_BIT)
00098 #define PIN_SWDIO_TMS_IOCON             LPC_IOCON->PIO0_8
00099 #define PIN_SWDIO_TMS_IOCON_INIT        (FUNC_0 | PULL_UP_ENABLED)
00100 
00101 // Reset and Power control pins
00102 // PBON                                 PIO0_16
00103 #define PIN_PBON_PORT                   0
00104 #define PIN_PBON_BIT                    16
00105 #define PIN_PBON                        (1 << PIN_PBON_BIT)
00106 #define PIN_PBON_IOCON                  LPC_IOCON->PIO0_16
00107 #define PIN_PBON_IOCON_INIT             (FUNC_0 | DIGITAL_IN)
00108 
00109 // PSUON Pin                            PIO0_17
00110 #define PIN_PSUON_PORT                  0
00111 #define PIN_PSUON_BIT                   17
00112 #define PIN_PSUON                       (1 << PIN_PSUON_BIT)
00113 #define PIN_PSUON_IOCON                 LPC_IOCON->PIO0_17
00114 #define PIN_PSUON_IOCON_INIT            (FUNC_0 | PULL_UP_ENABLED)
00115 
00116 // SHUTDOWN                             PIO0_15
00117 #define PIN_SHUTDOWN_PORT               0
00118 #define PIN_SHUTDOWN_BIT                15
00119 #define PIN_SHUTDOWN                    (1 << PIN_SHUTDOWN_BIT)
00120 #define PIN_SHUTDOWN_IOCON              LPC_IOCON->SWDIO_PIO0_15
00121 #define PIN_SHUTDOWN_IOCON_INIT         (FUNC_1 | DIGITAL_IN | PULL_UP_ENABLED)
00122 
00123 // CB_nRST OUT Pin                      PIO0_4
00124 #define PIN_CB_nRST_PORT                0
00125 #define PIN_CB_nRST_BIT                 4
00126 #define PIN_CB_nRST                     (1 << PIN_CB_nRST_BIT)
00127 #define PIN_CB_nRST_IOCON               LPC_IOCON->PIO0_4
00128 #define PIN_CB_nRST_IOCON_INIT          (FUNC_0 | PULL_UP_ENABLED)
00129 
00130 // CFG_nRST OUT Pin                     PIO0_5
00131 #define PIN_CFG_nRST_PORT               0
00132 #define PIN_CFG_nRST_BIT                5
00133 #define PIN_CFG_nRST                    (1 << PIN_CFG_nRST_BIT)
00134 #define PIN_CFG_nRST_IOCON              LPC_IOCON->PIO0_5
00135 #define PIN_CFG_nRST_IOCON_INIT         (FUNC_0 | PULL_UP_ENABLED)
00136 
00137 // CS_nDET detect for external debug to SoC
00138 #define PIN_CS_nDET_PORT                1
00139 #define PIN_CS_nDET_BIT                 15
00140 #define PIN_CS_nDET                     (1 << PIN_CS_nDET_BIT)
00141 #define PIN_CS_nDET_IOCON               LPC_IOCON->PIO1_15
00142 #define PIN_CS_nDET_IOCON_INIT          (FUNC_0 | DIGITAL_IN | PULL_UP_ENABLED)
00143 
00144 // SCC Configuration Pins
00145 // SCC_LOAD                             PIO0_9
00146 #define PIN_SCC_LOAD_PORT               0
00147 #define PIN_SCC_LOAD_BIT                9
00148 #define PIN_SCC_LOAD                    (1 << PIN_SCC_LOAD_BIT)
00149 #define PIN_SCC_LOAD_IOCON              LPC_IOCON->PIO0_9
00150 #define PIN_SCC_LOAD_IOCON_INIT         (FUNC_0 | PULL_UP_ENABLED)
00151 
00152 // SCC_WNR                              PIO0_10
00153 #define PIN_SCC_WNR_PORT                0
00154 #define PIN_SCC_WNR_BIT                 10
00155 #define PIN_SCC_WNR                     (1 << PIN_SCC_WNR_BIT)
00156 #define PIN_SCC_WNR_IOCON               LPC_IOCON->SWCLK_PIO0_10
00157 #define PIN_SCC_WNR_IOCON_INIT          (FUNC_1 | PULL_UP_ENABLED)
00158 
00159 // SCC_DATAIN                           PIO0_12
00160 #define PIN_SCC_DATAIN_PORT             0
00161 #define PIN_SCC_DATAIN_BIT              12
00162 #define PIN_SCC_DATAIN                  (1 << PIN_SCC_DATAIN_BIT)
00163 #define PIN_SCC_DATAIN_IOCON            LPC_IOCON->TMS_PIO0_12
00164 #define PIN_SCC_DATAIN_IOCON_INIT       (FUNC_1 | PULL_UP_ENABLED)
00165 
00166 // SCC_CLK                              PIO0_13
00167 #define PIN_SCC_CLK_PORT                0
00168 #define PIN_SCC_CLK_BIT                 13
00169 #define PIN_SCC_CLK                     (1 << PIN_SCC_CLK_BIT)
00170 #define PIN_SCC_CLK_IOCON               LPC_IOCON->TDO_PIO0_13
00171 #define PIN_SCC_CLK_IOCON_INIT          (FUNC_1 | PULL_UP_ENABLED)
00172 
00173 // SCC_DATAOUT                          PIO0_14
00174 #define PIN_SCC_DATAOUT_PORT            0
00175 #define PIN_SCC_DATAOUT_BIT             14
00176 #define PIN_SCC_DATAOUT                 (1 << PIN_SCC_DATAOUT_BIT)
00177 #define PIN_SCC_DATAOUT_IOCON           LPC_IOCON->TRST_PIO0_14
00178 #define PIN_SCC_DATAOUT_IOCON_INIT      (FUNC_1 | DIGITAL_IN | PULL_UP_ENABLED)
00179 
00180 // I2C_SCL                              PIO0_22
00181 #define PIN_I2C_SCL_PORT                0
00182 #define PIN_I2C_SCL_BIT                 22
00183 #define PIN_I2C_SCL                     (1 << PIN_I2C_SCL_BIT)
00184 #define PIN_I2C_SCL_IOCON               LPC_IOCON->PIO0_22
00185 #define PIN_I2C_SCL_IOCON_INIT          (FUNC_0 PULL_UP_ENABLED)
00186 
00187 // I2C_SDA                              PIO0_23
00188 #define PIN_I2C_SDA_PORT                0
00189 #define PIN_I2C_SDA_BIT                 23
00190 #define PIN_I2C_SDA                     (1 << PIN_I2C_SDA_BIT)
00191 #define PIN_I2C_SDA_IOCON               LPC_IOCON->PIO0_23
00192 #define PIN_I2C_SDA_IOCON_INIT          (FUNC_0 PULL_UP_ENABLED)
00193 
00194 // USART                                PIO0_18
00195 #define PIN_USART_PORT                  0
00196 #define PIN_USART_BIT                   18
00197 #define PIN_USART                       (1 << PIN_USART_BIT)
00198 #define PIN_USART_IOCON                 LPC_IOCON->PIO0_18
00199 #define PIN_USART_IOCON_INIT            (FUNC_1 | PULL_DOWN_ENABLED)
00200 
00201 #endif