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.c
00003  * @brief   Alternative IO for LPC11U35 based Hardware Interface Circuit
00004  *
00005  * DAPLink Interface Firmware
00006  * Copyright (c) 2009-2016, 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 // Peripheral register bit masks (used for pin inits)
00032 #define FUNC_0                          0
00033 #define FUNC_1                          1
00034 #define PULL_DOWN_ENABLED               (1 << 3)
00035 #define PULL_UP_ENABLED                 (2 << 3)
00036 #define OPENDRAIN                       (1 << 10)
00037 
00038 // DAP LED                              PIO0_21
00039 #define PIN_DAP_LED_PORT                0
00040 #define PIN_DAP_LED_BIT                 21
00041 #define PIN_DAP_LED                     (1 << PIN_DAP_LED_BIT)
00042 #define PIN_DAP_LED_IOCON               LPC_IOCON->PIO0_21
00043 #define PIN_DAP_LED_IOCON_INIT          (FUNC_0 | PULL_UP_ENABLED)
00044 
00045 // MSD LED                              PIO0_20
00046 #define PIN_MSD_LED_PORT                0
00047 #define PIN_MSD_LED_BIT                 20
00048 #define PIN_MSD_LED                     (1 << PIN_MSD_LED_BIT)
00049 #define PIN_MSD_LED_IOCON               LPC_IOCON->PIO0_20
00050 #define PIN_MSD_LED_IOCON_INIT          (FUNC_0 | PULL_UP_ENABLED)
00051 
00052 // CDC LED                              PIO0_11
00053 #define PIN_CDC_LED_PORT                0
00054 #define PIN_CDC_LED_BIT                 11
00055 #define PIN_CDC_LED                     (1 << PIN_CDC_LED_BIT)
00056 #define PIN_CDC_LED_IOCON               LPC_IOCON->TDI_PIO0_11
00057 #define PIN_CDC_LED_IOCON_INIT          (FUNC_1 | PULL_UP_ENABLED)
00058 
00059 // Non-Forwarded Reset in PIN           PIO1_19 (Nitrogen override)
00060 #define PIN_RESET_IN_PORT               1
00061 #define PIN_RESET_IN_BIT                19
00062 #define PIN_RESET_IN                    (1 << PIN_RESET_IN_BIT)
00063 #define PIN_RESET_IN_IOCON              LPC_IOCON->PIO1_19
00064 #define PIN_RESET_IN_IOCON_INIT         (FUNC_0 | OPENDRAIN | PULL_UP_ENABLED)
00065 
00066 // Forwarded Reset in PIN               PIO0_1
00067 #define PIN_RESET_IN_FWRD_PORT          0
00068 #define PIN_RESET_IN_FWRD_BIT           1
00069 #define PIN_RESET_IN_FWRD               (1 << PIN_RESET_IN_FWRD_BIT)
00070 #define PIN_RESET_IN_FWRD_IOCON         LPC_IOCON->PIO0_1
00071 #define PIN_RESET_IN_FWRD_IOCON_INIT    (FUNC_0 | OPENDRAIN | PULL_UP_ENABLED)
00072 
00073 // nRESET OUT Pin                       PIO0_2
00074 #define PIN_nRESET_PORT                 0
00075 #define PIN_nRESET_BIT                  2
00076 #define PIN_nRESET                      (1 << PIN_nRESET_BIT)
00077 #define PIN_nRESET_IOCON                LPC_IOCON->PIO0_2
00078 #define PIN_nRESET_IOCON_INIT           (FUNC_0 | OPENDRAIN | PULL_UP_ENABLED)
00079 
00080 // SWCLK/TCK Pin                        PIO0_9 (Nitrogen override)
00081 #define PIN_SWCLK_PORT                  0
00082 #define PIN_SWCLK_BIT                   9
00083 #define PIN_SWCLK                       (1 << PIN_SWCLK_BIT)
00084 #define PIN_SWCLK_TCK_IOCON             LPC_IOCON->PIO0_9
00085 #define PIN_SWCLK_TCK_IOCON_INIT        (FUNC_0 | PULL_UP_ENABLED)
00086 
00087 // SWDIO/TMS In/Out Pin                 PIO0_8
00088 #define PIN_SWDIO_PORT                  0
00089 #define PIN_SWDIO_BIT                   8
00090 #define PIN_SWDIO                       (1 << PIN_SWDIO_BIT)
00091 #define PIN_SWDIO_TMS_IOCON             LPC_IOCON->PIO0_8
00092 #define PIN_SWDIO_TMS_IOCON_INIT        (FUNC_0 | PULL_UP_ENABLED)
00093 
00094 // TDI Pin                              PIO0_17
00095 #define PIN_TDI_PORT                    17
00096 #define PIN_TDI_BIT                     17
00097 #define PIN_TDI                         (1 << PIN_TDI_BIT)
00098 #define PIN_TDI_IOCON                   LPC_IOCON->PIO0_17
00099 #define PIN_TDI_IOCON_INIT              (FUNC_0 | PULL_UP_ENABLED)
00100 
00101 // SWO/TDO Pin                          PIO0_9
00102 #define PIN_TDO_PORT                    9
00103 #define PIN_TDO_BIT                     9
00104 #define PIN_TDO                         (1 << PIN_TDO_BIT)
00105 #define PIN_TDO_IOCON                   LPC_IOCON->PIO0_9
00106 #define PIN_TDO_IOCON_INIT              (FUNC_0 | PULL_UP_ENABLED)
00107 
00108 #endif