Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of fsl_phy_mcr20a by
FunctionLib.h File Reference
Go to the source code of this file.
Functions | |
void | FLib_MemCpy (void *pDst, void *pSrc, uint32_t cBytes) |
Copy the content of one memory block to another. The amount of data to copy must be specified in number of bytes. | |
void | FLib_MemCpyAligned32bit (void *to_ptr, void *from_ptr, register uint32_t number_of_bytes) |
This function copies the specified number of bytes from the source address to the destination address. No attempt is made to handle overlapping copies to prevent loss of data. The copying is optimized to avoid alignment problems, and attempts to copy 32bit numbers optimally. | |
void | FLib_MemCpyDir (void *pBuf1, void *pBuf2, bool_t dir, uint32_t n) |
Copy bytes from one buffer to another. The buffers should not overlap. The function can copy in either direction. If 'dir' is TRUE, then the function works like FLib_MemCpy(). If FALSE, the function swaps the buffer pointers before copying. | |
void | FLib_MemCpyReverseOrder (void *pDst, void *pSrc, uint32_t cBytes) |
Copy bytes. The byte at index i from the source buffer is copied to index ((n-1) - i) in the destination buffer (and vice versa). | |
bool_t | FLib_MemCmp (void *pData1, void *pData2, uint32_t cBytes) |
Compare two memory blocks. The number of bytes to compare must be specified. If the blocks are equal byte by byte, the function returns TRUE, and FALSE otherwise. | |
void | FLib_MemSet (void *pData, uint8_t value, uint32_t cBytes) |
Reset bytes in a memory block to a certain value. The value, and the number of bytes to be set, are supplied as arguments. | |
void | FLib_MemInPlaceCpy (void *pDst, void *pSrc, uint32_t cBytes) |
Copy bytes, possibly into the same overlapping memory as it is taken from. | |
void | FLib_MemCopy16Unaligned (void *pDst, uint16_t val16) |
Copies a 16bit value to an unaligned a memory block. | |
void | FLib_MemCopy32Unaligned (void *pDst, uint32_t val32) |
Copies a 32bit value to an unaligned a memory block. | |
void | FLib_MemCopy64Unaligned (void *pDst, uint64_t val64) |
Copies a 64bit value to an unaligned a memory block. | |
void | FLib_AddOffsetToPointer (void **pPtr, uint32_t offset) |
Add an offset to a pointer. | |
uint32_t | FLib_StrLen (char *str) |
This function returns the length of a NULL terminated string. |
Detailed Description
Copyright (c) 2015, Freescale Semiconductor, Inc. All rights reserved.
This is the Function Lib module header file
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
o Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
o Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
o Neither the name of Freescale Semiconductor, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file FunctionLib.h.
Function Documentation
void FLib_AddOffsetToPointer | ( | void ** | pPtr, |
uint32_t | offset | ||
) |
Add an offset to a pointer.
*********************************************************************************
- Parameters:
-
[out] pPtr Pointer to the pointer to be updated [in] offset The offset(in bytes) to be added
Add an offset to a pointer.
*********************************************************************************
- Parameters:
-
[in,out] pPtr Pointer to the pointer to add the offset to [in] offset Offset to add to the specified pointer.
- Postcondition:
- Remarks:
Definition at line 466 of file FunctionLib.c.
bool_t FLib_MemCmp | ( | void * | pData1, |
void * | pData2, | ||
uint32_t | cBytes | ||
) |
Compare two memory blocks. The number of bytes to compare must be specified. If the blocks are equal byte by byte, the function returns TRUE, and FALSE otherwise.
*********************************************************************************
- Parameters:
-
[in] pData1 First memory block to compare [in] pData2 Second memory block to compare [in] cBytes Number of bytes to compare
- Returns:
- TRUE if memory areas are equal. FALSE othwerwise.
Compare two memory blocks. The number of bytes to compare must be specified. If the blocks are equal byte by byte, the function returns TRUE, and FALSE otherwise.
*********************************************************************************
- Parameters:
-
[in] pData1 First buffer to compare. [in] pData2 Second buffer to compare. [in] cBytes Number of bytes to compare.
- Returns:
- This function return TRUE if the buffers are equal and FALSE otherwise.
- Postcondition:
- Remarks:
Definition at line 283 of file FunctionLib.c.
void FLib_MemCopy16Unaligned | ( | void * | pDst, |
uint16_t | val16 | ||
) |
Copies a 16bit value to an unaligned a memory block.
*********************************************************************************
- Parameters:
-
[out] pDst Pointer to destination memory block [in] val16 The 16-bit value to be copied
Copies a 16bit value to an unaligned a memory block.
*********************************************************************************
- Parameters:
-
[in,out] pDst Pointer to the destination memory block. [in] val16 The value to be copied.
Definition at line 394 of file FunctionLib.c.
void FLib_MemCopy32Unaligned | ( | void * | pDst, |
uint32_t | val32 | ||
) |
Copies a 32bit value to an unaligned a memory block.
*********************************************************************************
- Parameters:
-
[out] pDst Pointer to destination memory block [in] val32 The 32-bit value to be copied
Copies a 32bit value to an unaligned a memory block.
*********************************************************************************
- Parameters:
-
[in,out] pDst Pointer to the destination memory block. [in] val32 The value to be copied.
Definition at line 414 of file FunctionLib.c.
void FLib_MemCopy64Unaligned | ( | void * | pDst, |
uint64_t | val64 | ||
) |
Copies a 64bit value to an unaligned a memory block.
*********************************************************************************
- Parameters:
-
[out] pDst Pointer to destination memory block [in] val64 The 64-bit value to be copied
Copies a 64bit value to an unaligned a memory block.
*********************************************************************************
- Parameters:
-
[in,out] pDst Pointer to the destination memory block. [in] val64 The value to be copied.
Definition at line 436 of file FunctionLib.c.
void FLib_MemCpy | ( | void * | pDst, |
void * | pSrc, | ||
uint32_t | cBytes | ||
) |
Copy the content of one memory block to another. The amount of data to copy must be specified in number of bytes.
*********************************************************************************
Public prototypes
*********************************************************************************
Public type definitions
*********************************************************************************
Public memory declarations
*********************************************************************************
Public functions
*********************************************************************************
- Parameters:
-
[out] pDst Pointer to destination memory block [in] pSrc Pointer to source memory block [in] cBytes Number of bytes to copy
Copy the content of one memory block to another. The amount of data to copy must be specified in number of bytes.
*********************************************************************************
Private macros
*********************************************************************************
Private prototypes
*********************************************************************************
Private type definitions
*********************************************************************************
Public memory declarations
*********************************************************************************
Private memory declarations
*********************************************************************************
Public functions
*********************************************************************************
- Parameters:
-
[in,out] pDst Pointer to the destination buffer. [in] pSrc Pointer to the source buffer. [in] cBytes Number of bytes to copy.
- Postcondition:
- The source and destination buffers must not overlap.
- Remarks:
Definition at line 91 of file FunctionLib.c.
void FLib_MemCpyAligned32bit | ( | void * | to_ptr, |
void * | from_ptr, | ||
register uint32_t | number_of_bytes | ||
) |
This function copies the specified number of bytes from the source address to the destination address. No attempt is made to handle overlapping copies to prevent loss of data. The copying is optimized to avoid alignment problems, and attempts to copy 32bit numbers optimally.
*********************************************************************************
- Parameters:
-
[in] from_ptr Pointer to the source buffer. [in,out] to_ptr Pointer to the destination buffer. [in] number_of_bytes Number of bytes to copy (32 bit value).
- Postcondition:
- Remarks:
Definition at line 126 of file FunctionLib.c.
void FLib_MemCpyDir | ( | void * | pBuf1, |
void * | pBuf2, | ||
bool_t | dir, | ||
uint32_t | n | ||
) |
Copy bytes from one buffer to another. The buffers should not overlap. The function can copy in either direction. If 'dir' is TRUE, then the function works like FLib_MemCpy(). If FALSE, the function swaps the buffer pointers before copying.
*********************************************************************************
- Parameters:
-
[in,out] pBuf1 Pointer to the destination/source buffer. [in,out] pBuf2 Pointer to the source/destination buffer. [in] dir Direction to copy: pBuf2->pBuf1 if TRUE, pBuf1->pBuf2 if FALSE [in] n Number of bytes to copy.
- Postcondition:
- The source and destination buffers must not overlap.
- Remarks:
Definition at line 217 of file FunctionLib.c.
void FLib_MemCpyReverseOrder | ( | void * | pDst, |
void * | pSrc, | ||
uint32_t | cBytes | ||
) |
Copy bytes. The byte at index i from the source buffer is copied to index ((n-1) - i) in the destination buffer (and vice versa).
*********************************************************************************
- Parameters:
-
[out] pDst Pointer to destination memory block [in] pSrc Pointer to source memory block [in] cBytes Number of bytes to copy
Copy bytes. The byte at index i from the source buffer is copied to index ((n-1) - i) in the destination buffer (and vice versa).
*********************************************************************************
- Parameters:
-
[in,out] pDst Pointer to the destination buffer. [in] pSrc Pointer to the source buffer. [in] cBytes Number of bytes to copy.
- Postcondition:
- Remarks:
Definition at line 248 of file FunctionLib.c.
void FLib_MemInPlaceCpy | ( | void * | pDst, |
void * | pSrc, | ||
uint32_t | cBytes | ||
) |
Copy bytes, possibly into the same overlapping memory as it is taken from.
*********************************************************************************
- Parameters:
-
[out] pDst Pointer to destination memory block [in] pSrc Pointer to source memory block [in] cBytes Number of bytes to copy
Copy bytes, possibly into the same overlapping memory as it is taken from.
*********************************************************************************
- Parameters:
-
[in,out] pDst Pointer to the destination buffer. [in] pSrc Pointer to the source buffer. [in] cBytes Number of bytes to copy.
- Postcondition:
- Remarks:
Definition at line 352 of file FunctionLib.c.
void FLib_MemSet | ( | void * | pDst, |
uint8_t | value, | ||
uint32_t | cBytes | ||
) |
Reset bytes in a memory block to a certain value. The value, and the number of bytes to be set, are supplied as arguments.
*********************************************************************************
- Parameters:
-
[in] pData Pointer to memory block to reset [in] value Value that memory block will be set to [in] cBytes Number of bytes to set
Reset bytes in a memory block to a certain value. The value, and the number of bytes to be set, are supplied as arguments.
*********************************************************************************
- Parameters:
-
[in,out] pDst Address of the buffer to set. [in] value Set value. [in] cBytes Number of bytes to set in the buffer (maximum 255 bytes).
- Postcondition:
- Remarks:
Definition at line 322 of file FunctionLib.c.
uint32_t FLib_StrLen | ( | char * | str ) |
This function returns the length of a NULL terminated string.
*********************************************************************************
- Parameters:
-
[in] str A NULL terminated string
- Returns:
- the size of string in bytes
Definition at line 481 of file FunctionLib.c.
Generated on Fri Jul 15 2022 21:41:18 by
