types.h
Go to the documentation of this file.
1 /*
2  * Common Data Types for RP
3  */
4 
5 #ifndef _INFRA_HAL_TYPES_H_
6 #define _INFRA_HAL_TYPES_H_
7 
8 //Basic types
9 //
10 #ifdef WIN32
11 
12 //fake stdint.h for VC only
13 
14 typedef signed char int8_t;
15 typedef unsigned char uint8_t;
16 
17 typedef __int16 int16_t;
18 typedef unsigned __int16 uint16_t;
19 
20 typedef __int32 int32_t;
21 typedef unsigned __int32 uint32_t;
22 
23 typedef __int64 int64_t;
24 typedef unsigned __int64 uint64_t;
25 
26 
27 #define RPMODULE_EXPORT __declspec(dllexport)
28 #define RPMODULE_IMPORT __declspec(dllimport)
29 
30 #else
31 
32 #include <stdint.h>
33 
34 #define RPMODULE_EXPORT
35 #define RPMODULE_IMPORT
36 
37 #endif
38 
39 
40 //based on stdint.h
41 typedef int8_t _s8;
42 typedef uint8_t _u8;
43 
44 typedef int16_t _s16;
45 typedef uint16_t _u16;
46 
47 typedef int32_t _s32;
48 typedef uint32_t _u32;
49 
50 typedef int64_t _s64;
51 typedef uint64_t _u64;
52 
53 #define __small_endian
54 
55 #ifndef __GNUC__
56 #define __attribute__(x)
57 #endif
58 
59 
60 // The _word_size_t uses actual data bus width of the current CPU
61 #ifdef _AVR_
62 typedef _u8 _word_size_t;
63 #define THREAD_PROC
64 #elif defined (WIN64)
65 typedef _u64 _word_size_t;
66 #define THREAD_PROC __stdcall
67 #elif defined (WIN32)
68 typedef _u32 _word_size_t;
69 #define THREAD_PROC __stdcall
70 #elif defined (__GNUC__)
71 typedef unsigned long _word_size_t;
72 #define THREAD_PROC
73 #elif defined (__ICCARM__)
74 typedef _u32 _word_size_t;
75 #define THREAD_PROC
76 #endif
77 
78 
79 
80 #define __le
81 #define __be
82 
83 #define _multi_thread
84 #define _single_thread
85 
86 typedef uint32_t u_result;
87 
88 #define RESULT_OK 0
89 #define RESULT_FAIL_BIT 0x80000000
90 #define RESULT_ALREADY_DONE 0x20
91 #define RESULT_INVALID_DATA (0x8000 | RESULT_FAIL_BIT)
92 #define RESULT_OPERATION_FAIL (0x8001 | RESULT_FAIL_BIT)
93 #define RESULT_OPERATION_TIMEOUT (0x8002 | RESULT_FAIL_BIT)
94 #define RESULT_OPERATION_STOP (0x8003 | RESULT_FAIL_BIT)
95 #define RESULT_OPERATION_NOT_SUPPORT (0x8004 | RESULT_FAIL_BIT)
96 #define RESULT_FORMAT_NOT_SUPPORT (0x8005 | RESULT_FAIL_BIT)
97 #define RESULT_INSUFFICIENT_MEMORY (0x8006 | RESULT_FAIL_BIT)
98 #define RESULT_OPERATION_ABORTED (0x8007 | RESULT_FAIL_BIT)
99 #define RESULT_NOT_FOUND (0x8008 | RESULT_FAIL_BIT)
100 #define RESULT_RECONNECTING (0x8009 | RESULT_FAIL_BIT)
101 
102 #define IS_OK(x) ( ((x) & RESULT_FAIL_BIT) == 0 )
103 #define IS_FAIL(x) ( ((x) & RESULT_FAIL_BIT) )
104 
105 
106 typedef _word_size_t (THREAD_PROC * thread_proc_t ) ( void * );
107 
108 
109 #if defined (_BUILD_AS_DLL)
110 #if defined (_BUILD_DLL_EXPORT)
111 #define RPMODULE_IMPEXP RPMODULE_EXPORT
112 #else
113 #define RPMODULE_IMPEXP RPMODULE_IMPORT
114 #endif
115 #else
116 #define RPMODULE_IMPEXP
117 #endif
118 
119 #endif
uint32_t _u32
Definition: types.h:48
uint16_t _u16
Definition: types.h:45
int32_t _s32
Definition: types.h:47
uint8_t _u8
Definition: types.h:42
uint32_t u_result
Definition: types.h:86
uint8_t _u8
Definition: rptypes.h:63
typedef _word_size_t(THREAD_PROC *thread_proc_t)(void *)
uint64_t _u64
Definition: types.h:51
int16_t _s16
Definition: types.h:44
uint32_t _u32
Definition: rptypes.h:69
uint64_t _u64
Definition: rptypes.h:72
int64_t _s64
Definition: types.h:50
int8_t _s8
Definition: types.h:41


rplidar_ros
Author(s):
autogenerated on Wed Mar 20 2019 07:54:15