Fork of my original MQTTGateway

Dependencies:   mbed-http

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Utils.h Source File

Utils.h

00001 /**
00002  * Copyright (c) 2015 Digi International Inc.,
00003  * All rights not expressly granted are reserved.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
00007  * You can obtain one at http://mozilla.org/MPL/2.0/.
00008  *
00009  * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
00010  * =======================================================================
00011  */
00012 
00013 #if !defined(__XB_UTILS_H_)
00014 #define __XB_UTILS_H_
00015 
00016 #include <stdint.h>
00017 
00018 /** Buils an uint16_t out of 2 single bytes */
00019 #define UINT16(msb,lsb)     (uint16_t)(((msb) << 8) | (lsb))
00020 /** Buils an uint64_t out of 2 uint32_t */
00021 #define UINT64(msb,lsb)     (uint64_t)(((uint64_t)(msb) << 32) | (lsb))
00022 
00023 #define UINT64_HI32(u64)     (uint32_t)((u64) >> 32)
00024 #define UINT64_LO32(u64)     (uint32_t)((u64) & 0xFFFFFFFF)
00025 
00026 #define UNUSED_PARAMETER(a)  ((void)(a))
00027 
00028 /** rmemcpy - like memcpy but copies the bytes in reverse order
00029  *
00030  *  @param dest pointer with the destination address
00031  *  @param src pointer with the source address
00032  *  @param bytes number of bytes that will be copied
00033  */
00034 void rmemcpy(uint8_t * const dest, const uint8_t * const src, uint16_t bytes);
00035 
00036 #endif /* __XB_UTILS_H_ */