XBee modules

Dependencies:   DigiLogger

Fork of XBeeLib by Digi International Inc.

Committer:
Javier117
Date:
Tue Oct 18 20:47:11 2016 +0000
Revision:
10:6b922add27d7
Parent:
3:8662ebe83570
No DebugLogger

Who changed what in which revision?

UserRevisionLine numberNew contents of line
spastor 0:fcaad0dfa051 1 /**
spastor 0:fcaad0dfa051 2 * Copyright (c) 2015 Digi International Inc.,
spastor 0:fcaad0dfa051 3 * All rights not expressly granted are reserved.
spastor 0:fcaad0dfa051 4 *
spastor 0:fcaad0dfa051 5 * This Source Code Form is subject to the terms of the Mozilla Public
spastor 0:fcaad0dfa051 6 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
spastor 0:fcaad0dfa051 7 * You can obtain one at http://mozilla.org/MPL/2.0/.
spastor 0:fcaad0dfa051 8 *
spastor 0:fcaad0dfa051 9 * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
spastor 0:fcaad0dfa051 10 * =======================================================================
spastor 0:fcaad0dfa051 11 */
spastor 0:fcaad0dfa051 12
spastor 0:fcaad0dfa051 13 #if !defined(__XB_UTILS_H_)
spastor 0:fcaad0dfa051 14 #define __XB_UTILS_H_
spastor 0:fcaad0dfa051 15
spastor 0:fcaad0dfa051 16 #include <stdint.h>
spastor 0:fcaad0dfa051 17
spastor 0:fcaad0dfa051 18 /** Buils an uint16_t out of 2 single bytes */
spastor 0:fcaad0dfa051 19 #define UINT16(msb,lsb) (uint16_t)(((msb) << 8) | (lsb))
spastor 0:fcaad0dfa051 20 /** Buils an uint64_t out of 2 uint32_t */
spastor 0:fcaad0dfa051 21 #define UINT64(msb,lsb) (uint64_t)(((uint64_t)(msb) << 32) | (lsb))
spastor 0:fcaad0dfa051 22
spastor 0:fcaad0dfa051 23 #define UINT64_HI32(u64) (uint32_t)((u64) >> 32)
spastor 0:fcaad0dfa051 24 #define UINT64_LO32(u64) (uint32_t)((u64) & 0xFFFFFFFF)
spastor 0:fcaad0dfa051 25
hbujanda 2:2ee1b6d51df2 26 #define UNUSED_PARAMETER(a) ((void)(a))
hbujanda 2:2ee1b6d51df2 27
spastor 0:fcaad0dfa051 28 /** rmemcpy - like memcpy but copies the bytes in reverse order
spastor 0:fcaad0dfa051 29 *
spastor 0:fcaad0dfa051 30 * @param dest pointer with the destination address
spastor 0:fcaad0dfa051 31 * @param src pointer with the source address
spastor 0:fcaad0dfa051 32 * @param bytes number of bytes that will be copied
spastor 0:fcaad0dfa051 33 */
spastor 0:fcaad0dfa051 34 void rmemcpy(uint8_t * const dest, const uint8_t * const src, uint16_t bytes);
spastor 0:fcaad0dfa051 35
spastor 0:fcaad0dfa051 36 #endif /* __XB_UTILS_H_ */