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 #ifndef __IO_CONFIG_H__
00023 #define __IO_CONFIG_H__
00024 
00025 #include "stm32f1xx.h"
00026 #include "compiler.h"
00027 #include "daplink.h"
00028 
00029 COMPILER_ASSERT(DAPLINK_HIC_ID == DAPLINK_HIC_ID_STM32F103XB);
00030 
00031 //USB control pin
00032 #define USB_CONNECT_PORT_ENABLE()    __HAL_RCC_GPIOA_CLK_ENABLE()
00033 #define USB_CONNECT_PORT_DISABLE()   __HAL_RCC_GPIOA_CLK_DISABLE()
00034 #define USB_CONNECT_PORT             GPIOA
00035 #define USB_CONNECT_PIN              GPIO_PIN_15
00036 #define USB_CONNECT_ON()             (USB_CONNECT_PORT->BSRR = USB_CONNECT_PIN)
00037 #define USB_CONNECT_OFF()            (USB_CONNECT_PORT->BRR  = USB_CONNECT_PIN)
00038 
00039 //Connected LED
00040 #define CONNECTED_LED_PORT           GPIOB
00041 #define CONNECTED_LED_PIN            GPIO_PIN_6
00042 #define CONNECTED_LED_PIN_Bit        6
00043 
00044 //When bootloader, disable the target port(not used)
00045 #define POWER_EN_PIN_PORT            GPIOB
00046 #define POWER_EN_PIN                 GPIO_PIN_15
00047 #define POWER_EN_Bit                 15
00048 
00049 // nRESET OUT Pin
00050 #define nRESET_PIN_PORT              GPIOB
00051 #define nRESET_PIN                   GPIO_PIN_0
00052 #define nRESET_PIN_Bit               0
00053 
00054 //SWD
00055 #define SWCLK_TCK_PIN_PORT           GPIOB
00056 #define SWCLK_TCK_PIN                GPIO_PIN_13
00057 #define SWCLK_TCK_PIN_Bit            13
00058 
00059 #define SWDIO_OUT_PIN_PORT           GPIOB
00060 #define SWDIO_OUT_PIN                GPIO_PIN_14
00061 #define SWDIO_OUT_PIN_Bit            14
00062 
00063 #define SWDIO_IN_PIN_PORT            GPIOB
00064 #define SWDIO_IN_PIN                 GPIO_PIN_12
00065 #define SWDIO_IN_PIN_Bit             12
00066 
00067 //LEDs
00068 //USB status LED
00069 #define RUNNING_LED_PORT             GPIOA
00070 #define RUNNING_LED_PIN              GPIO_PIN_9
00071 #define RUNNING_LED_Bit              9
00072 
00073 #define PIN_HID_LED_PORT             GPIOA
00074 #define PIN_HID_LED                  GPIO_PIN_9
00075 #define PIN_HID_LED_Bit              9
00076 
00077 #define PIN_CDC_LED_PORT             GPIOA
00078 #define PIN_CDC_LED                  GPIO_PIN_9
00079 #define PIN_CDC_LED_Bit              9
00080 
00081 #define PIN_MSC_LED_PORT             GPIOA
00082 #define PIN_MSC_LED                  GPIO_PIN_9
00083 #define PIN_MSC_LED_Bit              9
00084 
00085 
00086 #endif