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

« Back to documentation index

Show/hide line numbers IO_Config.h Source File

IO_Config.h

00001 /**
00002  * @file    IO_Config.h
00003  * @brief   
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 
00023 // Override all defines if IO_CONFIG_OVERRIDE is defined
00024 #ifdef IO_CONFIG_OVERRIDE
00025 #include "IO_Config_Override.h"
00026 #ifndef __IO_CONFIG_H__
00027 #define __IO_CONFIG_H__
00028 #endif
00029 #endif
00030 
00031 
00032 #ifndef __IO_CONFIG_H__
00033 #define __IO_CONFIG_H__
00034 
00035 #include "LPC11Uxx.h"
00036 #include "daplink.h"
00037 
00038 // This GPIO configuration is only valid for the LPC11U35 HIC
00039 COMPILER_ASSERT(DAPLINK_HIC_ID == DAPLINK_HIC_ID_LPC11U35);
00040 
00041 // Peripheral register bit masks (used for pin inits)
00042 #define FUNC_0                          0
00043 #define FUNC_1                          1
00044 #define PULL_DOWN_ENABLED               (1 << 3)
00045 #define PULL_UP_ENABLED                 (2 << 3)
00046 #define OPENDRAIN                       (1 << 10)
00047 
00048 // DAP LED                              PIO0_21
00049 #define PIN_DAP_LED_PORT                0
00050 #define PIN_DAP_LED_BIT                 21
00051 #define PIN_DAP_LED                     (1 << PIN_DAP_LED_BIT)
00052 #define PIN_DAP_LED_IOCON               LPC_IOCON->PIO0_21
00053 #define PIN_DAP_LED_IOCON_INIT          (FUNC_0 | PULL_UP_ENABLED)
00054 
00055 // MSD LED                              PIO0_20
00056 #define PIN_MSD_LED_PORT                0
00057 #define PIN_MSD_LED_BIT                 20
00058 #define PIN_MSD_LED                     (1 << PIN_MSD_LED_BIT)
00059 #define PIN_MSD_LED_IOCON               LPC_IOCON->PIO0_20
00060 #define PIN_MSD_LED_IOCON_INIT          (FUNC_0 | PULL_UP_ENABLED)
00061 
00062 // CDC LED                              PIO0_11
00063 #define PIN_CDC_LED_PORT                0
00064 #define PIN_CDC_LED_BIT                 11
00065 #define PIN_CDC_LED                     (1 << PIN_CDC_LED_BIT)
00066 #define PIN_CDC_LED_IOCON               LPC_IOCON->TDI_PIO0_11
00067 #define PIN_CDC_LED_IOCON_INIT          (FUNC_1 | PULL_UP_ENABLED)
00068 
00069 // Non-Forwarded Reset in PIN           PIO0_1
00070 #define PIN_RESET_IN_PORT               0
00071 #define PIN_RESET_IN_BIT                1
00072 #define PIN_RESET_IN                    (1 << PIN_RESET_IN_BIT)
00073 #define PIN_RESET_IN_IOCON              LPC_IOCON->PIO0_1
00074 #define PIN_RESET_IN_IOCON_INIT         (FUNC_0 | OPENDRAIN | PULL_UP_ENABLED)
00075 
00076 // Forwarded Reset in PIN               PIO1_19
00077 #define PIN_RESET_IN_FWRD_PORT          1
00078 #define PIN_RESET_IN_FWRD_BIT           19
00079 #define PIN_RESET_IN_FWRD               (1 << PIN_RESET_IN_FWRD_BIT)
00080 #define PIN_RESET_IN_FWRD_IOCON         LPC_IOCON->PIO1_19
00081 #define PIN_RESET_IN_FWRD_IOCON_INIT    (FUNC_0 | OPENDRAIN | PULL_UP_ENABLED)
00082 
00083 // nRESET OUT Pin                       PIO0_2
00084 #define PIN_nRESET_PORT                 0
00085 #define PIN_nRESET_BIT                  2
00086 #define PIN_nRESET                      (1 << PIN_nRESET_BIT)
00087 #define PIN_nRESET_IOCON                LPC_IOCON->PIO0_2
00088 #define PIN_nRESET_IOCON_INIT           (FUNC_0 | OPENDRAIN | PULL_UP_ENABLED)
00089 
00090 // SWCLK/TCK Pin                        PIO0_7
00091 #define PIN_SWCLK_PORT                  0
00092 #define PIN_SWCLK_BIT                   7
00093 #define PIN_SWCLK                       (1 << PIN_SWCLK_BIT)
00094 #define PIN_SWCLK_TCK_IOCON             LPC_IOCON->PIO0_7
00095 #define PIN_SWCLK_TCK_IOCON_INIT        (FUNC_0 | PULL_UP_ENABLED)
00096 
00097 // SWDIO/TMS In/Out Pin                 PIO0_8
00098 #define PIN_SWDIO_PORT                  0
00099 #define PIN_SWDIO_BIT                   8
00100 #define PIN_SWDIO                       (1 << PIN_SWDIO_BIT)
00101 #define PIN_SWDIO_TMS_IOCON             LPC_IOCON->PIO0_8
00102 #define PIN_SWDIO_TMS_IOCON_INIT        (FUNC_0 | PULL_UP_ENABLED)
00103 
00104 // TDI Pin                              PIO0_17
00105 #define PIN_TDI_PORT                    17
00106 #define PIN_TDI_BIT                     17
00107 #define PIN_TDI                         (1 << PIN_TDI_BIT)
00108 #define PIN_TDI_IOCON                   LPC_IOCON->PIO0_17
00109 #define PIN_TDI_IOCON_INIT              (FUNC_0 | PULL_UP_ENABLED)
00110 
00111 // SWO/TDO Pin                          PIO0_9
00112 #define PIN_TDO_PORT                    9
00113 #define PIN_TDO_BIT                     9
00114 #define PIN_TDO                         (1 << PIN_TDO_BIT)
00115 #define PIN_TDO_IOCON                   LPC_IOCON->PIO0_9
00116 #define PIN_TDO_IOCON_INIT              (FUNC_0 | PULL_UP_ENABLED)
00117 
00118 #endif