Vergil Cola
/
MQTTGatewayK64
Fork of my MQTTGateway
XbeeMonitor/XBeeLib/Utils/Utils.h@0:f1d3878b8dd9, 2017-04-08 (annotated)
- Committer:
- vpcola
- Date:
- Sat Apr 08 14:45:51 2017 +0000
- Revision:
- 0:f1d3878b8dd9
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vpcola | 0:f1d3878b8dd9 | 1 | /** |
vpcola | 0:f1d3878b8dd9 | 2 | * Copyright (c) 2015 Digi International Inc., |
vpcola | 0:f1d3878b8dd9 | 3 | * All rights not expressly granted are reserved. |
vpcola | 0:f1d3878b8dd9 | 4 | * |
vpcola | 0:f1d3878b8dd9 | 5 | * This Source Code Form is subject to the terms of the Mozilla Public |
vpcola | 0:f1d3878b8dd9 | 6 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
vpcola | 0:f1d3878b8dd9 | 7 | * You can obtain one at http://mozilla.org/MPL/2.0/. |
vpcola | 0:f1d3878b8dd9 | 8 | * |
vpcola | 0:f1d3878b8dd9 | 9 | * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343 |
vpcola | 0:f1d3878b8dd9 | 10 | * ======================================================================= |
vpcola | 0:f1d3878b8dd9 | 11 | */ |
vpcola | 0:f1d3878b8dd9 | 12 | |
vpcola | 0:f1d3878b8dd9 | 13 | #if !defined(__XB_UTILS_H_) |
vpcola | 0:f1d3878b8dd9 | 14 | #define __XB_UTILS_H_ |
vpcola | 0:f1d3878b8dd9 | 15 | |
vpcola | 0:f1d3878b8dd9 | 16 | #include <stdint.h> |
vpcola | 0:f1d3878b8dd9 | 17 | |
vpcola | 0:f1d3878b8dd9 | 18 | /** Buils an uint16_t out of 2 single bytes */ |
vpcola | 0:f1d3878b8dd9 | 19 | #define UINT16(msb,lsb) (uint16_t)(((msb) << 8) | (lsb)) |
vpcola | 0:f1d3878b8dd9 | 20 | /** Buils an uint64_t out of 2 uint32_t */ |
vpcola | 0:f1d3878b8dd9 | 21 | #define UINT64(msb,lsb) (uint64_t)(((uint64_t)(msb) << 32) | (lsb)) |
vpcola | 0:f1d3878b8dd9 | 22 | |
vpcola | 0:f1d3878b8dd9 | 23 | #define UINT64_HI32(u64) (uint32_t)((u64) >> 32) |
vpcola | 0:f1d3878b8dd9 | 24 | #define UINT64_LO32(u64) (uint32_t)((u64) & 0xFFFFFFFF) |
vpcola | 0:f1d3878b8dd9 | 25 | |
vpcola | 0:f1d3878b8dd9 | 26 | #define UNUSED_PARAMETER(a) ((void)(a)) |
vpcola | 0:f1d3878b8dd9 | 27 | |
vpcola | 0:f1d3878b8dd9 | 28 | /** rmemcpy - like memcpy but copies the bytes in reverse order |
vpcola | 0:f1d3878b8dd9 | 29 | * |
vpcola | 0:f1d3878b8dd9 | 30 | * @param dest pointer with the destination address |
vpcola | 0:f1d3878b8dd9 | 31 | * @param src pointer with the source address |
vpcola | 0:f1d3878b8dd9 | 32 | * @param bytes number of bytes that will be copied |
vpcola | 0:f1d3878b8dd9 | 33 | */ |
vpcola | 0:f1d3878b8dd9 | 34 | void rmemcpy(uint8_t * const dest, const uint8_t * const src, uint16_t bytes); |
vpcola | 0:f1d3878b8dd9 | 35 | |
vpcola | 0:f1d3878b8dd9 | 36 | #endif /* __XB_UTILS_H_ */ |