rptypes.h
Go to the documentation of this file.
00001 /*
00002  *  RPLIDAR SDK
00003  *
00004  *  Copyright (c) 2009 - 2014 RoboPeak Team
00005  *  http://www.robopeak.com
00006  *  Copyright (c) 2014 - 2016 Shanghai Slamtec Co., Ltd.
00007  *  http://www.slamtec.com
00008  *
00009  */
00010 /*
00011  * Redistribution and use in source and binary forms, with or without
00012  * modification, are permitted provided that the following conditions are met:
00013  *
00014  * 1. Redistributions of source code must retain the above copyright notice,
00015  *    this list of conditions and the following disclaimer.
00016  *
00017  * 2. Redistributions in binary form must reproduce the above copyright notice,
00018  *    this list of conditions and the following disclaimer in the documentation
00019  *    and/or other materials provided with the distribution.
00020  *
00021  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00022  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00023  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00024  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
00025  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00026  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00027  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00028  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00029  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00030  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
00031  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00032  *
00033  */
00034 
00035 #pragma once
00036 
00037 
00038 #ifdef _WIN32
00039 
00040 //fake stdint.h for VC only
00041 
00042 typedef signed   char     int8_t;
00043 typedef unsigned char     uint8_t;
00044 
00045 typedef __int16           int16_t;
00046 typedef unsigned __int16  uint16_t;
00047 
00048 typedef __int32           int32_t;
00049 typedef unsigned __int32  uint32_t;
00050 
00051 typedef __int64           int64_t;
00052 typedef unsigned __int64  uint64_t;
00053 
00054 #else
00055 
00056 #include <stdint.h>
00057 
00058 #endif
00059 
00060 
00061 //based on stdint.h
00062 typedef int8_t         _s8;
00063 typedef uint8_t        _u8;
00064 
00065 typedef int16_t        _s16;
00066 typedef uint16_t       _u16;
00067 
00068 typedef int32_t        _s32;
00069 typedef uint32_t       _u32;
00070 
00071 typedef int64_t        _s64;
00072 typedef uint64_t       _u64;
00073 
00074 #define __small_endian
00075 
00076 #ifndef __GNUC__
00077 #define __attribute__(x)
00078 #endif
00079 
00080 
00081 // The _word_size_t uses actual data bus width of the current CPU
00082 #ifdef _AVR_
00083 typedef _u8            _word_size_t;
00084 #define THREAD_PROC    
00085 #elif defined (WIN64)
00086 typedef _u64           _word_size_t;
00087 #define THREAD_PROC    __stdcall
00088 #elif defined (WIN32)
00089 typedef _u32           _word_size_t;
00090 #define THREAD_PROC    __stdcall
00091 #elif defined (__GNUC__)
00092 typedef unsigned long  _word_size_t;
00093 #define THREAD_PROC   
00094 #elif defined (__ICCARM__)
00095 typedef _u32            _word_size_t;
00096 #define THREAD_PROC  
00097 #endif
00098 
00099 
00100 typedef uint32_t u_result;
00101 
00102 #define RESULT_OK              0
00103 #define RESULT_FAIL_BIT        0x80000000
00104 #define RESULT_ALREADY_DONE    0x20
00105 #define RESULT_INVALID_DATA    (0x8000 | RESULT_FAIL_BIT)
00106 #define RESULT_OPERATION_FAIL  (0x8001 | RESULT_FAIL_BIT)
00107 #define RESULT_OPERATION_TIMEOUT  (0x8002 | RESULT_FAIL_BIT)
00108 #define RESULT_OPERATION_STOP    (0x8003 | RESULT_FAIL_BIT)
00109 #define RESULT_OPERATION_NOT_SUPPORT    (0x8004 | RESULT_FAIL_BIT)
00110 #define RESULT_FORMAT_NOT_SUPPORT    (0x8005 | RESULT_FAIL_BIT)
00111 #define RESULT_INSUFFICIENT_MEMORY   (0x8006 | RESULT_FAIL_BIT)
00112 
00113 #define IS_OK(x)    ( ((x) & RESULT_FAIL_BIT) == 0 )
00114 #define IS_FAIL(x)  ( ((x) & RESULT_FAIL_BIT) )
00115 
00116 typedef _word_size_t (THREAD_PROC * thread_proc_t ) ( void * );


rplidar_ros
Author(s):
autogenerated on Fri Dec 16 2016 03:59:16