Pierre-Yves Malengre
/
Lidar
Lidar program
inc/rptypes.h@0:1d10a6e6808c, 2021-03-03 (annotated)
- Committer:
- pymal
- Date:
- Wed Mar 03 21:49:13 2021 +0000
- Revision:
- 0:1d10a6e6808c
Trying to publish Lidar program
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pymal | 0:1d10a6e6808c | 1 | /* |
pymal | 0:1d10a6e6808c | 2 | * RPLIDAR SDK for Mbed |
pymal | 0:1d10a6e6808c | 3 | * |
pymal | 0:1d10a6e6808c | 4 | * Copyright (c) 2009 - 2014 RoboPeak Team |
pymal | 0:1d10a6e6808c | 5 | * http://www.robopeak.com |
pymal | 0:1d10a6e6808c | 6 | * Copyright (c) 2014 - 2019 Shanghai Slamtec Co., Ltd. |
pymal | 0:1d10a6e6808c | 7 | * http://www.slamtec.com |
pymal | 0:1d10a6e6808c | 8 | * |
pymal | 0:1d10a6e6808c | 9 | */ |
pymal | 0:1d10a6e6808c | 10 | /* |
pymal | 0:1d10a6e6808c | 11 | * Redistribution and use in source and binary forms, with or without |
pymal | 0:1d10a6e6808c | 12 | * modification, are permitted provided that the following conditions are met: |
pymal | 0:1d10a6e6808c | 13 | * |
pymal | 0:1d10a6e6808c | 14 | * 1. Redistributions of source code must retain the above copyright notice, |
pymal | 0:1d10a6e6808c | 15 | * this list of conditions and the following disclaimer. |
pymal | 0:1d10a6e6808c | 16 | * |
pymal | 0:1d10a6e6808c | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
pymal | 0:1d10a6e6808c | 18 | * this list of conditions and the following disclaimer in the documentation |
pymal | 0:1d10a6e6808c | 19 | * and/or other materials provided with the distribution. |
pymal | 0:1d10a6e6808c | 20 | * |
pymal | 0:1d10a6e6808c | 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
pymal | 0:1d10a6e6808c | 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
pymal | 0:1d10a6e6808c | 23 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
pymal | 0:1d10a6e6808c | 24 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR |
pymal | 0:1d10a6e6808c | 25 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
pymal | 0:1d10a6e6808c | 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
pymal | 0:1d10a6e6808c | 27 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
pymal | 0:1d10a6e6808c | 28 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
pymal | 0:1d10a6e6808c | 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
pymal | 0:1d10a6e6808c | 30 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
pymal | 0:1d10a6e6808c | 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
pymal | 0:1d10a6e6808c | 32 | * |
pymal | 0:1d10a6e6808c | 33 | */ |
pymal | 0:1d10a6e6808c | 34 | |
pymal | 0:1d10a6e6808c | 35 | #pragma once |
pymal | 0:1d10a6e6808c | 36 | #include "mbed.h" |
pymal | 0:1d10a6e6808c | 37 | |
pymal | 0:1d10a6e6808c | 38 | // #define __small_endian |
pymal | 0:1d10a6e6808c | 39 | |
pymal | 0:1d10a6e6808c | 40 | // #ifndef __GNUC__ |
pymal | 0:1d10a6e6808c | 41 | // #define __attribute__(x) |
pymal | 0:1d10a6e6808c | 42 | // #endif |
pymal | 0:1d10a6e6808c | 43 | |
pymal | 0:1d10a6e6808c | 44 | |
pymal | 0:1d10a6e6808c | 45 | // // The _word_size_t uses actual data bus width of the current CPU |
pymal | 0:1d10a6e6808c | 46 | // #ifdef _AVR_ |
pymal | 0:1d10a6e6808c | 47 | // typedef _u8 _word_size_t; |
pymal | 0:1d10a6e6808c | 48 | // #define THREAD_PROC |
pymal | 0:1d10a6e6808c | 49 | // #elif defined (WIN64) |
pymal | 0:1d10a6e6808c | 50 | // typedef _u64 _word_size_t; |
pymal | 0:1d10a6e6808c | 51 | // #define THREAD_PROC __stdcall |
pymal | 0:1d10a6e6808c | 52 | // #elif defined (WIN32) |
pymal | 0:1d10a6e6808c | 53 | // typedef _u32 _word_size_t; |
pymal | 0:1d10a6e6808c | 54 | // #define THREAD_PROC __stdcall |
pymal | 0:1d10a6e6808c | 55 | // #elif defined (__GNUC__) |
pymal | 0:1d10a6e6808c | 56 | // typedef unsigned long _word_size_t; |
pymal | 0:1d10a6e6808c | 57 | // #define THREAD_PROC |
pymal | 0:1d10a6e6808c | 58 | // #elif defined (__ICCARM__) |
pymal | 0:1d10a6e6808c | 59 | // typedef _u32 _word_size_t; |
pymal | 0:1d10a6e6808c | 60 | // #define THREAD_PROC |
pymal | 0:1d10a6e6808c | 61 | // #endif |
pymal | 0:1d10a6e6808c | 62 | |
pymal | 0:1d10a6e6808c | 63 | |
pymal | 0:1d10a6e6808c | 64 | typedef uint32_t u_result; |
pymal | 0:1d10a6e6808c | 65 | |
pymal | 0:1d10a6e6808c | 66 | #define RESULT_OK 0 |
pymal | 0:1d10a6e6808c | 67 | #define RESULT_FAIL_BIT 0x80000000 |
pymal | 0:1d10a6e6808c | 68 | #define RESULT_ALREADY_DONE 0x20 |
pymal | 0:1d10a6e6808c | 69 | #define RESULT_INVALID_DATA (0x8000 | RESULT_FAIL_BIT) |
pymal | 0:1d10a6e6808c | 70 | #define RESULT_OPERATION_FAIL (0x8001 | RESULT_FAIL_BIT) |
pymal | 0:1d10a6e6808c | 71 | #define RESULT_OPERATION_TIMEOUT (0x8002 | RESULT_FAIL_BIT) |
pymal | 0:1d10a6e6808c | 72 | #define RESULT_OPERATION_STOP (0x8003 | RESULT_FAIL_BIT) |
pymal | 0:1d10a6e6808c | 73 | #define RESULT_OPERATION_NOT_SUPPORT (0x8004 | RESULT_FAIL_BIT) |
pymal | 0:1d10a6e6808c | 74 | #define RESULT_FORMAT_NOT_SUPPORT (0x8005 | RESULT_FAIL_BIT) |
pymal | 0:1d10a6e6808c | 75 | #define RESULT_INSUFFICIENT_MEMORY (0x8006 | RESULT_FAIL_BIT) |
pymal | 0:1d10a6e6808c | 76 | |
pymal | 0:1d10a6e6808c | 77 | #define IS_OK(x) ( ((x) & RESULT_FAIL_BIT) == 0 ) |
pymal | 0:1d10a6e6808c | 78 | #define IS_FAIL(x) ( ((x) & RESULT_FAIL_BIT) ) |
pymal | 0:1d10a6e6808c | 79 | |
pymal | 0:1d10a6e6808c | 80 | //typedef _word_size_t (THREAD_PROC * thread_proc_t ) ( void * ); |