MAX32665 SDK Documentation
0.2
Software Development Kit Overview and API Documentation
mem_utils.h
1
5
/* ***************************************************************************
6
* Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
7
*
8
* Permission is hereby granted, free of charge, to any person obtaining a
9
* copy of this software and associated documentation files (the "Software"),
10
* to deal in the Software without restriction, including without limitation
11
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
12
* and/or sell copies of the Software, and to permit persons to whom the
13
* Software is furnished to do so, subject to the following conditions:
14
*
15
* The above copyright notice and this permission notice shall be included
16
* in all copies or substantial portions of the Software.
17
*
18
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21
* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
22
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
23
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24
* OTHER DEALINGS IN THE SOFTWARE.
25
*
26
* Except as contained in this notice, the name of Maxim Integrated
27
* Products, Inc. shall not be used except as stated in the Maxim Integrated
28
* Products, Inc. Branding Policy.
29
*
30
* The mere transfer of this software does not imply any licenses
31
* of trade secrets, proprietary technology, copyrights, patents,
32
* trademarks, maskwork rights, or any other form of intellectual
33
* property whatsoever. Maxim Integrated Products, Inc. retains all
34
* ownership rights.
35
*
36
* $Date: 2020-09-28 09:41:57 -0500 (Mon, 28 Sep 2020) $
37
* $Revision: 55932 $
38
*
39
************************************************************************** */
40
41
#ifndef _MEM_UTILS_H_
42
#define _MEM_UTILS_H_
43
44
#ifdef __cplusplus
45
extern
"C"
{
46
#endif
47
48
/* **** Definitions **** */
49
50
51
/* **** Global Data **** */
52
53
54
/* **** Function Prototypes **** */
55
65
void
memset32(uint32_t * dst, uint32_t value,
unsigned
int
len);
66
76
void
memcpy32(uint32_t * dst, uint32_t * src,
unsigned
int
len);
77
78
79
80
/* ***********************************************************************
81
*
82
* @brief Compares the first @c len bytes of @c src and @c dst and
83
* returns #E_NO_ERROR if they match.
84
* @param dst Destination address
85
* @param src Source address
86
* @param[in] len Number of bytes to compare between the @c src and
87
* @c dst.
88
* @note The compare is done 32-bits at a time and @c len should be
89
* a multiple of 4 and any bytes beyond a multiple of 4 are
90
* ignored. For example, the following call to memcmp32() only
91
* compares the first 8 bytes (2 32-bit words) of @c dst and
92
* @c src and would return 0 indicating the memory is the same.
93
* @code
94
* int retval;
95
* int len = 11;
96
* char src[len] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
97
* char dst[len] = {0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0};
98
*
99
* if (memcmp32(dst, src, len) != 0)
100
* {
101
* printf("Memory compare failed\n");
102
* }
103
* else
104
* {
105
* // memcmp32 passes even though the src and dst are
106
* // not identical starting at src[8] and dst[8]
107
* printf("memcmp32 passed.\n");
108
* }
109
* @endcode
110
*
111
* @return #E_NO_ERROR Contents of @c src and @c dst are equal
112
* @return #E_INVALID Memory is not equal
113
*/
114
int
memcmp32(uint32_t * dst, uint32_t * src,
unsigned
int
len);
115
116
#ifdef __cplusplus
117
}
118
#endif
119
120
#endif
/* _MEM_UTILS_H_ */
121
Firmware
Libraries
MAX32665PeriphDriver
Include
mem_utils.h
0.2