42 #define WIMOD_USE_2ND_RXBUFFER
45 typedef uint8_t UINT8;
46 typedef uint16_t UINT16;
47 typedef uint32_t UINT32;
48 typedef uint64_t UINT64;
51 typedef int16_t INT16;
52 typedef int32_t INT32;
56 #define MAKEWORD(lo,hi) (UINT16)(((UINT16)((UINT8)(hi)) << 8) | ((UINT16)((UINT8)(lo))))
60 #define MAKELONG(lo,hi) (UINT32)(((UINT32)((UINT16)(hi)) << 16) | ((UINT32)((UINT16)(lo))))
64 #define LOBYTE(w) (UINT8)((UINT16)(w))
68 #define HIBYTE(w) (UINT8)((UINT16)(w) >> 8)
72 #define LOWORD(w) (UINT16)((UINT32)(w))
76 #define HIWORD(w) (UINT16)((UINT32)(w) >> 16)
83 NTOH16(
const UINT8* srcPtr)
87 value = MAKEWORD(srcPtr[0], srcPtr[1]);
93 HTON16(UINT8* dstPtr, UINT16 value)
95 dstPtr[0] = LOBYTE(value);
96 dstPtr[1] = HIBYTE(value);
100 NTOH24(
const UINT8* srcPtr)
104 value = MAKELONG(MAKEWORD(srcPtr[0], srcPtr[1]),
105 MAKEWORD(srcPtr[2], 0x00));
111 HTOH24_DUMMY(
const UINT8* srcPtr)
115 value = (((uint32_t) srcPtr[0]) << 16);
116 value |= (((uint32_t) srcPtr[1]) << 8);
117 value |= (((uint32_t) srcPtr[2]) << 0);
124 HTON24(UINT8* dstPtr, UINT32 value)
126 dstPtr[0] = LOBYTE(LOWORD(value));
127 dstPtr[1] = HIBYTE(LOWORD(value));
128 dstPtr[2] = LOBYTE(HIWORD(value));
132 NTOH32(
const UINT8* srcPtr)
136 value = MAKELONG(MAKEWORD(srcPtr[0], srcPtr[1]),
137 MAKEWORD(srcPtr[2], srcPtr[3]));
143 HTON32(UINT8* dstPtr, UINT32 value)
145 dstPtr[0] = LOBYTE(LOWORD(value));
146 dstPtr[1] = HIBYTE(LOWORD(value));
147 dstPtr[2] = LOBYTE(HIWORD(value));
148 dstPtr[3] = HIBYTE(HIWORD(value));
153 #define MIN(a, b) ((a) < (b) ? (a) : (b))
154 #define MAX(a, b) ((a) < (b) ? (b) : (a))