Ronex_Protocol_0x02000003_TCAT_00.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2013, Shadow Robot Company, All rights reserved.
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 3.0 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library.
00016  */
00017 
00019 
00020 #ifndef RONEX_PROTOCOL_0x02000003_TCAT_H_INCLUDED
00021 #define RONEX_PROTOCOL_0x02000003_TCAT_H_INCLUDED
00022 
00023 #include "typedefs_shadow.h"
00024 
00025 #if defined(__GNUC__)
00026 
00027 #else
00028     #define __attribute__(x)
00029 #endif
00030 
00031 
00032 #define RONEX_COMMAND_02000003_MASTER_CLOCK_SPEED_HZ        64000000        //!< Master clock. This is divided down to create the SPI clock.
00033 #define NUM_ANALOGUE_INPUTS                                        0
00034 #define ANALOGUE_INPUT_RESOLUTION                                  0        //!<
00035 #define ANALOGUE_INPUT_JUSTIFICATION                           RIGHT
00036 #define NUM_ANALOGUE_OUTPUTS                                       0
00037 #define ANALOGUE_OUTPUT_RESOLUTION                                 0
00038 #define ANALOGUE_OUTPUT_JUSTIFICATION                          RIGHT
00039 #define NUM_DIGITAL_IO                                             0
00040 #define PRODUCT_NAME                                          "tcat"
00041 #define PRODUCT_ID                                        0x02000003
00042 #define MAXIMUM_NUM_STACKERS                                       2
00043 #define STACKER_TYPE                                               2            //!< range [1..13]
00044 #define IMPULSE_RESPONSE_SIZE                                     64
00045 #define NUM_RECEIVERS                                              4
00046 #define NUM_RESERVED_WORDS                                         8
00047 #define PAYLOAD_MAX_SIZE                                          32
00048 #define COMMAND_DATA_MAX_SIZE                                     32
00049 
00058 #define RONEX_COMMAND_02000003_COMMAND_TYPE_INVALID         0x0000      //!< Zeros imply a failed EtherCAT packet, so this it taken to be invalid.
00059 #define RONEX_COMMAND_02000003_COMMAND_TYPE_NORMAL          0x0001      //!< This is for normal operation.
00060 #define RONEX_COMMAND_02000003_COMMAND_TYPE_CONFIG_INFO     0x0002      //!< This requests a CONFIG_INFO_02000002 block from the node.
00061 #define RONEX_COMMAND_02000003_COMMAND_TYPE_ERROR           0x00FF      //!< If this is returned from the node, then some kind of error has happened.
00062 
00063 
00064 
00068 #define RONEX_02000003_FLAGS_STACKER_0_PRESENT                0x1000
00069 #define RONEX_02000003_FLAGS_STACKER_1_PRESENT                0x2000
00070 #define RONEX_02000003_FLAGS_STACKER_2_PRESENT                0x4000
00071 #define RONEX_02000003_FLAGS_STACKER_3_PRESENT                0x8000
00072 #define RONEX_02000003_FLAGS_STACKER_0_ERROR                  0x0100
00073 #define RONEX_02000003_FLAGS_STACKER_1_ERROR                  0x0200
00074 #define RONEX_02000003_FLAGS_STACKER_2_ERROR                  0x0400
00075 #define RONEX_02000003_FLAGS_STACKER_3_ERROR                  0x0800
00076 #define RONEX_02000003_FLAGS_RESERVED_ERRORS                  0x00FC
00077 #define RONEX_02000003_FLAGS_OVER_TEMPERATURE_ERROR           0x0002
00078 #define RONEX_02000003_FLAGS_UNKNOWN_ERROR                    0x0001
00079 
00080 
00081 
00085 #define TCAT_CHANNEL_1                                          0x0001
00086 #define TCAT_CHANNEL_2                                          0x0002
00087 #define TCAT_CHANNEL_3                                          0x0003
00088 #define TCAT_CHANNEL_4                                          0x0004
00089 #define TCAT_CHANNEL_5                                          0x0005
00090 #define TCAT_CHANNEL_7                                          0x0006
00091 
00092 #define TCAT_PREAMBLE_1                                         0x0010
00093 #define TCAT_PREAMBLE_2                                         0x0020
00094 #define TCAT_PREAMBLE_3                                         0x0030
00095 #define TCAT_PREAMBLE_4                                         0x0040
00096 #define TCAT_PREAMBLE_5                                         0x0050
00097 #define TCAT_PREAMBLE_6                                         0x0060
00098 #define TCAT_PREAMBLE_7                                         0x0070
00099 #define TCAT_PREAMBLE_8                                         0x0080
00100 #define TCAT_PREAMBLE_LEN_64                                    0x0000
00101 #define TCAT_PREAMBLE_LEN_128                                   0x0100
00102 #define TCAT_PREAMBLE_LEN_256                                   0x0200
00103 #define TCAT_PREAMBLE_LEN_512                                   0x0300
00104 #define TCAT_PREAMBLE_LEN_1024                                  0x0400
00105 #define TCAT_PREAMBLE_LEN_1536                                  0x0500
00106 #define TCAT_PREAMBLE_LEN_2048                                  0x0600
00107 #define TCAT_PREAMBLE_LEN_4096                                  0x0700
00108 #define TCAT_PRF_16MHZ                                          0x0000
00109 #define TCAT_PRF_64MHZ                                          0x0800
00110 
00111 #define TCAT_DATA_RATE_110KBPS                                  0x1000
00112 #define TCAT_DATA_RATE_850KBPS                                  0x2000
00113 #define TCAT_DATA_RATE_6810KBPS                                 0x3000
00114 
00115 #define TCAT_STD_FRAME                                                  0x1000
00116 #define TCAT_NON_STD_FRAME                                              0x2000
00117 
00118 
00119 
00131 #define IMPLEMENTED_FEATURE_CHANNEL_SETUP                     0x0001
00132 
00133 
00134 
00135 
00139 #define FPI_FIXED_POINT_TO_FLOAT(fpi)   ((float)fpi * (1.0f/64.0f))
00140 
00141 
00142 typedef struct
00143 {
00144     int16s real;
00145     int16s imaginary;
00146 }IMPULSE_SAMPLE;
00147 
00148 
00157 typedef struct
00158 {
00159     int16u          reserved[NUM_RESERVED_WORDS];
00160     IMPULSE_SAMPLE  impulse_response[IMPULSE_RESPONSE_SIZE];
00161     int16u          first_sample_number;
00162     int16u          payload[PAYLOAD_MAX_SIZE];
00163     int32u          rx_frame_information;
00164     int16u          std_noise;
00165     int32u          flags;
00166     int16u          FPI;
00167     int32u          timestamp_L;
00168     int16u          timestamp_H;
00169 }__attribute__((packed)) RECEIVER_DATA;
00170 
00171 
00172 
00173 typedef struct
00174 {
00175     int16u     command_type;
00176 
00177     int16u     command_number;
00178     int16u     command_data_size;
00179     int16u     command_data[COMMAND_DATA_MAX_SIZE];
00180 
00181 }__attribute__((packed)) RONEX_COMMAND_02000003;
00182 
00183 
00184 
00198 typedef struct
00199 {
00200     int16u             command_type;
00201     int16u             sequence_number;
00202     int16u             receiver_number;
00203     RECEIVER_DATA      receiver_data;
00204 }__attribute__((packed)) RONEX_STATUS_02000003;
00205 
00206 
00207 #define COMMAND_ARRAY_SIZE_BYTES    (sizeof(RONEX_COMMAND_02000003))
00208 #define COMMAND_ARRAY_SIZE_WORDS    (sizeof(RONEX_COMMAND_02000003)/2)
00209 #define STATUS_ARRAY_SIZE_BYTES     (sizeof(RONEX_STATUS_02000003))
00210 #define STATUS_ARRAY_SIZE_WORDS     (sizeof(RONEX_STATUS_02000003)/2)
00211 
00212 
00213                                                                             // Queued (Mailbox)
00214                                                                             // Syncmanager Definitions
00215                                                                             // -----------------------
00216 #define PROTOCOL_TYPE   EC_QUEUED                                           //  Synchronous communication
00217 #define COMMAND_ADDRESS 0x1000                                              //!< ET1200 address containing the Command Structure
00218 #define STATUS_ADDRESS  (COMMAND_ADDRESS+sizeof(RONEX_COMMAND_02000003) *4) //!< ET1200 address containing the Status  Structure
00219 
00220 #define RONEX_COMMAND_STRUCT        RONEX_COMMAND_02000003                  //!< Required for et1200_interface.h to be generic
00221 #define RONEX_STATUS_STRUCT         RONEX_STATUS_02000003                   //!< Required for et1200_interface.h to be generic
00222 
00223 #endif


sr_ronex_external_protocol
Author(s): Ugo Cupcic, Toni Oliver, Mark Pitchless
autogenerated on Fri Aug 28 2015 13:12:14