Repostiory containing DAPLink source code with Reset Pin workaround for HANI_IOT board.

Upstream: https://github.com/ARMmbed/DAPLink

Committer:
Pawel Zarembski
Date:
Tue Apr 07 12:55:42 2020 +0200
Revision:
0:01f31e923fe2
hani: DAPLink with reset workaround

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Pawel Zarembski 0:01f31e923fe2 1 /**
Pawel Zarembski 0:01f31e923fe2 2 * @file info.h
Pawel Zarembski 0:01f31e923fe2 3 * @brief methods to get information about the board
Pawel Zarembski 0:01f31e923fe2 4 *
Pawel Zarembski 0:01f31e923fe2 5 * DAPLink Interface Firmware
Pawel Zarembski 0:01f31e923fe2 6 * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
Pawel Zarembski 0:01f31e923fe2 7 * SPDX-License-Identifier: Apache-2.0
Pawel Zarembski 0:01f31e923fe2 8 *
Pawel Zarembski 0:01f31e923fe2 9 * Licensed under the Apache License, Version 2.0 (the "License"); you may
Pawel Zarembski 0:01f31e923fe2 10 * not use this file except in compliance with the License.
Pawel Zarembski 0:01f31e923fe2 11 * You may obtain a copy of the License at
Pawel Zarembski 0:01f31e923fe2 12 *
Pawel Zarembski 0:01f31e923fe2 13 * http://www.apache.org/licenses/LICENSE-2.0
Pawel Zarembski 0:01f31e923fe2 14 *
Pawel Zarembski 0:01f31e923fe2 15 * Unless required by applicable law or agreed to in writing, software
Pawel Zarembski 0:01f31e923fe2 16 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
Pawel Zarembski 0:01f31e923fe2 17 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Pawel Zarembski 0:01f31e923fe2 18 * See the License for the specific language governing permissions and
Pawel Zarembski 0:01f31e923fe2 19 * limitations under the License.
Pawel Zarembski 0:01f31e923fe2 20 */
Pawel Zarembski 0:01f31e923fe2 21
Pawel Zarembski 0:01f31e923fe2 22 #ifndef INFO_H
Pawel Zarembski 0:01f31e923fe2 23 #define INFO_H
Pawel Zarembski 0:01f31e923fe2 24
Pawel Zarembski 0:01f31e923fe2 25 #include <stdbool.h>
Pawel Zarembski 0:01f31e923fe2 26 #include <stdint.h>
Pawel Zarembski 0:01f31e923fe2 27
Pawel Zarembski 0:01f31e923fe2 28 #ifdef __cplusplus
Pawel Zarembski 0:01f31e923fe2 29 extern "C" {
Pawel Zarembski 0:01f31e923fe2 30 #endif
Pawel Zarembski 0:01f31e923fe2 31
Pawel Zarembski 0:01f31e923fe2 32 void info_init(void);
Pawel Zarembski 0:01f31e923fe2 33 void info_set_uuid_target(uint32_t *uuid_data);
Pawel Zarembski 0:01f31e923fe2 34 void info_crc_compute(void);
Pawel Zarembski 0:01f31e923fe2 35
Pawel Zarembski 0:01f31e923fe2 36
Pawel Zarembski 0:01f31e923fe2 37 // Get the 48 digit unique ID as a null terminated string.
Pawel Zarembski 0:01f31e923fe2 38 // This is the string used as the USB serial number.
Pawel Zarembski 0:01f31e923fe2 39 // This string is made up of the following:
Pawel Zarembski 0:01f31e923fe2 40 // <board ID><family ID><host ID><hic ID>
Pawel Zarembski 0:01f31e923fe2 41 const char *info_get_unique_id(void);
Pawel Zarembski 0:01f31e923fe2 42
Pawel Zarembski 0:01f31e923fe2 43 // Get the 4 digit board ID as a null terminated string
Pawel Zarembski 0:01f31e923fe2 44 const char *info_get_board_id(void);
Pawel Zarembski 0:01f31e923fe2 45
Pawel Zarembski 0:01f31e923fe2 46 // Get the 32 digit ID of the processor running daplink as a null terminated string
Pawel Zarembski 0:01f31e923fe2 47 const char *info_get_host_id(void);
Pawel Zarembski 0:01f31e923fe2 48
Pawel Zarembski 0:01f31e923fe2 49 // Get the 32 digit ID of the target processor as a null terminated string
Pawel Zarembski 0:01f31e923fe2 50 const char *info_get_target_id(void);
Pawel Zarembski 0:01f31e923fe2 51
Pawel Zarembski 0:01f31e923fe2 52 // Get the 8 digit hic ID as a null terminated string
Pawel Zarembski 0:01f31e923fe2 53 const char *info_get_hic_id(void);
Pawel Zarembski 0:01f31e923fe2 54
Pawel Zarembski 0:01f31e923fe2 55 // Get the 4 digit version ID as a null terminated string
Pawel Zarembski 0:01f31e923fe2 56 const char *info_get_version(void);
Pawel Zarembski 0:01f31e923fe2 57
Pawel Zarembski 0:01f31e923fe2 58 // Get the 12 digit mac as a null terminated string
Pawel Zarembski 0:01f31e923fe2 59 const char *info_get_mac(void);
Pawel Zarembski 0:01f31e923fe2 60
Pawel Zarembski 0:01f31e923fe2 61
Pawel Zarembski 0:01f31e923fe2 62 // Get the string descriptor for for the unique_id
Pawel Zarembski 0:01f31e923fe2 63 // This is in the format of a USB string descriptor
Pawel Zarembski 0:01f31e923fe2 64 // offset 0, size 1, bLength
Pawel Zarembski 0:01f31e923fe2 65 // offset 1, size 1, bDescriptorType always 3
Pawel Zarembski 0:01f31e923fe2 66 // offset 2, size n, bString - unicode encoded unique id
Pawel Zarembski 0:01f31e923fe2 67 const char *info_get_unique_id_string_descriptor(void);
Pawel Zarembski 0:01f31e923fe2 68
Pawel Zarembski 0:01f31e923fe2 69
Pawel Zarembski 0:01f31e923fe2 70 // Check if various regions are present
Pawel Zarembski 0:01f31e923fe2 71 bool info_get_bootloader_present(void);
Pawel Zarembski 0:01f31e923fe2 72 bool info_get_interface_present(void);
Pawel Zarembski 0:01f31e923fe2 73 bool info_get_config_admin_present(void);
Pawel Zarembski 0:01f31e923fe2 74 bool info_get_config_user_present(void);
Pawel Zarembski 0:01f31e923fe2 75
Pawel Zarembski 0:01f31e923fe2 76 // Get the CRCs of various regions.
Pawel Zarembski 0:01f31e923fe2 77 // The CRC returned is only valid if
Pawel Zarembski 0:01f31e923fe2 78 // the given region is present.
Pawel Zarembski 0:01f31e923fe2 79 uint32_t info_get_crc_bootloader(void);
Pawel Zarembski 0:01f31e923fe2 80 uint32_t info_get_crc_interface(void);
Pawel Zarembski 0:01f31e923fe2 81 uint32_t info_get_crc_config_admin(void);
Pawel Zarembski 0:01f31e923fe2 82 uint32_t info_get_crc_config_user(void);
Pawel Zarembski 0:01f31e923fe2 83
Pawel Zarembski 0:01f31e923fe2 84 // Get version info as an integer
Pawel Zarembski 0:01f31e923fe2 85 uint32_t info_get_bootloader_version(void);
Pawel Zarembski 0:01f31e923fe2 86 uint32_t info_get_interface_version(void);
Pawel Zarembski 0:01f31e923fe2 87
Pawel Zarembski 0:01f31e923fe2 88 #ifdef __cplusplus
Pawel Zarembski 0:01f31e923fe2 89 }
Pawel Zarembski 0:01f31e923fe2 90 #endif
Pawel Zarembski 0:01f31e923fe2 91
Pawel Zarembski 0:01f31e923fe2 92 #endif