KaCanOpen
 All Classes Functions Variables Typedefs Enumerations Pages
types.h
1 /*
2  * Copyright (c) 2015, Thomas Keh
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its
16  * contributors may be used to endorse or promote products derived from
17  * this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 #pragma once
33 
34 #include <cstdint>
35 
36 namespace kaco {
37 
39  enum class Type : uint16_t {
40 
41  uint8,
42  uint16,
43  uint32,
44  uint64,
45  int8,
46  int16,
47  int32,
48  int64,
49  real32,
50  real64,
51  string,
52  boolean,
53  octet_string,
54  invalid
55 
56  };
57 
59  enum class DataType : uint16_t {
60  BOOLEAN = 0x1,
61  INTEGER8 = 0x2,
62  INTEGER16 = 0x3,
63  INTEGER32 = 0x4,
64  UNSIGNED8 = 0x5,
65  UNSIGNED16 = 0x6,
66  UNSIGNED32 = 0x7,
67  REAL32 = 0x8,
68  VISIBLE_STRING = 0x9,
69  OCTET_STRING = 0xA,
70  UNICODE_STRING = 0xB,
71  TIME_OF_DAY = 0xC,
72  TIME_DIFFERENCE = 0xD,
73  // 0xE reserved
74  LARGEDATA = 0xF, // DOMAIN
75  INTEGER24 = 0x10,
76  REAL64 = 0x11,
77  INTEGER40 = 0x12,
78  INTEGER48 = 0x13,
79  INTEGER56 = 0x14,
80  INTEGER64 = 0x15,
81  // 0x17 reserved
82  UNSIGNED40 = 0x18,
83  UNSIGNED48 = 0x19,
84  UNSIGNED56 = 0x1A,
85  UNSIGNED64 = 0x1B,
86  // 0x1C - 0x1F reserved
87  PDO_COMMUNICATION_PARAMETER = 0x20,
88  PDO_MAPPING = 0x21,
89  SDO_PARAMETER = 0x22,
90  IDENTITY = 0x23,
91  // 0x24 - 0x3F reserved
92  // 0x40 - 0x5F Manufacturer specific
93  // 0x60 - 0x25F Device profile specific
94  };
95 
97  enum class ObjectType : uint8_t {
98  EMPTY = 0x0, // NULL
99  LARGEDATA = 0x2, // DOMAIN
100  DEFTYPE = 0x5,
101  DEFSTRUCT = 0x6,
102  VAR = 0x7,
103  ARRAY = 0x8,
104  RECORD = 0x9
105  };
106 
108  enum AccessType {
109  read_only,
110  write_only,
111  read_write,
112  constant
113  };
114 
116  enum class TransmissionType {
117  PERIODIC,
118  ON_CHANGE
119  };
120 
121 } // end namespace kaco