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.
abcc_sw_port.h
00001 /******************************************************************************* 00002 ******************************************************************************** 00003 ** ** 00004 ** ABCC Starter Kit version 2.01.01 (2015-12-14) ** 00005 ** ** 00006 ** Delivered with: ** 00007 ** ABCC Driver 4.01.01 (2015-12-14) ** 00008 ** ABP 7.16.01 (2015-10-14) ** 00009 ** */ 00010 /******************************************************************************* 00011 ******************************************************************************** 00012 ** COPYRIGHT NOTIFICATION (c) 2015 HMS Industrial Networks AB ** 00013 ** ** 00014 ** This code is the property of HMS Industrial Networks AB. ** 00015 ** The source code may not be reproduced, distributed, or used without ** 00016 ** permission. When used together with a product from HMS, permission is ** 00017 ** granted to modify, reproduce and distribute the code in binary form ** 00018 ** without any restrictions. ** 00019 ** ** 00020 ** THE CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. HMS DOES NOT ** 00021 ** WARRANT THAT THE FUNCTIONS OF THE CODE WILL MEET YOUR REQUIREMENTS, OR ** 00022 ** THAT THE OPERATION OF THE CODE WILL BE UNINTERRUPTED OR ERROR-FREE, OR ** 00023 ** THAT DEFECTS IN IT CAN BE CORRECTED. ** 00024 ******************************************************************************** 00025 ******************************************************************************** 00026 ** Platform dependent macros and functions required by the ABCC driver and 00027 ** Anybus objects implementation to be platform independent. 00028 ** The description of the macros are found in abcc_port.h. Abcc_port.h is found 00029 ** in the public ABCC40 driver interface. 00030 ******************************************************************************** 00031 ******************************************************************************** 00032 ** Services: 00033 ** ABCC_PORT_DebugPrint() - Print debug info 00034 ** ABCC_PORT_UseCritical() - Used if any preparation is needed 00035 ** before calling 00036 ** "ABCC_PORT_EnterCritical()". 00037 ** ABCC_PORT_EnterCritical() - Disables all interrupts, if they are 00038 ** not already disabled. 00039 ** ABCC_PORT_ExitCritical() - Restore interrupts to the state they 00040 ** were in when 00041 ** "ABCC_PORT_EnterCritical()" was called. 00042 ** ABCC_PORT_MemCpy() - Port of standard memcpy() 00043 ** ABCC_PORT_StrCpyToNative() - Copy native char string to octet string 00044 ** ABCC_PORT_StrCpyToPacked() - Copy octetstring to native char* string 00045 ** ABCC_PORT_CopyOctets() - Copy octet aligned buffer. 00046 ** ABCC_PORT_Copy8() - Copy octet aligned 8 bit data. 00047 ** ABCC_PORT_Copy16() - Copy octet aligned 16 bit data. 00048 ** ABCC_PORT_Copy32() - Copy octet aligned 32 bit data. 00049 ** ABCC_PORT_Copy64() - Copy octet aligned 64 bit data. 00050 ******************************************************************************** 00051 ******************************************************************************** 00052 */ 00053 00054 #ifndef ABCC_SW_PORT_H_ 00055 #define ABCC_SW_PORT_H_ 00056 00057 #include "abcc_td.h" 00058 #include "stdio.h" 00059 #include "string.h" 00060 00061 /******************************************************************************* 00062 ** Constants 00063 ******************************************************************************** 00064 */ 00065 00066 /******************************************************************************* 00067 ** Typedefs 00068 ******************************************************************************** 00069 */ 00070 00071 /******************************************************************************* 00072 ** Public Globals 00073 ******************************************************************************** 00074 */ 00075 00076 /******************************************************************************* 00077 ** Public Services 00078 ******************************************************************************** 00079 */ 00080 00081 #define ABCC_PORT_DebugPrint( args ) 00082 00083 #define ABCC_PORT_UseCritical() 00084 00085 #define ABCC_PORT_EnterCritical() 00086 00087 #define ABCC_PORT_ExitCritical() 00088 00089 #ifdef ABCC_SYS_16_BIT_CHAR 00090 00091 void ABCC_PORT_StrCpyToPackedImpl( void* pxDest, UINT16 iDestOctetOffset, 00092 const void* pxSrc, UINT16 iNbrOfChars ); 00093 00094 void ABCC_PORT_StrCpyToNativeImpl( void* pxDest, void* pxSrc, 00095 UINT16 iSrcOctetOffset, UINT16 iNbrOfChars ); 00096 00097 void ABCC_PORT_CopyOctetsImpl( void* pxDest, UINT16 iDestOctetOffset, 00098 void* pxSrc, UINT16 iSrcOctetOffset, 00099 UINT16 iNumOctets ); 00100 00101 #define ABCC_PORT_MemCpy( pbDest, pbSource, iNbrOfOctets ) \ 00102 memcpy( pbDest, pbSource, ( iNbrOfOctets + 1 ) >> 1 ); 00103 00104 #define ABCC_PORT_StrCpyToNative( pxDest, pxSrc, iSrcOctetOffset, iNbrOfChars ) \ 00105 ABCC_PORT_StrCpyToNativeImpl( pxDest, pxSrc, iSrcOctetOffset, iNbrOfChars ) 00106 00107 #define ABCC_PORT_StrCpyToPacked( pxDest, iDestOctetOffset, pxSrc, iNbrOfChars ) \ 00108 ABCC_PORT_StrCpyToPackedImpl( pxDest, iDestOctetOffset, pxSrc, iNbrOfChars ) 00109 00110 00111 #define ABCC_PORT_CopyOctets( pxDest, iDestOctetOffset, pxSrc, iSrcOctetOffset,\ 00112 iNumOctets ) \ 00113 ABCC_PORT_CopyOctetsImpl( pxDest, iDestOctetOffset, pxSrc, \ 00114 iSrcOctetOffset, iNumOctets ); 00115 00116 #define ABCC_PORT_Copy8( pxDest, iDestOctetOffset, pxSrc, iSrcOctetOffset ) \ 00117 ABCC_PORT_CopyOctetsImpl( pxDest, iDestOctetOffset, pxSrc, \ 00118 iSrcOctetOffset, 1 ) 00119 00120 #else 00121 00122 #define ABCC_PORT_MemCpy( pbDest, pbSource, iNbrOfOctets ) \ 00123 memcpy( pbDest, pbSource, iNbrOfOctets ); 00124 00125 #define ABCC_PORT_CopyOctets( pxDest, iDestOctetOffset, pxSrc, iSrcOctetOffset,\ 00126 iNumOctets ) \ 00127 ABCC_PORT_MemCpy( (void*)&( (UINT8*)( pxDest) )[ iDestOctetOffset ], \ 00128 (void*)&( (UINT8*)( pxSrc) )[ iSrcOctetOffset ], \ 00129 iNumOctets ) 00130 00131 #define ABCC_PORT_StrCpyToNative( pxDest, pxSrc, iSrcOctetOffset, iNbrOfChars )\ 00132 ABCC_PORT_MemCpy( (void*)pxDest, \ 00133 (void*)&( (UINT8*)( pxSrc) )[ iSrcOctetOffset ], \ 00134 iNbrOfChars ) 00135 00136 #define ABCC_PORT_StrCpyToPacked( pxDest, iDestOctetOffset, pxSrc, \ 00137 iNbrOfChars ) \ 00138 ABCC_PORT_MemCpy( (void*)&( (UINT8*)( pxDest) )[ iDestOctetOffset ], \ 00139 pxSrc, iNbrOfChars ) 00140 00141 #define ABCC_PORT_Copy8( pxDest, iDestOctetOffset, pxSrc, iSrcOctetOffset ) \ 00142 ( (UINT8*)pxDest )[ iDestOctetOffset ] = \ 00143 ( (UINT8*)pxSrc )[ iSrcOctetOffset ] 00144 #endif 00145 00146 #define ABCC_PORT_Copy16( pxDest, iDestOctetOffset, pxSrc, iSrcOctetOffset ) \ 00147 ABCC_PORT_CopyOctets( pxDest, iDestOctetOffset, pxSrc, iSrcOctetOffset, 2 ) 00148 00149 #define ABCC_PORT_Copy32( pxDest, iDestOctetOffset, pxSrc, iSrcOctetOffset ) \ 00150 ABCC_PORT_CopyOctets( pxDest, iDestOctetOffset, pxSrc, iSrcOctetOffset, 4 ) 00151 00152 #if( ABCC_CFG_64BIT_ADI_SUPPORT ) 00153 #define ABCC_PORT_Copy64( pxDest, iDestOctetOffset, pxSrc, iSrcOctetOffset ) \ 00154 ABCC_PORT_CopyOctets( pxDest, iDestOctetOffset, pxSrc, iSrcOctetOffset, 8 ) 00155 #endif 00156 00157 #endif /* inclusion lock */
Generated on Tue Jul 12 2022 15:51:56 by
