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 dap_strings.h
Pawel Zarembski 0:01f31e923fe2 3 *
Pawel Zarembski 0:01f31e923fe2 4 * DAPLink Interface Firmware
Pawel Zarembski 0:01f31e923fe2 5 * Copyright (c) 2019, ARM Limited, All Rights Reserved
Pawel Zarembski 0:01f31e923fe2 6 * SPDX-License-Identifier: Apache-2.0
Pawel Zarembski 0:01f31e923fe2 7 *
Pawel Zarembski 0:01f31e923fe2 8 * Licensed under the Apache License, Version 2.0 (the "License"); you may
Pawel Zarembski 0:01f31e923fe2 9 * not use this file except in compliance with the License.
Pawel Zarembski 0:01f31e923fe2 10 * You may obtain a copy of the License at
Pawel Zarembski 0:01f31e923fe2 11 *
Pawel Zarembski 0:01f31e923fe2 12 * http://www.apache.org/licenses/LICENSE-2.0
Pawel Zarembski 0:01f31e923fe2 13 *
Pawel Zarembski 0:01f31e923fe2 14 * Unless required by applicable law or agreed to in writing, software
Pawel Zarembski 0:01f31e923fe2 15 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
Pawel Zarembski 0:01f31e923fe2 16 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Pawel Zarembski 0:01f31e923fe2 17 * See the License for the specific language governing permissions and
Pawel Zarembski 0:01f31e923fe2 18 * limitations under the License.
Pawel Zarembski 0:01f31e923fe2 19 */
Pawel Zarembski 0:01f31e923fe2 20
Pawel Zarembski 0:01f31e923fe2 21 #include "cmsis_compiler.h"
Pawel Zarembski 0:01f31e923fe2 22 #include "info.h"
Pawel Zarembski 0:01f31e923fe2 23
Pawel Zarembski 0:01f31e923fe2 24 /** Get Vendor ID string.
Pawel Zarembski 0:01f31e923fe2 25 \param str Pointer to buffer to store the string.
Pawel Zarembski 0:01f31e923fe2 26 \return String length.
Pawel Zarembski 0:01f31e923fe2 27 */
Pawel Zarembski 0:01f31e923fe2 28 __STATIC_INLINE uint8_t DAP_GetVendorString (char *str) {
Pawel Zarembski 0:01f31e923fe2 29 (void)str;
Pawel Zarembski 0:01f31e923fe2 30 return (0U);
Pawel Zarembski 0:01f31e923fe2 31 }
Pawel Zarembski 0:01f31e923fe2 32
Pawel Zarembski 0:01f31e923fe2 33 /** Get Product ID string.
Pawel Zarembski 0:01f31e923fe2 34 \param str Pointer to buffer to store the string.
Pawel Zarembski 0:01f31e923fe2 35 \return String length.
Pawel Zarembski 0:01f31e923fe2 36 */
Pawel Zarembski 0:01f31e923fe2 37 __STATIC_INLINE uint8_t DAP_GetProductString (char *str) {
Pawel Zarembski 0:01f31e923fe2 38 (void)str;
Pawel Zarembski 0:01f31e923fe2 39 return (0U);
Pawel Zarembski 0:01f31e923fe2 40 }
Pawel Zarembski 0:01f31e923fe2 41
Pawel Zarembski 0:01f31e923fe2 42 /** Get Serial Number string.
Pawel Zarembski 0:01f31e923fe2 43 \param str Pointer to buffer to store the string.
Pawel Zarembski 0:01f31e923fe2 44 \return String length.
Pawel Zarembski 0:01f31e923fe2 45 */
Pawel Zarembski 0:01f31e923fe2 46 __STATIC_INLINE uint8_t DAP_GetSerNumString (char *str) {
Pawel Zarembski 0:01f31e923fe2 47 const char * data = info_get_unique_id();
Pawel Zarembski 0:01f31e923fe2 48 uint8_t length = (uint8_t)strlen(data) + 1;
Pawel Zarembski 0:01f31e923fe2 49 memcpy(str, data, length);
Pawel Zarembski 0:01f31e923fe2 50 return length;
Pawel Zarembski 0:01f31e923fe2 51 }
Pawel Zarembski 0:01f31e923fe2 52
Pawel Zarembski 0:01f31e923fe2 53 /** Get firmware version string.
Pawel Zarembski 0:01f31e923fe2 54 \param str Pointer to buffer to store the string.
Pawel Zarembski 0:01f31e923fe2 55 \return String length.
Pawel Zarembski 0:01f31e923fe2 56 */
Pawel Zarembski 0:01f31e923fe2 57 __STATIC_INLINE uint8_t DAP_GetFirmwareVersionString (char *str) {
Pawel Zarembski 0:01f31e923fe2 58 const char * data = info_get_version();
Pawel Zarembski 0:01f31e923fe2 59 uint8_t length = (uint8_t)strlen(data) + 1;
Pawel Zarembski 0:01f31e923fe2 60 memcpy(str, data, length);
Pawel Zarembski 0:01f31e923fe2 61 return length;
Pawel Zarembski 0:01f31e923fe2 62 }