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

« Back to documentation index

Show/hide line numbers daplink.h Source File

daplink.h

Go to the documentation of this file.
00001 /**
00002  * @file    daplink.h
00003  * @brief   Information about different Hardware Interface Circuits the firmware runs
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 DAPLINK_H
00023 #define DAPLINK_H
00024 
00025 #include <stdbool.h>
00026 #include <stdint.h>
00027 
00028 #include "daplink_addr.h"
00029 #include "compiler.h"
00030 
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034 
00035 // Assert that regions are sequential with no gaps
00036 // and that they take up all available space
00037 
00038 // ROM check
00039 COMPILER_ASSERT(DAPLINK_ROM_BL_START == DAPLINK_ROM_START);
00040 COMPILER_ASSERT(DAPLINK_ROM_BL_START + DAPLINK_ROM_BL_SIZE == DAPLINK_ROM_CONFIG_ADMIN_START);
00041 COMPILER_ASSERT(DAPLINK_ROM_CONFIG_ADMIN_START + DAPLINK_ROM_CONFIG_ADMIN_SIZE == DAPLINK_ROM_IF_START);
00042 COMPILER_ASSERT(DAPLINK_ROM_IF_START + DAPLINK_ROM_IF_SIZE == DAPLINK_ROM_CONFIG_USER_START);
00043 COMPILER_ASSERT(DAPLINK_ROM_CONFIG_USER_START + DAPLINK_ROM_CONFIG_USER_SIZE == DAPLINK_ROM_START + DAPLINK_ROM_SIZE);
00044 
00045 // RAM check
00046 COMPILER_ASSERT(DAPLINK_RAM_APP_START == DAPLINK_RAM_START);
00047 COMPILER_ASSERT(DAPLINK_RAM_APP_START + DAPLINK_RAM_APP_SIZE == DAPLINK_RAM_SHARED_START);
00048 COMPILER_ASSERT(DAPLINK_RAM_SHARED_START + DAPLINK_RAM_SHARED_SIZE == DAPLINK_RAM_START + DAPLINK_RAM_SIZE);
00049 
00050 #define DAPLINK_BUILD_KEY_IF        0x9B939E8F
00051 #define DAPLINK_BUILD_KEY_BL        0x9B939D93
00052 
00053 //! @name HIC IDs
00054 //@{
00055 #define DAPLINK_HIC_ID_K20DX        0x97969900
00056 #define DAPLINK_HIC_ID_KL26         0x97969901
00057 #define DAPLINK_HIC_ID_LPC11U35     0x97969902
00058 #define DAPLINK_HIC_ID_SAM3U2C      0x97969903
00059 #define DAPLINK_HIC_ID_MAX32620     0x97969904
00060 #define DAPLINK_HIC_ID_LPC4322      0x97969905
00061 #define DAPLINK_HIC_ID_MAX32625     0x97969906
00062 #define DAPLINK_HIC_ID_MAX32550     0x97969907
00063 #define DAPLINK_HIC_ID_STM32F103XB  0x97969908
00064 #define DAPLINK_HIC_ID_K26F         0x97969909
00065 #define DAPLINK_HIC_ID_K22F         0x9796990A
00066 #define DAPLINK_HIC_ID_KL27Z        0x9796990B // reserving for future use
00067 #define DAPLINK_HIC_ID_LPC54606     0x9796990C // reserving for future use
00068 #define DAPLINK_HIC_ID_STM32F723IE  0x9796990D // reserving for future use
00069 #define DAPLINK_HIC_ID_LPC55S69     0x97969920 // reserving for future use
00070 #define DAPLINK_HIC_ID_M48SSIDAE    0x97969921
00071 #define DAPLINK_HIC_ID_PSOC5        0x2E127069
00072 //@}
00073 
00074 #define DAPLINK_INFO_OFFSET         0x20
00075 
00076 typedef struct {
00077     uint32_t build_key;
00078     uint32_t hic_id;
00079     uint32_t version;
00080 } daplink_info_t;
00081 
00082 bool daplink_is_bootloader(void);
00083 bool daplink_is_interface(void);
00084 
00085 #ifdef __cplusplus
00086 }
00087 #endif
00088 
00089 #endif