Digi XBee(R) ANSI C Host Library
platform_config.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Digi International Inc.,
3  * All rights not expressly granted are reserved.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
7  * You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
10  * =======================================================================
11  */
12 
24 #ifndef __XBEE_PLATFORM_KL25_MBED
25 #define __XBEE_PLATFORM_KL25_MBED
26  #define XBEE_DEVICE_ENABLE_ATMODE
27 
28  #define strcmpi strcasecmp
29  #define strncmpi strncasecmp
30 
31  // macros used to declare a packed structure (no alignment of elements)
32  // The more-flexible XBEE_PACKED() replaced PACKED_STRUCT in 2019.
33  #define PACKED_STRUCT struct __attribute__ ((__packed__))
34  #define XBEE_PACKED(name, decl) PACKED_STRUCT name decl
35 
36  #define _f_memcpy memcpy
37  #define _f_memset memset
38 
39  // stdint.h for int8_t, uint8_t, int16_t, etc. types
40  #include <stdint.h>
41 
42  typedef int bool_t;
43 
44  // inttypes.h for PRIx16, PRIx32, etc. macros
45  #include <inttypes.h>
46 
47  // the "FAR" modifier is not used
48  #define FAR
49 
50  typedef struct xbee_serial_t
51  {
52  uint32_t baudrate;
53  } xbee_serial_t;
54 
55  // We'll use 1/1/2000 as the epoch, to match ZigBee.
56  #define ZCL_TIME_EPOCH_DELTA 0
57 
58  #define XBEE_MS_TIMER_RESOLUTION 1
59 
61 
62  uint16_t _xbee_get_unaligned16( const void FAR *p);
63  uint32_t _xbee_get_unaligned32( const void FAR *p);
64  void _xbee_set_unaligned16( void FAR *p, uint16_t value);
65  void _xbee_set_unaligned32( void FAR *p, uint32_t value);
66 
67  #define xbee_get_unaligned16( p) _xbee_get_unaligned16( p)
68  #define xbee_get_unaligned32( p) _xbee_get_unaligned32( p)
69  #define xbee_set_unaligned16( p, v) _xbee_set_unaligned16( p, v)
70  #define xbee_set_unaligned32( p, v) _xbee_set_unaligned32( p, v)
71 
72  int xbee_platform_init( void);
73  #define XBEE_PLATFORM_INIT() xbee_platform_init()
74 
76 #endif
77 
unsigned long uint32_t
32-bit unsigned integer
Definition: platform_config.h:43
#define FAR
On platforms with "far" pointers, define to the proper keyword; empty definition if not required...
Definition: platform.h:396
Definition: platform_config.h:71
#define XBEE_BEGIN_DECLS
Macro defined to.
Definition: platform.h:41
unsigned short uint16_t
16-bit unsigned integer
Definition: platform_config.h:41
#define XBEE_END_DECLS
Macro defined to.
Definition: platform.h:42
int bool_t
Variable that can hold 0 or 1, may be an int for speed purporses or uint8_t for size optimization...
Definition: platform_config.h:51