1 /*------------------------------------------------------------------------------------------------*/
2 /* UNICENS V2.1.0-3491 */
3 /* Copyright (c) 2017 Microchip Technology Germany II GmbH & Co. KG. */
5 /* This program is free software: you can redistribute it and/or modify */
6 /* it under the terms of the GNU General Public License as published by */
7 /* the Free Software Foundation, either version 2 of the License, or */
8 /* (at your option) any later version. */
10 /* This program is distributed in the hope that it will be useful, */
11 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
12 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
13 /* GNU General Public License for more details. */
15 /* You should have received a copy of the GNU General Public License */
16 /* along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 /* You may also obtain this software under a propriety license from Microchip. */
19 /* Please contact Microchip for further information. */
20 /*------------------------------------------------------------------------------------------------*/
24 * \brief Implementation of the library module which contains miscellaneous helper functions.
26 * \cond UCS_INTERNAL_DOC
31 /*------------------------------------------------------------------------------------------------*/
33 /*------------------------------------------------------------------------------------------------*/
36 /*------------------------------------------------------------------------------------------------*/
38 /*------------------------------------------------------------------------------------------------*/
39 /*! \brief UNICENS internal memset-function.
40 * \param dst_ptr Pointer to the block of memory to fill
41 * \param value Value to be set
42 * \param size Number of bytes to be set to the value
44 void Misc_MemSet(void *dst_ptr, int32_t value, uint32_t size)
46 uint8_t *dst_ptr_ = (uint8_t *)dst_ptr;
49 for(i=0U; i<size; i++)
51 dst_ptr_[i] = (uint8_t)value; /* parasoft-suppress MISRA2004-17_4 "void pointer required for memset-function signature (stdlib)" */
55 /*! \brief UNICENS internal memcpy-function.
56 * \param dst_ptr Pointer to the destination array where the content is to be copied
57 * \param src_ptr Pointer to the source of data to be copied
58 * \param size Number of bytes to copy
60 void Misc_MemCpy(void *dst_ptr, void *src_ptr, uint32_t size)
62 uint8_t *dst_ptr_ = (uint8_t *)dst_ptr;
63 uint8_t *src_ptr_ = (uint8_t *)src_ptr;
66 for(i=0U; i<size; i++)
68 dst_ptr_[i] = src_ptr_[i]; /* parasoft-suppress MISRA2004-17_4 "void pointers required for memcpy-function signature (stdlib)" */
77 /*------------------------------------------------------------------------------------------------*/
79 /*------------------------------------------------------------------------------------------------*/