Main MRPT website
>
C++ reference for MRPT 1.9.9
rplidar
include
rptypes.h
Go to the documentation of this file.
1
/* +------------------------------------------------------------------------+
2
| Mobile Robot Programming Toolkit (MRPT) |
3
| http://www.mrpt.org/ |
4
| |
5
| Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6
| See: http://www.mrpt.org/Authors - All rights reserved. |
7
| Released under BSD License. See details in http://www.mrpt.org/License |
8
+------------------------------------------------------------------------+ */
9
/*
10
* Redistribution and use in source and binary forms, with or without
11
* modification, are permitted provided that the following conditions are met:
12
*
13
* 1. Redistributions of source code must retain the above copyright notice,
14
* this list of conditions and the following disclaimer.
15
*
16
* 2. Redistributions in binary form must reproduce the above copyright notice,
17
* this list of conditions and the following disclaimer in the documentation
18
* and/or other materials provided with the distribution.
19
*
20
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
24
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
*
32
*/
33
34
#pragma once
35
36
#ifdef _WIN32
37
38
// fake stdint.h for VC only
39
40
typedef
signed
char
int8_t
;
41
typedef
unsigned
char
uint8_t
;
42
43
typedef
__int16
int16_t
;
44
typedef
unsigned
__int16
uint16_t
;
45
46
typedef
__int32
int32_t
;
47
typedef
unsigned
__int32
uint32_t
;
48
49
typedef
__int64
int64_t
;
50
typedef
unsigned
__int64
uint64_t
;
51
52
#else
53
54
#include <stdint.h>
55
56
#endif
57
58
// based on stdint.h
59
typedef
int8_t
_s8
;
60
typedef
uint8_t
_u8
;
61
62
typedef
int16_t
_s16
;
63
typedef
uint16_t
_u16
;
64
65
typedef
int32_t
_s32
;
66
typedef
uint32_t
_u32
;
67
68
typedef
int64_t
_s64
;
69
typedef
uint64_t
_u64
;
70
71
#define __small_endian
72
73
#ifndef __GNUC__
74
#define __attribute__(x)
75
#endif
76
77
// The _word_size_t uses actual data bus width of the current CPU
78
#ifdef _AVR_
79
typedef
_u8
_word_size_t;
80
#define THREAD_PROC
81
#elif defined(WIN64)
82
typedef
_u64
_word_size_t;
83
#define THREAD_PROC __stdcall
84
#elif defined(WIN32)
85
typedef
_u32
_word_size_t;
86
#define THREAD_PROC __stdcall
87
#elif defined(__GNUC__)
88
typedef
unsigned
long
_word_size_t;
89
#define THREAD_PROC
90
#elif defined(__ICCARM__)
91
typedef
_u32
_word_size_t;
92
#define THREAD_PROC
93
#endif
94
95
typedef
uint32_t
u_result
;
96
97
#define RESULT_OK 0
98
#define RESULT_FAIL_BIT 0x80000000
99
#define RESULT_ALREADY_DONE 0x20
100
#define RESULT_INVALID_DATA (0x8000 | RESULT_FAIL_BIT)
101
#define RESULT_OPERATION_FAIL (0x8001 | RESULT_FAIL_BIT)
102
#define RESULT_OPERATION_TIMEOUT (0x8002 | RESULT_FAIL_BIT)
103
#define RESULT_OPERATION_STOP (0x8003 | RESULT_FAIL_BIT)
104
#define RESULT_OPERATION_NOT_SUPPORT (0x8004 | RESULT_FAIL_BIT)
105
#define RESULT_FORMAT_NOT_SUPPORT (0x8005 | RESULT_FAIL_BIT)
106
#define RESULT_INSUFFICIENT_MEMORY (0x8006 | RESULT_FAIL_BIT)
107
108
#define IS_OK(x) (((x)&RESULT_FAIL_BIT) == 0)
109
#define IS_FAIL(x) (((x)&RESULT_FAIL_BIT))
110
111
typedef
_word_size_t(THREAD_PROC*
thread_proc_t
)(
void
*);
_u16
uint16_t _u16
Definition:
rptypes.h:63
u_result
uint32_t u_result
Definition:
rptypes.h:95
_s8
int8_t _s8
Definition:
rptypes.h:59
uint16_t
unsigned __int16 uint16_t
Definition:
rptypes.h:44
_u8
uint8_t _u8
Definition:
rptypes.h:60
int64_t
__int64 int64_t
Definition:
rptypes.h:49
uint8_t
unsigned char uint8_t
Definition:
rptypes.h:41
int8_t
signed char int8_t
Definition:
rptypes.h:40
thread_proc_t
_word_size_t(THREAD_PROC * thread_proc_t)(void *)
Definition:
rptypes.h:111
int16_t
__int16 int16_t
Definition:
rptypes.h:43
_s64
int64_t _s64
Definition:
rptypes.h:68
uint64_t
unsigned __int64 uint64_t
Definition:
rptypes.h:50
_s32
int32_t _s32
Definition:
rptypes.h:65
int32_t
__int32 int32_t
Definition:
rptypes.h:46
_s16
int16_t _s16
Definition:
rptypes.h:62
_u64
uint64_t _u64
Definition:
rptypes.h:69
_u32
uint32_t _u32
Definition:
rptypes.h:66
uint32_t
unsigned __int32 uint32_t
Definition:
rptypes.h:47
Page generated by
Doxygen 1.8.17
for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST